Blender V5.0
vk_data_conversion.cc File Reference
#include "vk_data_conversion.hh"
#include "BLI_color.hh"
#include "BLI_math_half.hh"

Go to the source code of this file.

Classes

struct  blender::gpu::ComponentValue< InnerType >
struct  blender::gpu::PixelValue< InnerType >
class  blender::gpu::B10F_G11G_R11F
class  blender::gpu::HALF4
struct  blender::gpu::Depth32fStencil8
struct  blender::gpu::SignedNormalized< InnerType >
struct  blender::gpu::UnsignedNormalized< InnerType >

Namespaces

namespace  blender
namespace  blender::gpu

Macros

#define CASE_SINGLE(a, b)
#define CASE_PAIR(a, b)

Functions

static void blender::gpu::convert (UI32 &dst, const Depth32fStencil8 &src)
static void blender::gpu::convert (Depth32fStencil8 &dst, const UI32 &src)
template<typename DestinationType, typename SourceType>
void blender::gpu::convert (MutableSpan< DestinationType > dst, Span< SourceType > src)
template<typename DestinationType, typename SourceType>
void blender::gpu::convert_per_component (void *dst_memory, const void *src_memory, size_t buffer_size, TextureFormat device_format)
template<typename DestinationType, typename SourceType>
void blender::gpu::convert_per_pixel (void *dst_memory, const void *src_memory, size_t buffer_size)
static void blender::gpu::convert_buffer (void *dst_memory, const void *src_memory, size_t buffer_size, TextureFormat device_format, ConversionType type)
API
void blender::gpu::convert_host_to_device (void *dst_buffer, const void *src_buffer, size_t buffer_size, eGPUDataFormat host_format, TextureFormat host_texture_format, TextureFormat device_format)
void blender::gpu::convert_device_to_host (void *dst_buffer, const void *src_buffer, size_t buffer_size, eGPUDataFormat host_format, TextureFormat host_texture_format, TextureFormat device_format)

Conversion types

enum class  blender::gpu::ConversionType {
  blender::gpu::PASS_THROUGH , blender::gpu::PASS_THROUGH_D32F_S8 , blender::gpu::FLOAT_TO_UNORM8 , blender::gpu::UNORM8_TO_FLOAT ,
  blender::gpu::FLOAT_TO_SNORM8 , blender::gpu::SNORM8_TO_FLOAT , blender::gpu::FLOAT_TO_UNORM16 , blender::gpu::UNORM16_TO_FLOAT ,
  blender::gpu::FLOAT_TO_SNORM16 , blender::gpu::SNORM16_TO_FLOAT , blender::gpu::FLOAT_TO_UNORM32 , blender::gpu::UNORM32_TO_FLOAT ,
  blender::gpu::UI32_TO_UI16 , blender::gpu::UI16_TO_UI32 , blender::gpu::UI32_TO_UI8 , blender::gpu::UI8_TO_UI32 ,
  blender::gpu::I32_TO_I16 , blender::gpu::I16_TO_I32 , blender::gpu::I32_TO_I8 , blender::gpu::I8_TO_I32 ,
  blender::gpu::HALF_TO_UI8 , blender::gpu::UI8_TO_HALF , blender::gpu::HALF_TO_FLOAT , blender::gpu::FLOAT_TO_HALF ,
  blender::gpu::FLOAT_TO_B10F_G11F_R11F , blender::gpu::B10F_G11F_R11F_TO_FLOAT , blender::gpu::FLOAT3_TO_HALF4 , blender::gpu::HALF4_TO_FLOAT3 ,
  blender::gpu::FLOAT3_TO_FLOAT4 , blender::gpu::FLOAT4_TO_FLOAT3 , blender::gpu::UINT_TO_DEPTH32F_STENCIL8 , blender::gpu::DEPTH32F_STENCIL8_TO_UINT ,
  blender::gpu::UNSUPPORTED
}
static ConversionType blender::gpu::type_of_conversion_float (const TextureFormat host_format, const TextureFormat device_format)
static ConversionType blender::gpu::type_of_conversion_int (TextureFormat device_format)
static ConversionType blender::gpu::type_of_conversion_uint (TextureFormat device_format)
static ConversionType blender::gpu::type_of_conversion_half (TextureFormat device_format)
static ConversionType blender::gpu::type_of_conversion_ubyte (TextureFormat device_format)
static ConversionType blender::gpu::type_of_conversion_uint248 (const TextureFormat device_format)
static ConversionType blender::gpu::type_of_conversion_r11g11b10 (TextureFormat device_format)
static ConversionType blender::gpu::type_of_conversion_r10g10b10a2 (TextureFormat device_format)
static ConversionType blender::gpu::host_to_device (const eGPUDataFormat host_format, const TextureFormat host_texture_format, const TextureFormat device_format)
static ConversionType blender::gpu::reversed (ConversionType type)

Data Conversion

using blender::gpu::UI8 = ComponentValue<uint8_t>
using blender::gpu::UI16 = ComponentValue<uint16_t>
using blender::gpu::UI32 = ComponentValue<uint32_t>
using blender::gpu::I8 = ComponentValue<int8_t>
using blender::gpu::I16 = ComponentValue<int16_t>
using blender::gpu::I32 = ComponentValue<int32_t>
using blender::gpu::F16 = ComponentValue<uint16_t>
using blender::gpu::F32 = ComponentValue<float>
using blender::gpu::FLOAT3 = PixelValue<float3>
using blender::gpu::FLOAT4 = PixelValue<ColorSceneLinear4f<eAlpha::Premultiplied>>
constexpr uint32_t blender::gpu::MASK_10_BITS = 0b1111111111
constexpr uint32_t blender::gpu::MASK_11_BITS = 0b11111111111
constexpr uint8_t blender::gpu::SHIFT_B = 22
constexpr uint8_t blender::gpu::SHIFT_G = 11
constexpr uint8_t blender::gpu::SHIFT_R = 0
static uint32_t blender::gpu::float_to_uint32_t (float value)
static float blender::gpu::uint32_t_to_float (uint32_t value)
template<typename StorageType>
void blender::gpu::convert (SignedNormalized< StorageType > &dst, const F32 &src)
template<typename StorageType>
void blender::gpu::convert (F32 &dst, const SignedNormalized< StorageType > &src)
template<typename StorageType>
void blender::gpu::convert (UnsignedNormalized< StorageType > &dst, const F32 &src)
template<typename StorageType>
void blender::gpu::convert (F32 &dst, const UnsignedNormalized< StorageType > &src)
template<typename StorageType>
void blender::gpu::convert (UnsignedNormalized< StorageType > &, const UI32 &)
template<typename StorageType>
void blender::gpu::convert (UI32 &dst, const UnsignedNormalized< StorageType > &src)
template<typename DestinationType, typename SourceType>
void blender::gpu::convert (DestinationType &dst, const SourceType &src)
static void blender::gpu::convert (FLOAT3 &dst, const HALF4 &src)
static void blender::gpu::convert (HALF4 &dst, const FLOAT3 &src)
static void blender::gpu::convert (FLOAT3 &dst, const FLOAT4 &src)
static void blender::gpu::convert (FLOAT4 &dst, const FLOAT3 &src)
static void blender::gpu::convert (F16 &dst, const UI8 &src)
static void blender::gpu::convert (UI8 &dst, const F16 &src)
static void blender::gpu::convert (FLOAT3 &dst, const B10F_G11G_R11F &src)
static void blender::gpu::convert (B10F_G11G_R11F &dst, const FLOAT3 &src)

Macro Definition Documentation

◆ CASE_PAIR

#define CASE_PAIR ( a,
b )
Value:
CASE_SINGLE(b, a)
#define CASE_SINGLE(a, b)

◆ CASE_SINGLE

#define CASE_SINGLE ( a,
b )
Value:
case ConversionType::a##_TO_##b: \
return ConversionType::b##_TO_##a;