Blender V4.5
blender::gpu Namespace Reference

Namespaces

namespace  debug
namespace  GLVertArray
namespace  render_graph
namespace  shader
namespace  tests

Classes

class  B10F_G11G_R11F
class  BindSpaceImages
class  BindSpaceStorageBuffers
class  BindSpaceTextures
class  BindSpaceUniformBuffers
struct  BufferBindingCached
struct  CompareMTLBuffer
struct  ComponentValue
class  Context
struct  DebugScope
struct  Depth24Stencil8
struct  Depth32fStencil8
class  DepthComponent24
class  DummyBackend
class  DummyBatch
class  DummyContext
class  DummyFrameBuffer
class  DummyVertexBuffer
class  Fence
class  FloatingPointFormat
class  FrameBuffer
class  GLBackend
class  GLBatch
class  GLCompute
class  GLContext
class  GLFence
class  GLFrameBuffer
class  GLImmediate
class  GLIndexBuf
class  GLLogParser
class  GLPixelBuffer
class  GLQueryPool
class  GLShader
class  GLShaderCompiler
class  GLShaderInterface
class  GLSharedOrphanLists
struct  GLSource
class  GLSources
struct  GLSourcesBaked
class  GLStateManager
class  GLStorageBuf
class  GLSubprocessShaderCompiler
class  GLTexture
class  GLUniformBuf
class  GLVaoCache
class  GLVertBuf
class  GPUBackend
struct  GPUCapabilities
struct  GPULogItem
class  GPULogParser
class  GPUPlatformGlobal
class  GPUSecondaryContext
struct  GPUSource
union  GPUState
union  GPUStateMutable
class  GPUTest
class  GPUWorker
class  HALF4
class  Immediate
class  IndexBuf
class  IndexBufDeleter
struct  LogCursor
struct  MSLBufferBlock
struct  MSLConstant
struct  MSLFragmentOutputAttribute
class  MSLGeneratorInterface
struct  MSLSharedMemoryBlock
struct  MSLTextureResource
struct  MSLUniform
struct  MSLVertexInputAttribute
struct  MSLVertexOutputAttribute
struct  MTLAttachment
class  MTLBackend
class  MTLBatch
struct  MTLBoundShaderState
class  MTLBuffer
struct  MTLBufferArgumentData
struct  MTLBufferHandle
class  MTLBufferPool
struct  MTLBufferRange
struct  MTLCapabilities
class  MTLCircularBuffer
class  MTLCommandBufferManager
struct  MTLComputePipelineStateCommon
struct  MTLComputePipelineStateDescriptor
struct  MTLComputePipelineStateInstance
class  MTLComputeState
class  MTLContext
class  MTLContextComputeUtils
struct  MTLContextDepthStencilState
struct  MTLContextGlobalShaderPipelineState
struct  MTLContextTextureUtils
class  MTLFence
class  MTLFrameBuffer
class  MTLImmediate
class  MTLIndexBuf
class  MTLLogParser
class  MTLPixelBuffer
class  MTLQueryPool
class  MTLRenderPassState
struct  MTLRenderPipelineStateDescriptor
struct  MTLRenderPipelineStateInstance
class  MTLSafeFreeList
struct  MTLSamplerArray
struct  MTLSamplerBinding
struct  MTLSamplerState
class  MTLScratchBufferManager
class  MTLShader
struct  MTLShaderBufferBlock
struct  MTLShaderBuilder
class  MTLShaderCompiler
struct  MTLShaderConstant
struct  MTLShaderInputAttribute
class  MTLShaderInterface
struct  MTLShaderSampler
struct  MTLShaderTexture
struct  MTLShaderUniform
struct  MTLSSBOAttribute
class  MTLStateManager
class  MTLStorageBuf
struct  MTLStorageBufferBinding
class  MTLTexture
struct  MTLTextureBinding
class  MTLUniformBuf
struct  MTLUniformBufferBinding
class  MTLVertBuf
struct  MTLVertexAttributeDescriptorPSO
struct  MTLVertexBufferLayoutDescriptorPSO
struct  MTLVertexDescriptor
struct  PackedNormal
class  PixelBuffer
struct  PixelValue
class  ProfileReport
class  QueryPool
struct  SamplerStateBindingCached
class  Shader
class  ShaderCompiler
struct  ShaderInput
class  ShaderInterface
struct  SignedNormalized
struct  SpecializationStateDescriptor
struct  SPIRVSidecar
class  StateManager
class  StaticShader
class  StaticShaderCache
struct  Std140
struct  Std430
class  StorageBuf
class  Texture
struct  TextureBindingCached
class  TexturePool
class  TimelineResources
class  UniformBuf
struct  UnsignedNormalized
class  VertBuf
class  VertBufDeleter
struct  VertexBufferID
class  VKBackend
class  VKBatch
class  VKBuffer
struct  VKBufferWithOffset
struct  VKComputeInfo
class  VKContext
struct  VKDescriptorBufferLayout
class  VKDescriptorBufferUpdator
class  VKDescriptorPools
class  VKDescriptorSet
struct  VKDescriptorSetLayoutInfo
class  VKDescriptorSetLayouts
class  VKDescriptorSetPoolUpdator
class  VKDescriptorSetTracker
class  VKDescriptorSetUpdator
class  VKDevice
class  VKDiscardPool
struct  VKExtensions
class  VKFence
class  VKFrameBuffer
struct  VKGraphicsInfo
class  VKImageView
struct  VKImageViewInfo
class  VKImmediate
class  VKIndexBuffer
class  VKLogParser
struct  VKMemoryExport
class  VKPipelinePool
class  VKPixelBuffer
class  VKPushConstants
class  VKQueryPool
struct  VKRenderGraphSubmitTask
struct  VKRenderGraphWait
struct  VKResourceBinding
class  VKResourcePool
class  VKResourceTracker
class  VKSampler
class  VKSamplers
class  VKShader
class  VKShaderCompiler
class  VKShaderInterface
class  VKShaderModule
class  VKStagingBuffer
class  VKStateManager
class  VKStorageBuffer
struct  VKSubmissionID
class  VKSubmissionTracker
class  VKTexture
class  VKThreadData
class  VKUniformBuffer
class  VKVertexAttributeObject
class  VKVertexBuffer
struct  VKWorkarounds

Typedefs

using IndexBufPtr = std::unique_ptr<IndexBuf, IndexBufDeleter>
using VertBufPtr = std::unique_ptr<gpu::VertBuf, gpu::VertBufDeleter>
using DebugStack = Vector<StringRef>
using GPUPrintFormatMap = Map<uint32_t, shader::PrintfFormat>
using GPUSourceDictionnary = Map<StringRef, struct GPUSource *>
using GPUFunctionDictionnary = Map<StringRef, GPUFunction *>
using MSLFragmentTileInputAttribute = MSLFragmentOutputAttribute
using TimelineValue = uint64_t
using AttributeMask = uint16_t
Memory Management.
using MTLTemporaryBuffer = MTLBufferRange

Enumerations

enum  GPUIndexBufType { GPU_INDEX_U16 , GPU_INDEX_U32 }
enum class  VertAttrType : uint8_t { Invalid = 0 }
enum  GPUQueryType { GPU_QUERY_OCCLUSION = 0 }
enum class  Severity { Unknown , Warning , Error , Note }
enum  eGPUTextureFormatFlag {
  GPU_FORMAT_DEPTH = (1 << 0) , GPU_FORMAT_STENCIL = (1 << 1) , GPU_FORMAT_INTEGER = (1 << 2) , GPU_FORMAT_NORMALIZED_INTEGER = (1 << 3) ,
  GPU_FORMAT_FLOAT = (1 << 4) , GPU_FORMAT_COMPRESSED = (1 << 5) , GPU_FORMAT_SRGB = (1 << 6) , GPU_FORMAT_SIGNED = (1 << 7) ,
  GPU_FORMAT_DEPTH_STENCIL = (GPU_FORMAT_DEPTH | GPU_FORMAT_STENCIL)
}
enum  eGPUTextureType {
  GPU_TEXTURE_1D = (1 << 0) , GPU_TEXTURE_2D = (1 << 1) , GPU_TEXTURE_3D = (1 << 2) , GPU_TEXTURE_CUBE = (1 << 3) ,
  GPU_TEXTURE_ARRAY = (1 << 4) , GPU_TEXTURE_BUFFER = (1 << 5) , GPU_TEXTURE_1D_ARRAY = (GPU_TEXTURE_1D | GPU_TEXTURE_ARRAY) , GPU_TEXTURE_2D_ARRAY = (GPU_TEXTURE_2D | GPU_TEXTURE_ARRAY) ,
  GPU_TEXTURE_CUBE_ARRAY = (GPU_TEXTURE_CUBE | GPU_TEXTURE_ARRAY)
}
enum  eGPUSamplerFormat {
  GPU_SAMPLER_TYPE_FLOAT = 0 , GPU_SAMPLER_TYPE_INT = 1 , GPU_SAMPLER_TYPE_UINT = 2 , GPU_SAMPLER_TYPE_DEPTH = 3 ,
  GPU_SAMPLER_TYPE_MAX = 4
}
enum  AppleGPUType { APPLE_GPU_UNKNOWN = 0 , APPLE_GPU_M1 = 1 , APPLE_GPU_M2 = 2 , APPLE_GPU_M3 = 3 }
enum  MTLPipelineStateDirtyFlag {
  MTL_PIPELINE_STATE_NULL_FLAG = 0 , MTL_PIPELINE_STATE_VIEWPORT_FLAG = (1 << 0) , MTL_PIPELINE_STATE_SCISSOR_FLAG = (1 << 1) , MTL_PIPELINE_STATE_DEPTHSTENCIL_FLAG = (1 << 2) ,
  MTL_PIPELINE_STATE_PSO_FLAG = (1 << 3) , MTL_PIPELINE_STATE_FRONT_FACING_FLAG = (1 << 4) , MTL_PIPELINE_STATE_CULLMODE_FLAG = (1 << 5) , MTL_PIPELINE_STATE_ALL_FLAG
}
enum  MSLTextureSamplerAccess {
  TEXTURE_ACCESS_NONE = 0 , TEXTURE_ACCESS_SAMPLE , TEXTURE_ACCESS_READ , TEXTURE_ACCESS_WRITE ,
  TEXTURE_ACCESS_READWRITE
}
enum class  ShaderStage : uint8_t { VERTEX = 1 << 0 , FRAGMENT = 1 << 1 , COMPUTE = 2 << 1 , ANY = (ShaderStage::VERTEX | ShaderStage::FRAGMENT | ShaderStage::COMPUTE) }
enum class  eImageViewUsage { ShaderBinding , Attachment }
enum class  VKImageViewArrayed { DONT_CARE , NOT_ARRAYED , ARRAYED }
enum  RenderGraphFlushFlags { NONE = 0 , RENEW_RENDER_GRAPH = 1 << 0 , SUBMIT = 1 << 1 , WAIT_FOR_COMPLETION = 1 << 2 }
enum  VKBindType {
  UNIFORM_BUFFER = 0 , STORAGE_BUFFER , SAMPLER , IMAGE ,
  INPUT_ATTACHMENT
}
enum class  VKImageViewFlags { DEFAULT = 0 , NO_SWIZZLING = 1 << 0 }
Data Formats
enum class  DataFormat : uint8_t { Invalid = 0 }

Functions

int convert_normalized_f32_to_i10 (float x)
template<typename GPUType>
GPUType convert_normal (const float3 &src)
template<>
PackedNormal convert_normal (const float3 &src)
template<>
short4 convert_normal (const float3 &src)
template<typename GPUType>
void convert_normals (Span< float3 > src, MutableSpan< GPUType > dst)
size_t to_bytesize (GPUIndexBufType type)
int indices_per_primitive (GPUPrimType prim_type)
constexpr DataFormat to_data_format (VertAttrType formatformat)
static GPUContext * wrap (Context *ctx)
static Contextunwrap (GPUContext *ctx)
static const Contextunwrap (const GPUContext *ctx)
static GPUFrameBuffer * wrap (FrameBuffer *vert)
static FrameBufferunwrap (GPUFrameBuffer *vert)
static const FrameBufferunwrap (const GPUFrameBuffer *vert)
static char * create_key (eGPUSupportLevel support_level, const char *vendor, const char *renderer, const char *version)
static char * create_gpu_name (const char *vendor, const char *renderer, const char *version)
static void sort_input_list (MutableSpan< ShaderInput > dst)
static GPUShader * wrap (Shader *vert)
static Shaderunwrap (GPUShader *vert)
static const Shaderunwrap (const GPUShader *vert)
 BLI_STATIC_ASSERT (sizeof(GPUState)==sizeof(uint64_t), "GPUState is too big.")
bool operator== (const GPUState &a, const GPUState &b)
bool operator!= (const GPUState &a, const GPUState &b)
GPUState operator^ (const GPUState &a, const GPUState &b)
GPUState operator~ (const GPUState &a)
 BLI_STATIC_ASSERT (sizeof(GPUStateMutable)==sizeof(GPUStateMutable::data), "GPUStateMutable is too big.")
bool operator== (const GPUStateMutable &a, const GPUStateMutable &b)
bool operator!= (const GPUStateMutable &a, const GPUStateMutable &b)
GPUStateMutable operator^ (const GPUStateMutable &a, const GPUStateMutable &b)
GPUStateMutable operator~ (const GPUStateMutable &a)
static GPUFence * wrap (Fence *pixbuf)
static Fenceunwrap (GPUFence *pixbuf)
static const Fenceunwrap (const GPUFence *pixbuf)
static GPUStorageBuf * wrap (StorageBuf *storage_buf)
static StorageBufunwrap (GPUStorageBuf *storage_buf)
static const StorageBufunwrap (const GPUStorageBuf *storage_buf)
static GPUTexture * wrap (Texture *vert)
static Textureunwrap (GPUTexture *vert)
static const Textureunwrap (const GPUTexture *vert)
static GPUPixelBuffer * wrap (PixelBuffer *pixbuf)
static PixelBufferunwrap (GPUPixelBuffer *pixbuf)
static const PixelBufferunwrap (const GPUPixelBuffer *pixbuf)
size_t to_bytesize (eGPUTextureFormat formatformat)
size_t to_block_size (eGPUTextureFormat data_type)
eGPUTextureFormatFlag to_format_flag (eGPUTextureFormat formatformat)
int to_component_len (eGPUTextureFormat formatformat)
size_t to_bytesize (eGPUDataFormat data_format)
size_t to_bytesize (eGPUTextureFormat tex_format, eGPUDataFormat data_format)
constexpr bool validate_data_format (eGPUTextureFormat tex_format, eGPUDataFormat data_format)
eGPUDataFormat to_data_format (eGPUTextureFormat tex_format)
eGPUFrameBufferBits to_framebuffer_bits (eGPUTextureFormat tex_format)
static eGPUTextureFormat to_texture_format (const GPUVertFormat *formatformat)
static GPUUniformBuf * wrap (UniformBuf *vert)
static UniformBufunwrap (GPUUniformBuf *vert)
static const UniformBufunwrap (const GPUUniformBuf *vert)
static VertAttrType vertex_format_combine (GPUVertCompType component_type, GPUVertFetchMode fetch_mode, uint32_t component_len)
bool is_fetch_normalized (VertAttrType attr_type)
bool is_fetch_int_to_float (VertAttrType attr_type)
bool is_fetch_float (VertAttrType attr_type)
template<typename GPUType>
static void convert_normals_impl (const Span< float3 > src, MutableSpan< GPUType > dst)
template<>
void convert_normals (const Span< float3 > src, MutableSpan< PackedNormal > dst)
template<>
void convert_normals (const Span< float3 > src, MutableSpan< short4 > dst)
int format_component_len (const VertAttrType formatformat)
int to_bytesize (const VertAttrType formatformat)
 ENUM_OPERATORS (MTLPipelineStateDirtyFlag, MTL_PIPELINE_STATE_CULLMODE_FLAG)
static MTLPrimitiveTopologyClass mtl_prim_type_to_topology_class (MTLPrimitiveType prim_type)
static MTLPrimitiveType gpu_prim_type_to_metal (GPUPrimType prim_type)
static bool mtl_needs_topology_emulation (GPUPrimType prim_type)
static bool mtl_vertex_count_fits_primitive_type (uint32_t vertex_count, MTLPrimitiveType prim_type)
static MTLVisibilityResultMode to_mtl_type (GPUQueryType type)
MTLVertexFormat format_resize_comp (MTLVertexFormat mtl_format, uint32_t components)
MTLVertexFormat format_get_component_type (MTLVertexFormat mtl_format)
MTLVertexFormat to_mtl (GPUVertCompType component_type, GPUVertFetchMode fetch_mode, uint32_t component_len)
int mtl_format_component_len (MTLVertexFormat formatformat)
bool mtl_format_is_normalized (MTLVertexFormat formatformat)
MTLVertexFormat mtl_convert_vertex_format_ex (MTLVertexFormat shader_attr_format, GPUVertCompType component_type, uint32_t component_len, GPUVertFetchMode fetch_mode)
bool mtl_convert_vertex_format (MTLVertexFormat shader_attr_format, GPUVertCompType component_type, uint32_t component_len, GPUVertFetchMode fetch_mode, MTLVertexFormat *r_convertedFormat)
const char * to_string (ShaderStage stage)
const char * get_stage_class_name (ShaderStage stage)
const char * get_shader_stage_instance_name (ShaderStage stage)
bool is_builtin_type (std::string type)
bool is_matrix_type (const std::string &type)
bool is_matrix_type (const shader::Type &type)
int get_matrix_location_count (const std::string &type)
int get_matrix_location_count (const shader::Type &type)
std::string get_matrix_subtype (const std::string &type)
shader::Type get_matrix_subtype (const shader::Type &type)
std::string get_attribute_conversion_function (bool *uses_conversion, const shader::Type &type)
const char * to_string_msl (const shader::Interpolation &interp)
char * next_symbol_in_range (char *begin, const char *end, char symbol)
char * next_word_in_range (char *begin, const char *end)
 ENUM_OPERATORS (ShaderStage, ShaderStage::ANY)
uint get_shader_stage_index (ShaderStage stage)
MTLVertexFormat mtl_datatype_to_vertex_type (eMTLDataType type)
std::string tex_data_format_to_msl_type_str (eGPUDataFormat type)
std::string tex_data_format_to_msl_texture_template_type (eGPUDataFormat type)
MTLTextureType to_metal_type (eGPUTextureType type)
bool mtl_format_is_writable (MTLPixelFormat formatformat)
MTLPixelFormat mtl_format_get_writeable_view_format (MTLPixelFormat formatformat)
MTLTextureUsage mtl_usage_from_gpu (eGPUTextureUsage usage)
eGPUTextureUsage gpu_usage_from_mtl (MTLTextureUsage mtl_usage)
static GLenum to_gl (GPUIndexBufType type)
static GLenum to_gl (GPUPrimType prim_type)
static GLenum to_gl (GPUQueryType type)
static GLbitfield to_gl (eGPUBarrier barrier_bits)
GLenum to_gl_internal_format (eGPUTextureFormat formatformat)
GLenum to_gl_target (eGPUTextureType type)
GLenum to_gl_proxy (eGPUTextureType type)
GLenum swizzle_to_gl (const char swizzle)
GLenum to_gl (eGPUDataFormat formatformat)
GLenum to_gl_data_format (eGPUTextureFormat formatformat)
GLenum channel_len_to_gl (int channel_len)
static GLenum to_gl (GPUUsageType type)
static GLenum to_gl (GPUVertCompType type)
template<typename Layout>
static void def_attr (const shader::Type type, const int array_size, const uint32_t expected_alignment, const uint32_t expected_reserve, uint32_t *r_offset)
 TEST (std140, fl)
 TEST (std140, _2fl)
 TEST (std140, _3fl)
 TEST (std140, _4fl)
 TEST (std140, fl2)
 TEST (std140, fl_fl2)
 TEST (std140, fl_vec2)
 TEST (std140, gpu_shader_2D_widget_base)
 TEST (std430, overlay_grid)
 TEST (std430, simple_lighting)
 TEST (std430, compositor_cryptomatte_matte_compute)
static const char * vk_extension_get (int index)
bool GPU_vulkan_is_supported_driver (VkPhysicalDevice vk_physical_device)
static Vector< StringRefNullmissing_capabilities_get (VkPhysicalDevice vk_physical_device)
static eGPUOSType determine_os_type ()
static void init_device_list (GHOST_ContextHandle ghost_context)
VKBatchunwrap (Batch *batch)
VkImageAspectFlags to_vk_image_aspect_flag_bits (const eGPUTextureFormat formatformat)
VkImageAspectFlags to_vk_image_aspect_flag_bits (const eGPUFrameBufferBits buffers)
eGPUTextureFormat to_gpu_format (const VkFormat formatformat)
VkFormat to_vk_format (const eGPUTextureFormat formatformat)
static VkFormat to_vk_format_norm (const GPUVertCompType type, const uint32_t size)
static VkFormat to_vk_format_float (const GPUVertCompType type, const uint32_t size)
static VkFormat to_vk_format_int (const GPUVertCompType type, const uint32_t size)
VkFormat to_vk_format (const GPUVertCompType type, const uint32_t size, GPUVertFetchMode fetch_mode)
VkFormat to_vk_format (const shader::Type type)
VkQueryType to_vk_query_type (const GPUQueryType query_type)
VkImageType to_vk_image_type (const eGPUTextureType type)
VkImageViewType to_vk_image_view_type (const eGPUTextureType type, const eImageViewUsage view_type, VKImageViewArrayed arrayed)
VkComponentSwizzle to_vk_component_swizzle (const char swizzle)
template<typename T>
void copy_color (T dst[4], const T *src)
VkClearColorValue to_vk_clear_color_value (const eGPUDataFormat formatformat, const void *data)
VkIndexType to_vk_index_type (const GPUIndexBufType index_type)
VkPrimitiveTopology to_vk_primitive_topology (const GPUPrimType prim_type)
VkCullModeFlags to_vk_cull_mode_flags (const eGPUFaceCullTest cull_test)
VkSamplerAddressMode to_vk_sampler_address_mode (const GPUSamplerExtendMode extend_mode)
static VkDescriptorType to_vk_descriptor_type_image (const shader::ImageType &image_type)
static VkDescriptorType to_vk_descriptor_type_sampler (const shader::ImageType &image_type)
VkDescriptorType to_vk_descriptor_type (const shader::ShaderCreateInfo::Resource &resource)
template<typename T>
VkObjectType to_vk_object_type (T)
 ENUM_OPERATORS (RenderGraphFlushFlags, RenderGraphFlushFlags::WAIT_FOR_COMPLETION)
BLI_INLINE bool operator== (const VKContext &a, const VKContext &b)
static void align_size (VkDeviceSize &r_size, VkDeviceSize alignment)
constexpr GPULoadStore default_load_store ()
static VKFrameBufferunwrap (FrameBuffer *framebuffer)
static VkFormat to_non_srgb_format (const VkFormat formatformat)
static VkDeviceSize new_buffer_size (VkDeviceSize sub_buffer_size)
static VKIndexBufferunwrap (IndexBuf *index_buffer)
template<typename LayoutT>
static uint32_t element_stride (const shader::Type type)
template<typename LayoutT>
static uint32_t array_stride (const shader::Type type)
template<typename LayoutT>
static void align (const shader::Type &type, const int32_t array_size, uint32_t *r_offset)
template<typename LayoutT>
static void reserve (const shader::Type type, int32_t array_size, uint32_t *r_offset)
template<typename LayoutT>
static void align_end_of_struct (uint32_t *r_offset)
static VKPixelBufferunwrap (PixelBuffer *pixel_buffer)
template<typename LayoutT>
static VKPushConstants::Layout::PushConstant init_constant (const shader::ShaderCreateInfo::PushConst &push_constant, const ShaderInput &shader_input, uint32_t *r_offset)
template<typename LayoutT>
uint32_t struct_size (Span< shader::ShaderCreateInfo::PushConst > push_constants)
template<typename LayoutT>
void init_struct (const shader::ShaderCreateInfo &info, const VKShaderInterface &interface, Vector< VKPushConstants::Layout::PushConstant > &r_struct, uint32_t *r_offset)
static std::string main_function_wrapper (std::string &pre_main, std::string &post_main)
static std::string combine_sources (Span< StringRefNull > sources)
static Type to_component_type (const Type &type)
static StageInterfaceInfofind_interface_by_name (const Span< StageInterfaceInfo * > ifaces, const StringRefNull name)
static void declare_emit_vertex (std::stringstream &ss)
static VKShaderunwrap (Shader &shader)
static VKShaderunwrap (Shader *shader)
static std::optional< std::string > cache_dir_get ()
static VKBindType to_bind_type (shader::ShaderCreateInfo::Resource::BindType bind_type)
static int32_t shader_input_index (const ShaderInput *shader_inputs, const ShaderInput *shader_input)
BLI_INLINE VKStorageBufferunwrap (StorageBuf *storage_buffer)
static VkImageAspectFlags to_vk_image_aspect_single_bit (const VkImageAspectFlags formatformat, bool stencil)
static VkImageUsageFlags to_vk_image_usage (const eGPUTextureUsage usage, const eGPUTextureFormatFlag format_flag)
static VkImageCreateFlags to_vk_image_create (const eGPUTextureType texture_type, const eGPUTextureFormatFlag format_flag, const eGPUTextureUsage usage)
static float memory_priority (const eGPUTextureUsage texture_usage)
BLI_INLINE VKTextureunwrap (Texture *tex)
BLI_INLINE Texturewrap (VKTexture *texture)
static std::string to_string_handle (uint64_t vk_handle)
std::string to_string (VkBuffer vk_handle)
std::string to_string (VkImage vk_handle)
std::string to_string (VkImageView vk_handle)
std::string to_string (VkRenderPass vk_handle)
std::string to_string (VkFramebuffer vk_handle)
std::string to_string (VkPipelineLayout vk_handle)
std::string to_string (VkPipeline vk_handle)
std::string to_string (VkDescriptorSet vk_handle)
const char * to_string (const VkAttachmentLoadOp vk_attachment_load_op)
const char * to_string (const VkAttachmentStoreOp vk_attachment_store_op)
const char * to_string (const VkFilter vk_filter)
const char * to_string (const VkImageLayout vk_image_layout)
const char * to_string (const VkIndexType vk_index_type)
const char * to_string (const VkObjectType vk_object_type)
const char * to_string (const VkPipelineBindPoint vk_pipeline_bind_point)
const char * to_string (const VkResolveModeFlagBits vk_resolve_mode_flag_bits)
const char * to_string (const VkSubpassContents vk_subpass_contents)
std::string to_string_vk_access_flags (const VkAccessFlags vk_access_flags)
std::string to_string_vk_dependency_flags (const VkDependencyFlags vk_dependency_flags)
std::string to_string_vk_image_aspect_flags (const VkImageAspectFlags vk_image_aspect_flags)
std::string to_string_vk_pipeline_stage_flags (const VkPipelineStageFlags vk_pipeline_stage_flags)
std::string to_string_vk_rendering_flags (const VkRenderingFlags vk_rendering_flags)
std::string to_string_vk_shader_stage_flags (const VkShaderStageFlags vk_shader_stage_flags)
std::string to_string (const VkBufferCopy &vk_buffer_copy, int indentation_level)
std::string to_string (const VkBufferImageCopy &vk_buffer_image_copy, int indentation_level)
std::string to_string (const VkBufferMemoryBarrier &vk_buffer_memory_barrier, int indentation_level)
std::string to_string (const VkClearAttachment &vk_clear_attachment, int indentation_level)
std::string to_string (const VkClearDepthStencilValue &vk_clear_depth_stencil_value, int indentation_level)
std::string to_string (const VkClearRect &vk_clear_rect, int indentation_level)
std::string to_string (const VkExtent2D &vk_extent2_d, int indentation_level)
std::string to_string (const VkExtent3D &vk_extent3_d, int indentation_level)
std::string to_string (const VkImageBlit &vk_image_blit, int indentation_level)
std::string to_string (const VkImageCopy &vk_image_copy, int indentation_level)
std::string to_string (const VkImageMemoryBarrier &vk_image_memory_barrier, int indentation_level)
std::string to_string (const VkImageSubresourceLayers &vk_image_subresource_layers, int indentation_level)
std::string to_string (const VkImageSubresourceRange &vk_image_subresource_range, int indentation_level)
std::string to_string (const VkMemoryBarrier &vk_memory_barrier, int indentation_level)
std::string to_string (const VkOffset2D &vk_offset2_d, int indentation_level)
std::string to_string (const VkOffset3D &vk_offset3_d, int indentation_level)
std::string to_string (const VkRect2D &vk_rect2_d, int indentation_level)
std::string to_string (const VkRenderPassBeginInfo &vk_render_pass_begin_info, int indentation_level)
std::string to_string (const VkRenderingAttachmentInfo &vk_rendering_attachment_info, int indentation_level)
std::string to_string (const VkRenderingInfo &vk_rendering_info, int indentation_level)
BLI_INLINE UniformBufwrap (VKUniformBuffer *uniform_buffer)
BLI_INLINE VKVertexBufferunwrap (VertBuf *vertex_buffer)
Utilities

Allow querying information about the format enum values.

int to_bytesize (const DataFormat formatformat)
int format_component_len (const DataFormat formatformat)
Shader Debug Printf
void printf_begin (Context *ctx)
void printf_end (Context *ctx)
Capabilities
static const char * mtl_extensions_get_null (int)
bool supports_barycentric_whitelist (id< MTLDevice > device)
bool is_apple_sillicon (id< MTLDevice > device)
static int get_num_performance_cpu_cores (id< MTLDevice > device)
static int get_num_efficiency_cpu_cores (id< MTLDevice > device)
static bool detect_mip_render_workaround ()
static const char * gl_extension_get (int i)
static void detect_workarounds ()
Swap-chain management and Metal presentation.
void present (MTLRenderPassDescriptor *blit_descriptor, id< MTLRenderPipelineState > blit_pso, id< MTLTexture > swapchain_texture, id< CAMetalDrawable > drawable)
Texture State Management
static MTLSamplerAddressMode to_mtl_type (GPUSamplerExtendMode wrap_mode)
MTLLoadAction mtl_load_action_from_gpu (eGPULoadOp action)
MTLStoreAction mtl_store_action_from_gpu (eGPUStoreOp action)
Index buffer optimization and topology emulation

Index buffer optimization and emulation. Optimize index buffers by eliminating restart-indices. Emulate unsupported index types e.g. Triangle Fan and Line Loop.

template<typename T>
static uint32_t populate_optimized_tri_strip_buf (Span< T > original_data, MutableSpan< T > output_data, uint32_t input_index_len)
template<typename T>
static uint32_t populate_emulated_tri_fan_buf (Span< T > original_data, MutableSpan< T > output_data, uint32_t input_index_len)
Shader specialization common utilities.
static void populate_specialization_constant_values (MTLFunctionConstantValues *values, const shader::SpecializationConstants &shader_constants, const SpecializationStateDescriptor &specialization_descriptor)
Create Info
const char * to_string (const shader::PrimitiveOut &layout)
const char * to_string (const shader::PrimitiveIn &layout)
const char * to_string (const shader::Interpolation &interp)
const char * to_string (const shader::Type &type)
static const char * to_string (const eGPUTextureFormat &type)
static const char * to_string (const DepthWrite &value)
static void print_image_type (std::ostream &os, const ImageType &type, const ShaderCreateInfo::Resource::BindType bind_type)
static std::ostream & print_qualifier (std::ostream &os, const Qualifier &qualifiers)
static void print_resource (std::ostream &os, const VKDescriptorSet::Location location, const ShaderCreateInfo::Resource &res)
static void print_resource (std::ostream &os, const VKShaderInterface &shader_interface, const ShaderCreateInfo::Resource &res)
int get_location_count (const Type &type)
static void print_interface_as_attributes (std::ostream &os, const std::string &prefix, const StageInterfaceInfo &iface, int &location)
static void print_interface_as_struct (std::ostream &os, const std::string &prefix, const StageInterfaceInfo &iface, int &location, const StringRefNull &suffix)
static void print_interface (std::ostream &os, const std::string &prefix, const StageInterfaceInfo &iface, int &location, const StringRefNull &suffix="")
Shader Translation utility functions.
static eMTLDataType to_mtl_type (Type type)
static std::regex remove_non_numeric_characters ("[^0-9]")
static void extract_and_replace_clipping_distances (std::string &vertex_source, MSLGeneratorInterface &msl_iface)
MTLShader builtin shader generation utilities.
static void print_resource (std::ostream &os, const ShaderCreateInfo::Resource &res)
Shader Translation.
static void generate_specialization_constant_declarations (const shader::ShaderCreateInfo *info, std::stringstream &ss)
static void generate_compilation_constant_declarations (const shader::ShaderCreateInfo *info, std::stringstream &ss)
constexpr size_t const_strlen (const char *str)
static char parameter_delimiter (bool &is_first_parameter)
static uint32_t name_buffer_copystr (char **name_buffer_ptr, const char *str_to_copy, uint32_t &name_buffer_size, uint32_t &name_buffer_offset)
State setting functions
static MTLCompareFunction gpu_depth_function_to_metal (eGPUDepthTest depth_func)
static MTLCompareFunction gpu_stencil_func_to_metal (eGPUStencilTest stencil_func)
static void mtl_stencil_set_op_separate (MTLContext *context, eGPUFaceCullTest face, MTLStencilOperation stencil_fail, MTLStencilOperation depth_test_fail, MTLStencilOperation depthstencil_pass)
static void mtl_stencil_set_op (MTLContext *context, MTLStencilOperation stencil_fail, MTLStencilOperation depth_test_fail, MTLStencilOperation depthstencil_pass)
Texture Utility Functions
MTLPixelFormat gpu_texture_format_to_metal (eGPUTextureFormat tex_format)
size_t get_mtl_format_bytesize (MTLPixelFormat tex_format)
int get_mtl_format_num_components (MTLPixelFormat tex_format)
bool mtl_format_supports_blending (MTLPixelFormat formatformat)
Operations
static MTLTextureSwizzle swizzle_to_mtl (const char swizzle)
Platform
static bool match_renderer (StringRef renderer, const Vector< std::string > &items)
static bool parse_version (const std::string &version, const std::string &formatformat, Vector< int > &r_version)
static bool is_bad_AMD_driver (const char *version_cstr)
Enums Conversion
static GLenum to_gl (const GPUAttachmentType type)
static GLbitfield to_gl (const eGPUFrameBufferBits bits)
Binding assignment

To mimic vulkan, we assign binding at shader creation to avoid shader recompilation. In the future, we should set it in the shader using layout(binding = i) and query its value.

static int block_binding (int32_t program, uint32_t block_index)
static int sampler_binding (int32_t program, uint32_t uniform_index, int32_t uniform_location, int *sampler_len)
static int image_binding (int32_t program, uint32_t uniform_index, int32_t uniform_location, int *image_len)
static int ssbo_binding (int32_t program, uint32_t ssbo_index)
Creation / Destruction
static Type gpu_type_from_gl_type (int gl_type)
Sampler objects
static GLenum to_gl (GPUSamplerExtendMode extend_mode)
Vertex Array Bindings
static uint16_t vbo_bind (const ShaderInterface *interface, const GPUVertFormat *formatformat, uint v_first, uint v_len, const bool use_instancing)
API
void convert_host_to_device (void *dst_buffer, const void *src_buffer, size_t buffer_size, eGPUDataFormat host_format, eGPUTextureFormat host_texture_format, eGPUTextureFormat device_format)
void convert_device_to_host (void *dst_buffer, const void *src_buffer, size_t buffer_size, eGPUDataFormat host_format, eGPUTextureFormat host_texture_format, eGPUTextureFormat device_format)
Load/Store operations
static VkAttachmentLoadOp to_vk_attachment_load_op (eGPULoadOp load_op)
static VkAttachmentStoreOp to_vk_attachment_store_op (eGPUStoreOp store_op)
static void set_load_store (VkRenderingAttachmentInfo &r_rendering_attachment, const GPULoadStore &ls)
Blit operations
static void blit_aspect (VKContext &context, VKTexture &dst_texture, VKTexture &src_texture, int dst_offset_x, int dst_offset_y, VkImageAspectFlags image_aspect)
SPIR-V disk cache
static bool read_spirv_from_disk (VKShaderModule &shader_module)
static void write_spirv_to_disk (VKShaderModule &shader_module)
Compilation
static StringRef to_stage_name (shaderc_shader_kind stage)
static bool compile_ex (shaderc::Compiler &compiler, VKShader &shader, shaderc_shader_kind stage, VKShaderModule &shader_module)
Update bindings
static uint32_t to_binding_location_len (const GPUVertAttr &attribute)
static uint32_t to_binding_location_len (const shader::Type type)

Variables

constexpr uint32_t RESTART_INDEX = 0xFFFFFFFF
GPUCapabilities GCaps
GPUPlatformGlobal GPG
NSAutoreleasePool * g_autoreleasepool = nil
int g_autoreleasepool_depth = 0
static const size_t VISIBILITY_COUNT_PER_BUFFER = 512
static const size_t VISIBILITY_RESULT_SIZE_IN_BYTES = 8
std::mutex msl_patch_default_lock
static const int MTL_MAX_MIPMAP_COUNT = 15
static const int MTL_MAX_FBO_ATTACHED = 16
const MTLSamplerState DEFAULT_SAMPLER_STATE = {GPUSamplerState::default_sampler() }
static CLG_LogRef LOG = {"gpu.vulkan"}
constexpr size_t DEFAULT_INTERNAL_BUFFER_SIZE = 4 * 1024 * 1024
static CLG_LogRef LOG = {"gpu.vulkan"}
static constexpr int BIND_SPACE_IMAGE_OFFSET = 512
Platform/driver/device information
constexpr int32_t PCI_ID_NVIDIA = 0x10de
constexpr int32_t PCI_ID_INTEL = 0x8086
constexpr int32_t PCI_ID_AMD = 0x1002
constexpr int32_t PCI_ID_ATI = 0x1022
constexpr int32_t PCI_ID_APPLE = 0x106b

Texture Formats

enum class  TextureFormat : uint8_t { Invalid = 0 }
enum class  TextureTargetFormat : uint8_t { Invalid = 0 }
enum class  TextureWriteFormat : uint8_t { Invalid = 0 }
constexpr DataFormat to_data_format (TextureFormat formatformat)
constexpr TextureFormat to_texture_format (TextureTargetFormat formatformat)
constexpr TextureFormat to_texture_format (TextureWriteFormat formatformat)

Conversion types

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

Data Conversion

using UI8 = ComponentValue<uint8_t>
using UI16 = ComponentValue<uint16_t>
using UI32 = ComponentValue<uint32_t>
using I8 = ComponentValue<int8_t>
using I16 = ComponentValue<int16_t>
using I32 = ComponentValue<int32_t>
using F16 = ComponentValue<uint16_t>
using F32 = ComponentValue<float>
using SRGBA8 = PixelValue<ColorSceneLinearByteEncoded4b<eAlpha::Premultiplied>>
using FLOAT3 = PixelValue<float3>
using FLOAT4 = PixelValue<ColorSceneLinear4f<eAlpha::Premultiplied>>
constexpr uint32_t MASK_10_BITS = 0b1111111111
constexpr uint32_t MASK_11_BITS = 0b11111111111
constexpr uint8_t SHIFT_B = 22
constexpr uint8_t SHIFT_G = 11
constexpr uint8_t SHIFT_R = 0
static uint32_t float_to_uint32_t (float value)
static float uint32_t_to_float (uint32_t value)
template<typename StorageType>
void convert (SignedNormalized< StorageType > &dst, const F32 &src)
template<typename StorageType>
void convert (F32 &dst, const SignedNormalized< StorageType > &src)
template<typename StorageType>
void convert (UnsignedNormalized< StorageType > &dst, const F32 &src)
template<typename StorageType>
void convert (F32 &dst, const UnsignedNormalized< StorageType > &src)
template<typename StorageType>
void convert (UnsignedNormalized< StorageType > &, const UI32 &)
template<typename StorageType>
void convert (UI32 &dst, const UnsignedNormalized< StorageType > &src)
template<typename DestinationType, typename SourceType>
void convert (DestinationType &dst, const SourceType &src)
static void convert (SRGBA8 &dst, const FLOAT4 &src)
static void convert (FLOAT4 &dst, const SRGBA8 &src)
static void convert (FLOAT3 &dst, const HALF4 &src)
static void convert (HALF4 &dst, const FLOAT3 &src)
static void convert (FLOAT3 &dst, const FLOAT4 &src)
static void convert (FLOAT4 &dst, const FLOAT3 &src)
static void convert (F16 &dst, const UI8 &src)
static void convert (UI8 &dst, const F16 &src)
static void convert (FLOAT3 &dst, const B10F_G11G_R11F &src)
static void convert (B10F_G11G_R11F &dst, const FLOAT3 &src)
static void convert (UI32 &dst, const Depth24Stencil8 &src)
static void convert (Depth24Stencil8 &dst, const UI32 &src)
static void convert (UI32 &dst, const Depth32fStencil8 &src)
static void convert (Depth32fStencil8 &dst, const UI32 &src)
template<typename DestinationType, typename SourceType>
void convert (MutableSpan< DestinationType > dst, Span< SourceType > src)
template<typename DestinationType, typename SourceType>
void convert_per_component (void *dst_memory, const void *src_memory, size_t buffer_size, eGPUTextureFormat device_format)
template<typename DestinationType, typename SourceType>
void convert_per_pixel (void *dst_memory, const void *src_memory, size_t buffer_size)
static void convert_buffer (void *dst_memory, const void *src_memory, size_t buffer_size, eGPUTextureFormat device_format, ConversionType type)

Floating point conversions

using FormatF32 = FloatingPointFormat<true, 23, 8>
using FormatF11 = FloatingPointFormat<false, 6, 5>
using FormatF10 = FloatingPointFormat<false, 5, 5>
template<typename DestinationFormat, typename SourceFormat, bool ClampNegativeToZero = true>
uint32_t convert_float_formats (uint32_t value)

Detailed Description

– Metal Shader Generator for GLSL -> MSL conversion –

The Metal shader generator class is used as a conversion utility for generating a compatible MSL shader from a source GLSL shader. There are several steps involved in creating a shader, and structural changes which enable the source to function in the same way.

1) Extraction and conversion of shaders input's and output's to their Metal-compatible version. This is a subtle data transformation from GPUShaderCreateInfo, allowing for Metal-specific parameters.

2) Determine usage of shader features such as GL global variable usage, depth write output, clip distances, multilayered rendering, barycentric coordinates etc;

3) Generate MSL shader.

4) Populate MTLShaderInterface, describing input/output structure, bind-points, buffer size and alignment, shader feature usage etc; Everything required by the Metal back-end to successfully enable use of shaders and GPU back-end features.

For each shading stage, we generate an MSL shader following these steps:

1) Output custom shader defines describing modes e.g. whether we are using sampler bindings or argument buffers; at the top of the shader.

2) Inject common Metal headers.

  • mtl_shader_defines.msl is used to map GLSL functions to MSL.
  • mtl_shader_common.msl is added to ALL MSL shaders to provide common functionality required by the back-end. This primarily contains function-constant hooks, used in PSO generation.

3) Create a class Scope which wraps the GLSL shader. This is used to create a global per-thread scope around the shader source, to allow access to common shader members (GLSL globals, shader inputs/outputs etc)

4) Generate shader interface structs and populate local members where required for:

  • VertexInputs
  • VertexOutputs
  • Uniforms
  • Uniform Blocks
  • textures ; etc;

5) Inject GLSL source.

6) Generate MSL shader entry point function. Every Metal shader must have a vertex/fragment/kernel entry-point, which contains the function binding table. This is where bindings are specified and passed into the shader.

For converted shaders, the MSL entry-point will also instantiate a shader class per thread, and pass over bound resource references into the class.

Finally, the shaders "main()" method will be called, and outputs are copied.

NOTE: For position outputs, the default output position will be converted to the Metal coordinate space, which involves flipping the Y coordinate and re-mapping the depth range between 0 and 1, as with Vulkan.

The final shader structure looks as follows:

-- Shader defines --
#define USE_ARGUMENT_BUFFER_FOR_SAMPLERS 0
... etc ...;
class MetalShaderVertexImp {
-- Common shader interface structs --
struct VertexIn {
vec4 pos [[attribute(0)]]
}
struct VertexOut {...}
struct PushConstantBlock {...}
struct drw_Globals {...}
...
-- GLSL source code --
...
};
vertex MetalShaderVertexImp::VertexOut vertex_function_entry(
MetalShaderVertexImp::VertexIn v_in [[stage_in]],
constant PushConstantBlock& globals [[buffer(MTL_uniform_buffer_base_index)]]) {
MetalShaderVertexImp impl;
-- Copy input members into impl instance --
-- Execute GLSL main function --
impl.main();
-- Copy outputs and return --
MetalShaderVertexImp::VertexOut out;
out.pos = impl.pos;
-- transform position to Metal coordinate system --
return v_out;
}
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
vec4(float_to_float2(value.x), vec2(0.0f))") DEFINE_VALUE("CONVERT_EXPRESSION(value)"
#define input
#define out
#define main()

– Metal buffer bindings structure –

Metal shader contains several different binding types. All buffers are bound using the buffer(N) binding attribute tag. However, different ranges serve different purposes. The structure of the bindings always happen as follows:

Vertex Buffers (N) <– 0 Index buffer Default Push constant block for uniforms <– MTL_uniform_buffer_base_index Uniform buffers <– MTL_uniform_buffer_base_index+1 Storage buffers <– MTL_storage_buffer_base_index Samplers/argument buffer table <– last buffer + 1

Up to a maximum of 31 bindings.

This file contains API that the GHOST_ContextVK can invoke directly.

Typedef Documentation

◆ AttributeMask

using blender::gpu::AttributeMask = uint16_t

Definition at line 25 of file vk_vertex_attribute_object.hh.

◆ DebugStack

Definition at line 18 of file gpu_debug_private.hh.

◆ F16

using blender::gpu::F16 = ComponentValue<uint16_t>

Definition at line 724 of file vk_data_conversion.cc.

◆ F32

Definition at line 725 of file vk_data_conversion.cc.

◆ FLOAT3

Definition at line 727 of file vk_data_conversion.cc.

◆ FLOAT4

◆ FormatF10

Definition at line 140 of file vk_data_conversion.hh.

◆ FormatF11

Definition at line 139 of file vk_data_conversion.hh.

◆ FormatF32

Definition at line 138 of file vk_data_conversion.hh.

◆ GPUFunctionDictionnary

◆ GPUPrintFormatMap

◆ GPUSourceDictionnary

Definition at line 50 of file gpu_shader_dependency.cc.

◆ I16

Definition at line 722 of file vk_data_conversion.cc.

◆ I32

Definition at line 723 of file vk_data_conversion.cc.

◆ I8

Definition at line 721 of file vk_data_conversion.cc.

◆ IndexBufPtr

Definition at line 288 of file GPU_index_buffer.hh.

◆ MSLFragmentTileInputAttribute

◆ MTLTemporaryBuffer

◆ SRGBA8

◆ TimelineValue

Definition at line 36 of file vk_common.hh.

◆ UI16

Definition at line 719 of file vk_data_conversion.cc.

◆ UI32

Definition at line 720 of file vk_data_conversion.cc.

◆ UI8

Definition at line 718 of file vk_data_conversion.cc.

◆ VertBufPtr

Definition at line 306 of file GPU_vertex_buffer.hh.

Enumeration Type Documentation

◆ AppleGPUType

Enumerator
APPLE_GPU_UNKNOWN 
APPLE_GPU_M1 
APPLE_GPU_M2 
APPLE_GPU_M3 

Definition at line 31 of file mtl_capabilities.hh.

◆ ConversionType

Enumerator
PASS_THROUGH 

No conversion needed, result can be directly read back to host memory.

PASS_THROUGH_D32F_S8 

Pass through (ignores the stencil component).

FLOAT_TO_UNORM8 
UNORM8_TO_FLOAT 
FLOAT_TO_SNORM8 
SNORM8_TO_FLOAT 
FLOAT_TO_UNORM16 
UNORM16_TO_FLOAT 
FLOAT_TO_SNORM16 
SNORM16_TO_FLOAT 
FLOAT_TO_UNORM32 
UNORM32_TO_FLOAT 
UI32_TO_UI16 
UI16_TO_UI32 
UI32_TO_UI8 
UI8_TO_UI32 
I32_TO_I16 
I16_TO_I32 
I32_TO_I8 
I8_TO_I32 
HALF_TO_UI8 

Convert device 16F to UINT

UI8_TO_HALF 
HALF_TO_FLOAT 

Convert device 16F to floats.

FLOAT_TO_HALF 
FLOAT_TO_SRGBA8 
SRGBA8_TO_FLOAT 
FLOAT_TO_DEPTH_COMPONENT24 
DEPTH_COMPONENT24_TO_FLOAT 
FLOAT_TO_B10F_G11F_R11F 
B10F_G11F_R11F_TO_FLOAT 
FLOAT3_TO_HALF4 
HALF4_TO_FLOAT3 
FLOAT3_TO_FLOAT4 
FLOAT4_TO_FLOAT3 
UINT_TO_DEPTH_COMPONENT24 
DEPTH_COMPONENT24_TO_UINT 
UINT_TO_DEPTH24_STENCIL8 
DEPTH24_STENCIL8_TO_UINT 
UINT_TO_DEPTH32F_STENCIL8 
DEPTH32F_STENCIL8_TO_UINT 
UNSUPPORTED 

The requested conversion isn't supported.

Definition at line 20 of file vk_data_conversion.cc.

◆ DataFormat

enum class blender::gpu::DataFormat : uint8_t
strong

Collection of all data formats. Vertex formats and Texture formats are both subset of this.

Enumerator
Invalid 

Definition at line 135 of file GPU_format.hh.

◆ eGPUSamplerFormat

Enumerator
GPU_SAMPLER_TYPE_FLOAT 
GPU_SAMPLER_TYPE_INT 
GPU_SAMPLER_TYPE_UINT 
GPU_SAMPLER_TYPE_DEPTH 
GPU_SAMPLER_TYPE_MAX 

Definition at line 59 of file gpu_texture_private.hh.

◆ eGPUTextureFormatFlag

Enumerator
GPU_FORMAT_DEPTH 
GPU_FORMAT_STENCIL 
GPU_FORMAT_INTEGER 
GPU_FORMAT_NORMALIZED_INTEGER 
GPU_FORMAT_FLOAT 
GPU_FORMAT_COMPRESSED 
GPU_FORMAT_SRGB 
GPU_FORMAT_SIGNED 
GPU_FORMAT_DEPTH_STENCIL 

Definition at line 19 of file gpu_texture_private.hh.

◆ eGPUTextureType

Enumerator
GPU_TEXTURE_1D 
GPU_TEXTURE_2D 
GPU_TEXTURE_3D 
GPU_TEXTURE_CUBE 
GPU_TEXTURE_ARRAY 
GPU_TEXTURE_BUFFER 
GPU_TEXTURE_1D_ARRAY 
GPU_TEXTURE_2D_ARRAY 
GPU_TEXTURE_CUBE_ARRAY 

Definition at line 42 of file gpu_texture_private.hh.

◆ eImageViewUsage

Based on the usage of an Image View a different image view type should be created.

When using a GPU_TEXTURE_CUBE as an frame buffer attachment it will be used as a GPU_TEXTURE_2D_ARRAY. eg only a single side of the cube map will be attached. But when bound as a shader resource the cube-map will be used.

Enumerator
ShaderBinding 

Image View will be used as a bindable shader resource.

Attachment 

Image View will be used as an frame-buffer attachment.

Definition at line 45 of file vk_common.hh.

◆ GPUIndexBufType

Enumerator
GPU_INDEX_U16 
GPU_INDEX_U32 

Definition at line 24 of file GPU_index_buffer.hh.

◆ GPUQueryType

Enumerator
GPU_QUERY_OCCLUSION 

Definition at line 17 of file gpu_query.hh.

◆ MSLTextureSamplerAccess

Enumerator
TEXTURE_ACCESS_NONE 
TEXTURE_ACCESS_SAMPLE 
TEXTURE_ACCESS_READ 
TEXTURE_ACCESS_WRITE 
TEXTURE_ACCESS_READWRITE 

Definition at line 179 of file mtl_shader_generator.hh.

◆ MTLPipelineStateDirtyFlag

Enumerator
MTL_PIPELINE_STATE_NULL_FLAG 
MTL_PIPELINE_STATE_VIEWPORT_FLAG 
MTL_PIPELINE_STATE_SCISSOR_FLAG 
MTL_PIPELINE_STATE_DEPTHSTENCIL_FLAG 
MTL_PIPELINE_STATE_PSO_FLAG 
MTL_PIPELINE_STATE_FRONT_FACING_FLAG 
MTL_PIPELINE_STATE_CULLMODE_FLAG 
MTL_PIPELINE_STATE_ALL_FLAG 

Definition at line 420 of file mtl_context.hh.

◆ RenderGraphFlushFlags

Enumerator
NONE 
RENEW_RENDER_GRAPH 
SUBMIT 
WAIT_FOR_COMPLETION 

Definition at line 32 of file vk_context.hh.

◆ Severity

Enumerator
Unknown 
Warning 
Error 
Note 

Definition at line 309 of file gpu_shader_private.hh.

◆ ShaderStage

enum class blender::gpu::ShaderStage : uint8_t
strong
Enumerator
VERTEX 
FRAGMENT 
COMPUTE 
ANY 

Definition at line 70 of file mtl_shader_interface.hh.

◆ TextureFormat

enum class blender::gpu::TextureFormat : uint8_t
strong

Formats compatible with read-only texture.

Enumerator
Invalid 

Definition at line 35 of file GPU_texture.hh.

◆ TextureTargetFormat

Formats compatible with frame-buffer attachments.

Enumerator
Invalid 

Definition at line 136 of file GPU_texture.hh.

◆ TextureWriteFormat

enum class blender::gpu::TextureWriteFormat : uint8_t
strong

Formats compatible with shader load/store.

Enumerator
Invalid 

Definition at line 209 of file GPU_texture.hh.

◆ VertAttrType

enum class blender::gpu::VertAttrType : uint8_t
strong
Enumerator
Invalid 

Definition at line 22 of file GPU_vertex_format.hh.

◆ VKBindType

Bind types to bind resources to a shader.

Keep in sync with #gpu::shader::ShaderCreateInfo::Resource::BindType. We add the term INPUT_ATTACHMENT as it is stored as a sub-pass input in the shader create info.

TODO: Investigate if TEXEL_BUFFER can be added as well.

Enumerator
UNIFORM_BUFFER 
STORAGE_BUFFER 
SAMPLER 
IMAGE 
INPUT_ATTACHMENT 

Definition at line 32 of file vk_shader_interface.hh.

◆ VKImageViewArrayed

Enumerator
DONT_CARE 
NOT_ARRAYED 
ARRAYED 

Definition at line 52 of file vk_common.hh.

◆ VKImageViewFlags

Additional modifiers when requesting image views.

Enumerator
DEFAULT 
NO_SWIZZLING 

Definition at line 25 of file vk_texture.hh.

Function Documentation

◆ align()

template<typename LayoutT>
void blender::gpu::align ( const shader::Type & type,
const int32_t array_size,
uint32_t * r_offset )
static

Move the r_offset to the next alignment where the given type+array_size can be reserved.

'type': The type that needs to be aligned. 'array_size': The array_size that needs to be aligned. (0=no array). 'r_offset': After the call it will point to the byte where the reservation can happen.

Definition at line 77 of file vk_memory_layout.hh.

Referenced by align_end_of_struct(), init_constant(), and struct_size().

◆ align_end_of_struct()

template<typename LayoutT>
void blender::gpu::align_end_of_struct ( uint32_t * r_offset)
static

Update 'r_offset' to be aligned to the end of the struct.

Call this function when all attributes have been added to make sure that the struct size is correct.

Definition at line 115 of file vk_memory_layout.hh.

References align(), and blender::gpu::shader::float4_t.

◆ align_size()

void blender::gpu::align_size ( VkDeviceSize & r_size,
VkDeviceSize alignment )
static

Definition at line 104 of file vk_descriptor_set_layouts.cc.

References align_size().

Referenced by align_size().

◆ array_stride()

template<typename LayoutT>
uint32_t blender::gpu::array_stride ( const shader::Type type)
static

Definition at line 62 of file vk_memory_layout.hh.

References array_stride().

Referenced by array_stride(), and reserve().

◆ BLI_STATIC_ASSERT() [1/2]

blender::gpu::BLI_STATIC_ASSERT ( sizeof(GPUState) = =sizeof(uint64_t),
"GPUState is too big."  )

◆ BLI_STATIC_ASSERT() [2/2]

blender::gpu::BLI_STATIC_ASSERT ( sizeof(GPUStateMutable) = =sizeof(GPUStateMutable::data),
"GPUStateMutable is too big."  )

◆ blit_aspect()

◆ block_binding()

int blender::gpu::block_binding ( int32_t program,
uint32_t block_index )
inlinestatic

◆ cache_dir_get()

std::optional< std::string > blender::gpu::cache_dir_get ( )
static

◆ channel_len_to_gl()

GLenum blender::gpu::channel_len_to_gl ( int channel_len)
inline

Assume UNORM/Float target. Used with #glReadPixels.

Definition at line 488 of file gl_texture.hh.

References BLI_assert_msg, and channel_len_to_gl().

Referenced by channel_len_to_gl(), and blender::gpu::GLFrameBuffer::read().

◆ combine_sources()

std::string blender::gpu::combine_sources ( Span< StringRefNull > sources)
static

Definition at line 486 of file vk_shader.cc.

References combine_sources(), G, G_DEBUG_GPU_RENDERDOC, and result.

Referenced by combine_sources().

◆ compile_ex()

◆ const_strlen()

size_t blender::gpu::const_strlen ( const char * str)
constexpr

Definition at line 1040 of file mtl_shader_generator.mm.

References const_strlen(), and str.

Referenced by const_strlen().

◆ convert() [1/22]

void blender::gpu::convert ( B10F_G11G_R11F & dst,
const FLOAT3 & src )
static

◆ convert() [2/22]

void blender::gpu::convert ( Depth24Stencil8 & dst,
const UI32 & src )
static

◆ convert() [3/22]

void blender::gpu::convert ( Depth32fStencil8 & dst,
const UI32 & src )
static

◆ convert() [4/22]

template<typename DestinationType, typename SourceType>
void blender::gpu::convert ( DestinationType & dst,
const SourceType & src )

Definition at line 894 of file vk_data_conversion.cc.

References convert().

◆ convert() [5/22]

void blender::gpu::convert ( F16 & dst,
const UI8 & src )
static

◆ convert() [6/22]

◆ convert() [7/22]

template<typename StorageType>
void blender::gpu::convert ( F32 & dst,
const UnsignedNormalized< StorageType > & src )

◆ convert() [8/22]

void blender::gpu::convert ( FLOAT3 & dst,
const B10F_G11G_R11F & src )
static

◆ convert() [9/22]

◆ convert() [10/22]

◆ convert() [11/22]

◆ convert() [12/22]

void blender::gpu::convert ( FLOAT4 & dst,
const SRGBA8 & src )
static

◆ convert() [13/22]

◆ convert() [14/22]

template<typename DestinationType, typename SourceType>
void blender::gpu::convert ( MutableSpan< DestinationType > dst,
Span< SourceType > src )

◆ convert() [15/22]

◆ convert() [16/22]

void blender::gpu::convert ( SRGBA8 & dst,
const FLOAT4 & src )
static

◆ convert() [17/22]

void blender::gpu::convert ( UI32 & dst,
const Depth24Stencil8 & src )
static

◆ convert() [18/22]

void blender::gpu::convert ( UI32 & dst,
const Depth32fStencil8 & src )
static

◆ convert() [19/22]

template<typename StorageType>
void blender::gpu::convert ( UI32 & dst,
const UnsignedNormalized< StorageType > & src )

◆ convert() [20/22]

void blender::gpu::convert ( UI8 & dst,
const F16 & src )
static

◆ convert() [21/22]

template<typename StorageType>
void blender::gpu::convert ( UnsignedNormalized< StorageType > & ,
const UI32 &  )

Definition at line 881 of file vk_data_conversion.cc.

References BLI_assert_unreachable, and convert().

◆ convert() [22/22]

template<typename StorageType>
void blender::gpu::convert ( UnsignedNormalized< StorageType > & dst,
const F32 & src )

◆ convert_buffer()

◆ convert_device_to_host()

void blender::gpu::convert_device_to_host ( void * dst_buffer,
const void * src_buffer,
size_t buffer_size,
eGPUDataFormat host_format,
eGPUTextureFormat host_texture_format,
eGPUTextureFormat device_format )

Convert device buffer to host buffer.

Parameters
dst_bufferhost buffer
src_bufferdevice buffer.
buffer_sizenumber of pixels to convert from the start of the given buffer.
host_formatformat of the host buffer
host_texture_formattexture format of the host buffer.
device_formatformat of the device buffer.
Note
Will assert when the host_format/device_format combination isn't valid (validate_data_format) or supported. Some combinations aren't supported in Vulkan due to platform incompatibility.

Definition at line 1237 of file vk_data_conversion.cc.

References BLI_assert_msg, convert_buffer(), convert_device_to_host(), host_to_device(), reversed(), and UNSUPPORTED.

Referenced by convert_device_to_host(), blender::gpu::VKTexture::read_sub(), blender::gpu::tests::TEST(), and blender::gpu::tests::TEST().

◆ convert_float_formats()

template<typename DestinationFormat, typename SourceFormat, bool ClampNegativeToZero = true>
uint32_t blender::gpu::convert_float_formats ( uint32_t value)

Convert between low precision floating (including 32 bit floats).

The input and output values are bits (uint32_t) as this function does a bit-wise operations to convert between the formats. Additional conversion rules can be applied to the conversion function. Due to the implementation the compiler would make an optimized version depending on the actual possibilities.

Template Parameters
DestinationFormatFloatingPointFormat of the value that is converted to.
SourceFormatFloatingPointFormat of the value that is converted from.
ClampNegativeToZeroShould negative values be clamped to zero when DestinationFormat doesn't contain a sign bit. Also -Inf will be clamped to zero.

When set to false and DestinationFormat doesn't contain a sign bit the value will be made absolute.

Definition at line 169 of file vk_data_conversion.hh.

References convert_float_formats(), is_zero(), and result.

Referenced by convert(), convert(), convert_float_formats(), blender::gpu::tests::TEST(), and blender::gpu::tests::TEST().

◆ convert_host_to_device()

void blender::gpu::convert_host_to_device ( void * dst_buffer,
const void * src_buffer,
size_t buffer_size,
eGPUDataFormat host_format,
eGPUTextureFormat host_texture_format,
eGPUTextureFormat device_format )

Convert host buffer to device buffer.

Parameters
dst_bufferdevice buffer.
src_bufferhost buffer.
buffer_sizenumber of pixels to convert from the start of the given buffer.
host_formatformat of the host buffer.
host_texture_formattexture format of the host buffer.
device_formatformat of the device buffer.
Note
Will assert when the host_format/device_format combination isn't valid (validate_data_format) or supported. Some combinations aren't supported in Vulkan due to platform incompatibility.

Definition at line 1225 of file vk_data_conversion.cc.

References BLI_assert, convert_buffer(), convert_host_to_device(), host_to_device(), and UNSUPPORTED.

Referenced by blender::gpu::VKTexture::clear(), convert_host_to_device(), blender::gpu::tests::TEST(), blender::gpu::tests::TEST(), and blender::gpu::VKTexture::update_sub().

◆ convert_normal() [1/3]

template<>
short4 blender::gpu::convert_normal ( const float3 & src)
inline

Definition at line 54 of file GPU_attribute_convert.hh.

References convert_normal().

◆ convert_normal() [2/3]

template<>
PackedNormal blender::gpu::convert_normal ( const float3 & src)
inline

Definition at line 44 of file GPU_attribute_convert.hh.

References convert_normal(), and convert_normalized_f32_to_i10().

◆ convert_normal() [3/3]

◆ convert_normalized_f32_to_i10()

int blender::gpu::convert_normalized_f32_to_i10 ( float x)
inline

Definition at line 31 of file GPU_attribute_convert.hh.

References convert_normalized_f32_to_i10(), and x.

Referenced by convert_normal(), and convert_normalized_f32_to_i10().

◆ convert_normals() [1/3]

template<>
void blender::gpu::convert_normals ( const Span< float3 > src,
MutableSpan< PackedNormal > dst )

Definition at line 23 of file gpu_vertex_format_normals.cc.

References convert_normals(), and convert_normals_impl().

◆ convert_normals() [2/3]

template<>
void blender::gpu::convert_normals ( const Span< float3 > src,
MutableSpan< short4 > dst )

Definition at line 27 of file gpu_vertex_format_normals.cc.

References convert_normals(), and convert_normals_impl().

◆ convert_normals() [3/3]

◆ convert_normals_impl()

template<typename GPUType>
void blender::gpu::convert_normals_impl ( const Span< float3 > src,
MutableSpan< GPUType > dst )
static

◆ convert_per_component()

template<typename DestinationType, typename SourceType>
void blender::gpu::convert_per_component ( void * dst_memory,
const void * src_memory,
size_t buffer_size,
eGPUTextureFormat device_format )

◆ convert_per_pixel()

template<typename DestinationType, typename SourceType>
void blender::gpu::convert_per_pixel ( void * dst_memory,
const void * src_memory,
size_t buffer_size )

◆ copy_color()

template<typename T>
void blender::gpu::copy_color ( T dst[4],
const T * src )

Definition at line 716 of file vk_common.cc.

References copy_color(), and T.

Referenced by copy_color(), and to_vk_clear_color_value().

◆ create_gpu_name()

char * blender::gpu::create_gpu_name ( const char * vendor,
const char * renderer,
const char * version )
static

◆ create_key()

char * blender::gpu::create_key ( eGPUSupportLevel support_level,
const char * vendor,
const char * renderer,
const char * version )
static

◆ declare_emit_vertex()

void blender::gpu::declare_emit_vertex ( std::stringstream & ss)
static

◆ def_attr()

template<typename Layout>
void blender::gpu::def_attr ( const shader::Type type,
const int array_size,
const uint32_t expected_alignment,
const uint32_t expected_reserve,
uint32_t * r_offset )
static

Definition at line 12 of file vk_memory_layout_test.cc.

References def_attr(), and EXPECT_EQ().

Referenced by def_attr(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ default_load_store()

GPULoadStore blender::gpu::default_load_store ( )
constexpr

◆ detect_mip_render_workaround()

bool blender::gpu::detect_mip_render_workaround ( )
static

◆ detect_workarounds()

void blender::gpu::detect_workarounds ( )
static

Definition at line 397 of file gl_backend.cc.

References BLI_windows_get_directx_driver_version(), blender::gpu::GPUCapabilities::broken_amd_driver, blender::gpu::GLContext::clip_control_support, blender::gpu::GPUCapabilities::clip_control_support, blender::gpu::GLContext::debug_layer_support, blender::gpu::GLContext::debug_layer_workaround, blender::gpu::GPUCapabilities::depth_blitting_workaround, detect_mip_render_workaround(), detect_workarounds(), blender::gpu::GLContext::direct_state_access_support, blender::gpu::GLContext::framebuffer_fetch_support, G, G_DEBUG_GPU_FORCE_WORKAROUNDS, GCaps, GPU_DEVICE_ATI, GPU_DEVICE_INTEL, GPU_DEVICE_QUALCOMM, GPU_DRIVER_ANY, GPU_DRIVER_OFFICIAL, GPU_DRIVER_OPENSOURCE, GPU_OS_ANY, GPU_OS_UNIX, GPU_OS_WIN, GPU_type_matches(), blender::gpu::GPUCapabilities::hdr_viewport_support, is_bad_AMD_driver(), L, blender::gpu::GLContext::layered_rendering_support, blender::gpu::GPUCapabilities::line_directive_workaround, match_renderer(), blender::gpu::GPUCapabilities::minimum_per_vertex_stride, blender::gpu::GPUCapabilities::mip_render_workaround, blender::gpu::GLContext::multi_bind_image_support, blender::gpu::GLContext::multi_bind_support, blender::gpu::GLContext::multi_draw_indirect_support, blender::gpu::GLContext::native_barycentric_support, blender::gpu::GPUCapabilities::node_link_instancing_workaround, printf, blender::gpu::GLContext::shader_draw_parameters_support, blender::gpu::GPUCapabilities::shader_draw_parameters_support, blender::gpu::GPUCapabilities::stencil_clasify_buffer_workaround, blender::gpu::GPUCapabilities::stencil_export_support, blender::gpu::GLContext::texture_barrier_support, blender::gpu::GLContext::texture_filter_anisotropic_support, blender::gpu::GLContext::unused_fb_slot_workaround, blender::gpu::GPUCapabilities::use_hq_normals_workaround, and blender::gpu::GPUCapabilities::use_main_context_workaround.

Referenced by detect_workarounds().

◆ determine_os_type()

eGPUOSType blender::gpu::determine_os_type ( )
static

◆ element_stride()

template<typename LayoutT>
uint32_t blender::gpu::element_stride ( const shader::Type type)
static

Definition at line 57 of file vk_memory_layout.hh.

References element_stride().

Referenced by element_stride(), and reserve().

◆ ENUM_OPERATORS() [1/3]

◆ ENUM_OPERATORS() [2/3]

◆ ENUM_OPERATORS() [3/3]

blender::gpu::ENUM_OPERATORS ( ShaderStage ,
ShaderStage::ANY  )

References ANY, and ENUM_OPERATORS().

◆ extract_and_replace_clipping_distances()

◆ find_interface_by_name()

StageInterfaceInfo * blender::gpu::find_interface_by_name ( const Span< StageInterfaceInfo * > ifaces,
const StringRefNull name )
static

◆ float_to_uint32_t()

uint32_t blender::gpu::float_to_uint32_t ( float value)
static

Definition at line 691 of file vk_data_conversion.cc.

References float_to_uint32_t().

Referenced by convert(), and float_to_uint32_t().

◆ format_component_len() [1/2]

int blender::gpu::format_component_len ( const DataFormat format)
inline

◆ format_component_len() [2/2]

int blender::gpu::format_component_len ( const VertAttrType format)
inline

Definition at line 28 of file gpu_vertex_format_private.hh.

References format_component_len().

◆ format_get_component_type()

MTLVertexFormat blender::gpu::format_get_component_type ( MTLVertexFormat mtl_format)
inline

◆ format_resize_comp()

MTLVertexFormat blender::gpu::format_resize_comp ( MTLVertexFormat mtl_format,
uint32_t components )
inline

◆ generate_compilation_constant_declarations()

◆ generate_specialization_constant_declarations()

◆ get_attribute_conversion_function()

◆ get_location_count()

int blender::gpu::get_location_count ( const Type & type)
inline

◆ get_matrix_location_count() [1/2]

int blender::gpu::get_matrix_location_count ( const shader::Type & type)
inline

◆ get_matrix_location_count() [2/2]

◆ get_matrix_subtype() [1/2]

◆ get_matrix_subtype() [2/2]

◆ get_mtl_format_bytesize()

size_t blender::gpu::get_mtl_format_bytesize ( MTLPixelFormat tex_format)

◆ get_mtl_format_num_components()

int blender::gpu::get_mtl_format_num_components ( MTLPixelFormat tex_format)

◆ get_num_efficiency_cpu_cores()

int blender::gpu::get_num_efficiency_cpu_cores ( id< MTLDevice > device)
static

◆ get_num_performance_cpu_cores()

int blender::gpu::get_num_performance_cpu_cores ( id< MTLDevice > device)
static

◆ get_shader_stage_index()

◆ get_shader_stage_instance_name()

◆ get_stage_class_name()

◆ gl_extension_get()

const char * blender::gpu::gl_extension_get ( int i)
static

Definition at line 392 of file gl_backend.cc.

References gl_extension_get(), and i.

Referenced by gl_extension_get().

◆ gpu_depth_function_to_metal()

MTLCompareFunction blender::gpu::gpu_depth_function_to_metal ( eGPUDepthTest depth_func)
static

◆ gpu_prim_type_to_metal()

◆ gpu_stencil_func_to_metal()

MTLCompareFunction blender::gpu::gpu_stencil_func_to_metal ( eGPUStencilTest stencil_func)
static

◆ gpu_texture_format_to_metal()

◆ gpu_type_from_gl_type()

◆ gpu_usage_from_mtl()

◆ GPU_vulkan_is_supported_driver()

bool blender::gpu::GPU_vulkan_is_supported_driver ( VkPhysicalDevice vk_physical_device)

Is the driver of the given physical device supported?

There are some drivers that have known issues and should not be used. This check needs to be identical between GPU module and GHOST, otherwise GHOST can still select a device which isn't supported.

For example on a Linux machine where llvmpipe is installed and an not supported NVIDIA driver Blender would detect a supported configuration using llvmpipe, but GHOST could still select the unsupported NVIDIA driver.

Returns true when supported, false when not supported.

Definition at line 48 of file vk_backend.cc.

References CLOG_WARN, blender::StringRefBase::find(), GPU_vulkan_is_supported_driver(), LOG, and blender::StringRefBase::not_found.

Referenced by ensure_vulkan_device(), GPU_vulkan_is_supported_driver(), init_device_list(), and blender::gpu::VKBackend::is_supported().

◆ host_to_device()

◆ image_binding()

int blender::gpu::image_binding ( int32_t program,
uint32_t uniform_index,
int32_t uniform_location,
int * image_len )
inlinestatic

◆ indices_per_primitive()

int blender::gpu::indices_per_primitive ( GPUPrimType prim_type)
inline

IMPORTANT: These last two expects no restart primitive. Asserting for this would be too slow. Just don't be stupid. This is needed for polylines but should be deprecated. See GPU_batch_draw_expanded_parameter_get

Definition at line 123 of file GPU_index_buffer.hh.

References GPU_PRIM_LINE_LOOP, GPU_PRIM_LINE_STRIP, GPU_PRIM_LINES, GPU_PRIM_LINES_ADJ, GPU_PRIM_POINTS, GPU_PRIM_TRIS, GPU_PRIM_TRIS_ADJ, and indices_per_primitive().

Referenced by GPU_batch_draw_expanded_parameter_get(), GPU_indexbuf_build_from_memory(), GPU_indexbuf_primitive_len(), and indices_per_primitive().

◆ init_constant()

◆ init_device_list()

◆ init_struct()

◆ is_apple_sillicon()

bool blender::gpu::is_apple_sillicon ( id< MTLDevice > device)

◆ is_bad_AMD_driver()

bool blender::gpu::is_bad_AMD_driver ( const char * version_cstr)
static

Definition at line 91 of file gl_backend.cc.

References is_bad_AMD_driver(), and parse_version().

Referenced by detect_workarounds(), and is_bad_AMD_driver().

◆ is_builtin_type()

◆ is_fetch_float()

bool blender::gpu::is_fetch_float ( VertAttrType attr_type)

◆ is_fetch_int_to_float()

bool blender::gpu::is_fetch_int_to_float ( VertAttrType attr_type)

◆ is_fetch_normalized()

bool blender::gpu::is_fetch_normalized ( VertAttrType attr_type)

Definition at line 238 of file gpu_vertex_format.cc.

References is_fetch_normalized().

Referenced by is_fetch_normalized().

◆ is_matrix_type() [1/2]

bool blender::gpu::is_matrix_type ( const shader::Type & type)
inline

◆ is_matrix_type() [2/2]

◆ main_function_wrapper()

std::string blender::gpu::main_function_wrapper ( std::string & pre_main,
std::string & post_main )
static

◆ match_renderer()

bool blender::gpu::match_renderer ( StringRef renderer,
const Vector< std::string > & items )
static

◆ memory_priority()

float blender::gpu::memory_priority ( const eGPUTextureUsage texture_usage)
static

◆ missing_capabilities_get()

◆ mtl_convert_vertex_format()

bool blender::gpu::mtl_convert_vertex_format ( MTLVertexFormat shader_attr_format,
GPUVertCompType component_type,
uint32_t component_len,
GPUVertFetchMode fetch_mode,
MTLVertexFormat * r_convertedFormat )
inline

◆ mtl_convert_vertex_format_ex()

MTLVertexFormat blender::gpu::mtl_convert_vertex_format_ex ( MTLVertexFormat shader_attr_format,
GPUVertCompType component_type,
uint32_t component_len,
GPUVertFetchMode fetch_mode )
inline

Returns whether the METAL API can internally convert between the input type of data in the incoming vertex buffer and the format used by the vertex attribute inside the shader.

  • Returns TRUE if the type can be converted internally, along with returning the appropriate type to be passed into the MTLVertexAttributeDescriptorPSO.
  • Returns FALSE if the type cannot be converted internally e.g. casting Int4 to Float4.

If implicit conversion is not possible, then we can fallback to performing manual attribute conversion using the special attribute read function specializations in the shader. These functions selectively convert between types based on the specified vertex attribute GPUVertFetchMode fetch_mode e.g. GPU_FETCH_INT.

Definition at line 558 of file mtl_shader.hh.

References BLI_assert_msg, ELEM, format_get_component_type(), mtl_convert_vertex_format_ex(), mtl_format_is_normalized(), and to_mtl().

Referenced by mtl_convert_vertex_format(), and mtl_convert_vertex_format_ex().

◆ mtl_datatype_to_vertex_type()

MTLVertexFormat blender::gpu::mtl_datatype_to_vertex_type ( eMTLDataType type)

Definition at line 629 of file mtl_shader_interface.mm.

References BLI_assert, BLI_assert_msg, MTL_DATATYPE_BOOL, MTL_DATATYPE_BOOL2, MTL_DATATYPE_BOOL3, MTL_DATATYPE_BOOL4, MTL_DATATYPE_CHAR, MTL_DATATYPE_CHAR2, MTL_DATATYPE_CHAR3, MTL_DATATYPE_CHAR4, MTL_DATATYPE_FLOAT, MTL_DATATYPE_FLOAT2, MTL_DATATYPE_FLOAT2x2, MTL_DATATYPE_FLOAT2x3, MTL_DATATYPE_FLOAT2x4, MTL_DATATYPE_FLOAT3, MTL_DATATYPE_FLOAT3x2, MTL_DATATYPE_FLOAT3x3, MTL_DATATYPE_FLOAT3x4, MTL_DATATYPE_FLOAT4, MTL_DATATYPE_FLOAT4x2, MTL_DATATYPE_FLOAT4x3, MTL_DATATYPE_FLOAT4x4, MTL_DATATYPE_HALF2x2, MTL_DATATYPE_HALF2x3, MTL_DATATYPE_HALF2x4, MTL_DATATYPE_HALF3x2, MTL_DATATYPE_HALF3x3, MTL_DATATYPE_HALF3x4, MTL_DATATYPE_HALF4x2, MTL_DATATYPE_HALF4x3, MTL_DATATYPE_HALF4x4, MTL_DATATYPE_INT, MTL_DATATYPE_INT1010102_NORM, MTL_DATATYPE_INT2, MTL_DATATYPE_INT3, MTL_DATATYPE_INT4, MTL_DATATYPE_LONG, MTL_DATATYPE_LONG2, MTL_DATATYPE_LONG3, MTL_DATATYPE_LONG4, MTL_DATATYPE_SHORT, MTL_DATATYPE_SHORT2, MTL_DATATYPE_SHORT3, MTL_DATATYPE_SHORT4, mtl_datatype_to_vertex_type(), MTL_DATATYPE_UCHAR, MTL_DATATYPE_UCHAR2, MTL_DATATYPE_UCHAR3, MTL_DATATYPE_UCHAR4, MTL_DATATYPE_UINT, MTL_DATATYPE_UINT1010102_NORM, MTL_DATATYPE_UINT2, MTL_DATATYPE_UINT3, MTL_DATATYPE_UINT4, MTL_DATATYPE_ULONG, MTL_DATATYPE_ULONG2, MTL_DATATYPE_ULONG3, MTL_DATATYPE_ULONG4, MTL_DATATYPE_USHORT, MTL_DATATYPE_USHORT2, MTL_DATATYPE_USHORT3, and MTL_DATATYPE_USHORT4.

Referenced by blender::gpu::MSLGeneratorInterface::bake_shader_interface(), and mtl_datatype_to_vertex_type().

◆ mtl_extensions_get_null()

const char * blender::gpu::mtl_extensions_get_null ( int )
static

Definition at line 286 of file mtl_backend.mm.

References mtl_extensions_get_null().

Referenced by mtl_extensions_get_null().

◆ mtl_format_component_len()

int blender::gpu::mtl_format_component_len ( MTLVertexFormat format)
inline

Definition at line 482 of file mtl_shader.hh.

References FORMAT_PER_TYPE, and mtl_format_component_len().

Referenced by mtl_format_component_len().

◆ mtl_format_get_writeable_view_format()

MTLPixelFormat blender::gpu::mtl_format_get_writeable_view_format ( MTLPixelFormat format)
inline

◆ mtl_format_is_normalized()

bool blender::gpu::mtl_format_is_normalized ( MTLVertexFormat format)
inline

◆ mtl_format_is_writable()

bool blender::gpu::mtl_format_is_writable ( MTLPixelFormat format)
inline

Definition at line 588 of file mtl_texture.hh.

References mtl_format_is_writable().

Referenced by mtl_format_is_writable().

◆ mtl_format_supports_blending()

◆ mtl_load_action_from_gpu()

MTLLoadAction blender::gpu::mtl_load_action_from_gpu ( eGPULoadOp action)

◆ mtl_needs_topology_emulation()

bool blender::gpu::mtl_needs_topology_emulation ( GPUPrimType prim_type)
inlinestatic

◆ mtl_prim_type_to_topology_class()

MTLPrimitiveTopologyClass blender::gpu::mtl_prim_type_to_topology_class ( MTLPrimitiveType prim_type)
inlinestatic

Utility functions

Definition at line 22 of file mtl_primitive.hh.

References mtl_prim_type_to_topology_class().

Referenced by mtl_prim_type_to_topology_class().

◆ mtl_stencil_set_op()

void blender::gpu::mtl_stencil_set_op ( MTLContext * context,
MTLStencilOperation stencil_fail,
MTLStencilOperation depth_test_fail,
MTLStencilOperation depthstencil_pass )
static

◆ mtl_stencil_set_op_separate()

◆ mtl_store_action_from_gpu()

MTLStoreAction blender::gpu::mtl_store_action_from_gpu ( eGPUStoreOp action)

◆ mtl_usage_from_gpu()

◆ mtl_vertex_count_fits_primitive_type()

bool blender::gpu::mtl_vertex_count_fits_primitive_type ( uint32_t vertex_count,
MTLPrimitiveType prim_type )
inlinestatic

◆ name_buffer_copystr()

uint32_t blender::gpu::name_buffer_copystr ( char ** name_buffer_ptr,
const char * str_to_copy,
uint32_t & name_buffer_size,
uint32_t & name_buffer_offset )
static

Add string to name buffer. Utility function to be used in bake_shader_interface. Returns the offset of the inserted name.

Definition at line 2713 of file mtl_shader_generator.mm.

References BLI_assert, max_ii(), MEM_reallocN, and name_buffer_copystr().

Referenced by blender::gpu::MSLGeneratorInterface::bake_shader_interface(), and name_buffer_copystr().

◆ new_buffer_size()

VkDeviceSize blender::gpu::new_buffer_size ( VkDeviceSize sub_buffer_size)
static

Definition at line 118 of file vk_immediate.cc.

References DEFAULT_INTERNAL_BUFFER_SIZE, max_ulul(), and new_buffer_size().

Referenced by new_buffer_size().

◆ next_symbol_in_range()

char * blender::gpu::next_symbol_in_range ( char * begin,
const char * end,
char symbol )
inline

Definition at line 760 of file mtl_shader_generator.hh.

References begin(), and next_symbol_in_range().

Referenced by next_symbol_in_range().

◆ next_word_in_range()

char * blender::gpu::next_word_in_range ( char * begin,
const char * end )
inline

Definition at line 770 of file mtl_shader_generator.hh.

References begin(), and next_word_in_range().

Referenced by next_word_in_range().

◆ operator!=() [1/2]

bool blender::gpu::operator!= ( const GPUState & a,
const GPUState & b )
inline

Definition at line 63 of file gpu_state_private.hh.

References b, and operator!=().

Referenced by operator!=(), and operator!=().

◆ operator!=() [2/2]

bool blender::gpu::operator!= ( const GPUStateMutable & a,
const GPUStateMutable & b )
inline

Definition at line 112 of file gpu_state_private.hh.

References b, and operator!=().

◆ operator==() [1/3]

bool blender::gpu::operator== ( const GPUState & a,
const GPUState & b )
inline

Definition at line 58 of file gpu_state_private.hh.

References b, blender::gpu::GPUState::data, and operator==().

Referenced by operator==(), operator==(), and operator==().

◆ operator==() [2/3]

bool blender::gpu::operator== ( const GPUStateMutable & a,
const GPUStateMutable & b )
inline

Definition at line 107 of file gpu_state_private.hh.

References b, blender::gpu::GPUStateMutable::data, and operator==().

◆ operator==() [3/3]

BLI_INLINE bool blender::gpu::operator== ( const VKContext & a,
const VKContext & b )

Definition at line 170 of file vk_context.hh.

References b, BLI_INLINE, and operator==().

◆ operator^() [1/2]

GPUState blender::gpu::operator^ ( const GPUState & a,
const GPUState & b )
inline

Definition at line 68 of file gpu_state_private.hh.

References b, blender::gpu::GPUState::data, and operator^().

Referenced by operator^(), and operator^().

◆ operator^() [2/2]

GPUStateMutable blender::gpu::operator^ ( const GPUStateMutable & a,
const GPUStateMutable & b )
inline

Definition at line 117 of file gpu_state_private.hh.

References ARRAY_SIZE, b, blender::gpu::GPUStateMutable::data, i, and operator^().

◆ operator~() [1/2]

GPUState blender::gpu::operator~ ( const GPUState & a)
inline

Definition at line 75 of file gpu_state_private.hh.

References blender::gpu::GPUState::data, and operator~().

Referenced by operator~(), and operator~().

◆ operator~() [2/2]

GPUStateMutable blender::gpu::operator~ ( const GPUStateMutable & a)
inline

Definition at line 126 of file gpu_state_private.hh.

References ARRAY_SIZE, blender::gpu::GPUStateMutable::data, i, and operator~().

◆ parameter_delimiter()

◆ parse_version()

bool blender::gpu::parse_version ( const std::string & version,
const std::string & format,
Vector< int > & r_version )
static

◆ populate_emulated_tri_fan_buf()

template<typename T>
uint32_t blender::gpu::populate_emulated_tri_fan_buf ( Span< T > original_data,
MutableSpan< T > output_data,
uint32_t input_index_len )
static

◆ populate_optimized_tri_strip_buf()

template<typename T>
uint32_t blender::gpu::populate_optimized_tri_strip_buf ( Span< T > original_data,
MutableSpan< T > output_data,
uint32_t input_index_len )
static

◆ populate_specialization_constant_values()

◆ present()

◆ print_image_type()

void blender::gpu::print_image_type ( std::ostream & os,
const ImageType & type,
const ShaderCreateInfo::Resource::BindType bind_type )
static

◆ print_interface()

◆ print_interface_as_attributes()

void blender::gpu::print_interface_as_attributes ( std::ostream & os,
const std::string & prefix,
const StageInterfaceInfo & iface,
int & location )
static

◆ print_interface_as_struct()

void blender::gpu::print_interface_as_struct ( std::ostream & os,
const std::string & prefix,
const StageInterfaceInfo & iface,
int & location,
const StringRefNull & suffix )
static

◆ print_qualifier()

std::ostream & blender::gpu::print_qualifier ( std::ostream & os,
const Qualifier & qualifiers )
static

◆ print_resource() [1/3]

◆ print_resource() [2/3]

◆ print_resource() [3/3]

void blender::gpu::print_resource ( std::ostream & os,
const VKShaderInterface & shader_interface,
const ShaderCreateInfo::Resource & res )
static

◆ printf_begin()

◆ printf_end()

◆ read_spirv_from_disk()

◆ remove_non_numeric_characters()

std::regex blender::gpu::remove_non_numeric_characters ( "" [^0-9])
static

◆ reserve()

template<typename LayoutT>
void blender::gpu::reserve ( const shader::Type type,
int32_t array_size,
uint32_t * r_offset )
static

Reserve space for the given type and array size.

This function doesn't handle alignment this needs to be done up front by calling 'align<Layout>' function. Caller is responsible for this.

'type': The type that needs to be reserved. 'array_size': The array_size that needs to be reserved. (0=no array). 'r_offset': When calling needs to be pointing to the aligned location where to reserve space. After the call it will point to the byte just after reserved space.

Definition at line 102 of file vk_memory_layout.hh.

References array_stride(), and element_stride().

◆ reversed()

ConversionType blender::gpu::reversed ( ConversionType type)
static

◆ sampler_binding()

int blender::gpu::sampler_binding ( int32_t program,
uint32_t uniform_index,
int32_t uniform_location,
int * sampler_len )
inlinestatic

◆ set_load_store()

void blender::gpu::set_load_store ( VkRenderingAttachmentInfo & r_rendering_attachment,
const GPULoadStore & ls )
static

◆ shader_input_index()

int32_t blender::gpu::shader_input_index ( const ShaderInput * shader_inputs,
const ShaderInput * shader_input )
static

Definition at line 274 of file vk_shader_interface.cc.

References shader_input_index().

Referenced by shader_input_index().

◆ sort_input_list()

◆ ssbo_binding()

int blender::gpu::ssbo_binding ( int32_t program,
uint32_t ssbo_index )
inlinestatic

◆ struct_size()

template<typename LayoutT>
uint32_t blender::gpu::struct_size ( Span< shader::ShaderCreateInfo::PushConst > push_constants)

◆ supports_barycentric_whitelist()

bool blender::gpu::supports_barycentric_whitelist ( id< MTLDevice > device)

◆ swizzle_to_gl()

GLenum blender::gpu::swizzle_to_gl ( const char swizzle)
inline

Definition at line 338 of file gl_texture.hh.

References swizzle_to_gl().

Referenced by blender::gpu::GLTexture::swizzle_set(), and swizzle_to_gl().

◆ swizzle_to_mtl()

MTLTextureSwizzle blender::gpu::swizzle_to_mtl ( const char swizzle)
static

Definition at line 1471 of file mtl_texture.mm.

References swizzle_to_mtl().

Referenced by blender::gpu::MTLTexture::swizzle_set(), and swizzle_to_mtl().

◆ TEST() [1/11]

blender::gpu::TEST ( std140 ,
_2fl  )

◆ TEST() [2/11]

blender::gpu::TEST ( std140 ,
_3fl  )

◆ TEST() [3/11]

blender::gpu::TEST ( std140 ,
_4fl  )

◆ TEST() [4/11]

blender::gpu::TEST ( std140 ,
fl  )

◆ TEST() [5/11]

blender::gpu::TEST ( std140 ,
fl2  )

◆ TEST() [6/11]

blender::gpu::TEST ( std140 ,
fl_fl2  )

◆ TEST() [7/11]

blender::gpu::TEST ( std140 ,
fl_vec2  )

◆ TEST() [8/11]

blender::gpu::TEST ( std140 ,
gpu_shader_2D_widget_base  )

◆ TEST() [9/11]

blender::gpu::TEST ( std430 ,
compositor_cryptomatte_matte_compute  )

◆ TEST() [10/11]

blender::gpu::TEST ( std430 ,
overlay_grid  )

◆ TEST() [11/11]

blender::gpu::TEST ( std430 ,
simple_lighting  )

◆ tex_data_format_to_msl_texture_template_type()

◆ tex_data_format_to_msl_type_str()

◆ to_bind_type()

◆ to_binding_location_len() [1/2]

uint32_t blender::gpu::to_binding_location_len ( const GPUVertAttr & attribute)
static

◆ to_binding_location_len() [2/2]

◆ to_block_size()

◆ to_bytesize() [1/6]

◆ to_bytesize() [2/6]

int blender::gpu::to_bytesize ( const VertAttrType format)
inline

Definition at line 33 of file gpu_vertex_format_private.hh.

References to_bytesize().

◆ to_bytesize() [3/6]

◆ to_bytesize() [4/6]

◆ to_bytesize() [5/6]

size_t blender::gpu::to_bytesize ( eGPUTextureFormat tex_format,
eGPUDataFormat data_format )
inline

◆ to_bytesize() [6/6]

size_t blender::gpu::to_bytesize ( GPUIndexBufType type)
inline

Definition at line 29 of file GPU_index_buffer.hh.

References GPU_INDEX_U32, and to_bytesize().

◆ to_component_len()

int blender::gpu::to_component_len ( eGPUTextureFormat format)
inline

◆ to_component_type()

◆ to_data_format() [1/3]

◆ to_data_format() [2/3]

DataFormat blender::gpu::to_data_format ( TextureFormat format)
inlineconstexpr

◆ to_data_format() [3/3]

DataFormat blender::gpu::to_data_format ( VertAttrType format)
inlineconstexpr

Definition at line 109 of file GPU_vertex_format.hh.

References to_data_format().

◆ to_format_flag()

eGPUTextureFormatFlag blender::gpu::to_format_flag ( eGPUTextureFormat format)
inline

◆ to_framebuffer_bits()

◆ to_gl() [1/10]

GLbitfield blender::gpu::to_gl ( const eGPUFrameBufferBits bits)
inlinestatic

Definition at line 146 of file gl_framebuffer.hh.

References GPU_COLOR_BIT, GPU_DEPTH_BIT, GPU_STENCIL_BIT, mask(), and to_gl().

◆ to_gl() [2/10]

GLenum blender::gpu::to_gl ( const GPUAttachmentType type)
inlinestatic

Definition at line 120 of file gl_framebuffer.hh.

References ATTACHMENT, BLI_assert, and to_gl().

◆ to_gl() [3/10]

◆ to_gl() [4/10]

◆ to_gl() [5/10]

GLenum blender::gpu::to_gl ( GPUIndexBufType type)
inlinestatic

Definition at line 63 of file gl_index_buffer.hh.

References GPU_INDEX_U32, and to_gl().

◆ to_gl() [6/10]

◆ to_gl() [7/10]

GLenum blender::gpu::to_gl ( GPUQueryType type)
inlinestatic

Definition at line 44 of file gl_query.hh.

References BLI_assert, GPU_QUERY_OCCLUSION, and to_gl().

◆ to_gl() [8/10]

◆ to_gl() [9/10]

GLenum blender::gpu::to_gl ( GPUUsageType type)
inlinestatic

◆ to_gl() [10/10]

GLenum blender::gpu::to_gl ( GPUVertCompType type)
inlinestatic

◆ to_gl_data_format()

◆ to_gl_internal_format()

◆ to_gl_proxy()

◆ to_gl_target()

◆ to_gpu_format()

eGPUTextureFormat blender::gpu::to_gpu_format ( const VkFormat format)

◆ to_metal_type()

◆ to_mtl()

◆ to_mtl_type() [1/3]

MTLVisibilityResultMode blender::gpu::to_mtl_type ( GPUQueryType type)
inlinestatic

Definition at line 46 of file mtl_query.mm.

References BLI_assert, GPU_QUERY_OCCLUSION, and to_mtl_type().

Referenced by blender::gpu::MTLQueryPool::init(), and to_mtl_type().

◆ to_mtl_type() [2/3]

MTLSamplerAddressMode blender::gpu::to_mtl_type ( GPUSamplerExtendMode wrap_mode)
inlinestatic

◆ to_mtl_type() [3/3]

eMTLDataType blender::gpu::to_mtl_type ( Type type)
static

Definition at line 60 of file mtl_shader_generator.mm.

References BLI_assert_msg, blender::gpu::shader::bool_t, blender::gpu::shader::char2_t, blender::gpu::shader::char3_t, blender::gpu::shader::char4_t, blender::gpu::shader::char_t, blender::gpu::shader::float2_t, blender::gpu::shader::float3_10_10_10_2_t, blender::gpu::shader::float3_t, blender::gpu::shader::float3x3_t, blender::gpu::shader::float4_t, blender::gpu::shader::float4x4_t, blender::gpu::shader::float_t, blender::gpu::shader::int2_t, blender::gpu::shader::int3_t, blender::gpu::shader::int4_t, blender::gpu::shader::int_t, MTL_DATATYPE_BOOL, MTL_DATATYPE_CHAR, MTL_DATATYPE_CHAR2, MTL_DATATYPE_CHAR3, MTL_DATATYPE_CHAR4, MTL_DATATYPE_FLOAT, MTL_DATATYPE_FLOAT2, MTL_DATATYPE_FLOAT3, MTL_DATATYPE_FLOAT3x3, MTL_DATATYPE_FLOAT4, MTL_DATATYPE_FLOAT4x4, MTL_DATATYPE_INT, MTL_DATATYPE_INT1010102_NORM, MTL_DATATYPE_INT2, MTL_DATATYPE_INT3, MTL_DATATYPE_INT4, MTL_DATATYPE_SHORT, MTL_DATATYPE_SHORT2, MTL_DATATYPE_SHORT3, MTL_DATATYPE_SHORT4, MTL_DATATYPE_UCHAR, MTL_DATATYPE_UCHAR2, MTL_DATATYPE_UCHAR3, MTL_DATATYPE_UCHAR4, MTL_DATATYPE_UINT, MTL_DATATYPE_UINT2, MTL_DATATYPE_UINT3, MTL_DATATYPE_UINT4, MTL_DATATYPE_USHORT, MTL_DATATYPE_USHORT2, MTL_DATATYPE_USHORT3, MTL_DATATYPE_USHORT4, blender::gpu::shader::short2_t, blender::gpu::shader::short3_t, blender::gpu::shader::short4_t, blender::gpu::shader::short_t, to_mtl_type(), blender::gpu::shader::uchar2_t, blender::gpu::shader::uchar3_t, blender::gpu::shader::uchar4_t, blender::gpu::shader::uchar_t, blender::gpu::shader::uint2_t, blender::gpu::shader::uint3_t, blender::gpu::shader::uint4_t, blender::gpu::shader::uint_t, blender::gpu::shader::ushort2_t, blender::gpu::shader::ushort3_t, blender::gpu::shader::ushort4_t, and blender::gpu::shader::ushort_t.

Referenced by blender::gpu::MSLGeneratorInterface::bake_shader_interface(), and to_mtl_type().

◆ to_non_srgb_format()

VkFormat blender::gpu::to_non_srgb_format ( const VkFormat format)
static

Definition at line 17 of file vk_image_view.cc.

References to_non_srgb_format().

Referenced by to_non_srgb_format(), and blender::gpu::VKImageView::VKImageView().

◆ to_stage_name()

StringRef blender::gpu::to_stage_name ( shaderc_shader_kind stage)
static

Definition at line 146 of file vk_shader_compiler.cc.

References BLI_assert_msg, and to_stage_name().

Referenced by compile_ex(), and to_stage_name().

◆ to_string() [1/44]

const char * blender::gpu::to_string ( const DepthWrite & value)
static

◆ to_string() [2/44]

◆ to_string() [3/44]

const char * blender::gpu::to_string ( const shader::Interpolation & interp)
inline

◆ to_string() [4/44]

◆ to_string() [5/44]

const char * blender::gpu::to_string ( const shader::PrimitiveOut & layout)
inline

◆ to_string() [6/44]

◆ to_string() [7/44]

const char * blender::gpu::to_string ( const VkAttachmentLoadOp vk_attachment_load_op)

Definition at line 63 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [8/44]

const char * blender::gpu::to_string ( const VkAttachmentStoreOp vk_attachment_store_op)

Definition at line 81 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [9/44]

std::string blender::gpu::to_string ( const VkBufferCopy & vk_buffer_copy,
int indentation_level )

Definition at line 593 of file vk_to_string.cc.

References to_string(), and UNUSED_VARS.

◆ to_string() [10/44]

std::string blender::gpu::to_string ( const VkBufferImageCopy & vk_buffer_image_copy,
int indentation_level )

Definition at line 604 of file vk_to_string.cc.

References to_string().

◆ to_string() [11/44]

std::string blender::gpu::to_string ( const VkBufferMemoryBarrier & vk_buffer_memory_barrier,
int indentation_level )

Definition at line 626 of file vk_to_string.cc.

References to_string(), to_string_vk_access_flags(), and UNUSED_VARS.

◆ to_string() [12/44]

std::string blender::gpu::to_string ( const VkClearAttachment & vk_clear_attachment,
int indentation_level )

Definition at line 639 of file vk_to_string.cc.

References to_string(), to_string_vk_image_aspect_flags(), and UNUSED_VARS.

◆ to_string() [13/44]

std::string blender::gpu::to_string ( const VkClearDepthStencilValue & vk_clear_depth_stencil_value,
int indentation_level )

Definition at line 649 of file vk_to_string.cc.

References to_string(), and UNUSED_VARS.

◆ to_string() [14/44]

std::string blender::gpu::to_string ( const VkClearRect & vk_clear_rect,
int indentation_level )

Definition at line 660 of file vk_to_string.cc.

References to_string().

◆ to_string() [15/44]

std::string blender::gpu::to_string ( const VkExtent2D & vk_extent2_d,
int indentation_level )

Definition at line 673 of file vk_to_string.cc.

References to_string(), and UNUSED_VARS.

◆ to_string() [16/44]

std::string blender::gpu::to_string ( const VkExtent3D & vk_extent3_d,
int indentation_level )

Definition at line 683 of file vk_to_string.cc.

References to_string(), and UNUSED_VARS.

◆ to_string() [17/44]

const char * blender::gpu::to_string ( const VkFilter vk_filter)

Definition at line 100 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [18/44]

std::string blender::gpu::to_string ( const VkImageBlit & vk_image_blit,
int indentation_level )

Definition at line 694 of file vk_to_string.cc.

References to_string().

◆ to_string() [19/44]

std::string blender::gpu::to_string ( const VkImageCopy & vk_image_copy,
int indentation_level )

Definition at line 709 of file vk_to_string.cc.

References to_string().

◆ to_string() [20/44]

const char * blender::gpu::to_string ( const VkImageLayout vk_image_layout)

Definition at line 115 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [21/44]

std::string blender::gpu::to_string ( const VkImageMemoryBarrier & vk_image_memory_barrier,
int indentation_level )

Definition at line 736 of file vk_to_string.cc.

References to_string(), and to_string_vk_access_flags().

◆ to_string() [22/44]

std::string blender::gpu::to_string ( const VkImageSubresourceLayers & vk_image_subresource_layers,
int indentation_level )

Definition at line 752 of file vk_to_string.cc.

References to_string(), to_string_vk_image_aspect_flags(), and UNUSED_VARS.

◆ to_string() [23/44]

std::string blender::gpu::to_string ( const VkImageSubresourceRange & vk_image_subresource_range,
int indentation_level )

Definition at line 765 of file vk_to_string.cc.

References to_string(), to_string_vk_image_aspect_flags(), and UNUSED_VARS.

◆ to_string() [24/44]

const char * blender::gpu::to_string ( const VkIndexType vk_index_type)

Definition at line 178 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [25/44]

std::string blender::gpu::to_string ( const VkMemoryBarrier & vk_memory_barrier,
int indentation_level )

Definition at line 779 of file vk_to_string.cc.

References to_string(), to_string_vk_access_flags(), and UNUSED_VARS.

◆ to_string() [26/44]

const char * blender::gpu::to_string ( const VkObjectType vk_object_type)

Definition at line 193 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [27/44]

std::string blender::gpu::to_string ( const VkOffset2D & vk_offset2_d,
int indentation_level )

Definition at line 789 of file vk_to_string.cc.

References to_string(), and UNUSED_VARS.

◆ to_string() [28/44]

std::string blender::gpu::to_string ( const VkOffset3D & vk_offset3_d,
int indentation_level )

Definition at line 799 of file vk_to_string.cc.

References to_string(), and UNUSED_VARS.

◆ to_string() [29/44]

const char * blender::gpu::to_string ( const VkPipelineBindPoint vk_pipeline_bind_point)

Definition at line 291 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [30/44]

std::string blender::gpu::to_string ( const VkRect2D & vk_rect2_d,
int indentation_level )

Definition at line 810 of file vk_to_string.cc.

References to_string().

◆ to_string() [31/44]

std::string blender::gpu::to_string ( const VkRenderingAttachmentInfo & vk_rendering_attachment_info,
int indentation_level )

Definition at line 841 of file vk_to_string.cc.

References to_string(), and UNUSED_VARS.

◆ to_string() [32/44]

std::string blender::gpu::to_string ( const VkRenderingInfo & vk_rendering_info,
int indentation_level )

Definition at line 857 of file vk_to_string.cc.

References to_string(), and to_string_vk_rendering_flags().

◆ to_string() [33/44]

std::string blender::gpu::to_string ( const VkRenderPassBeginInfo & vk_render_pass_begin_info,
int indentation_level )

Definition at line 825 of file vk_to_string.cc.

References to_string().

◆ to_string() [34/44]

const char * blender::gpu::to_string ( const VkResolveModeFlagBits vk_resolve_mode_flag_bits)

Definition at line 306 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [35/44]

const char * blender::gpu::to_string ( const VkSubpassContents vk_subpass_contents)

Definition at line 330 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [36/44]

const char * blender::gpu::to_string ( ShaderStage stage)

Definition at line 52 of file mtl_shader.mm.

References ANY, COMPUTE, FRAGMENT, to_string(), and VERTEX.

Referenced by blender::gpu::render_graph::CommandBufferLog::begin_render_pass(), blender::gpu::render_graph::CommandBufferLog::begin_rendering(), blender::gpu::render_graph::CommandBufferLog::bind_descriptor_sets(), blender::gpu::render_graph::CommandBufferLog::bind_pipeline(), blender::gpu::render_graph::CommandBufferLog::blit_image(), blender::gpu::render_graph::CommandBufferLog::clear_attachments(), blender::gpu::render_graph::CommandBufferLog::clear_color_image(), blender::gpu::render_graph::CommandBufferLog::copy_buffer(), blender::gpu::render_graph::CommandBufferLog::copy_buffer_to_image(), blender::gpu::render_graph::CommandBufferLog::copy_image(), blender::gpu::render_graph::CommandBufferLog::copy_image_to_buffer(), blender::gpu::render_graph::VKRenderGraphLink::debug_print(), blender::gpu::render_graph::CommandBufferLog::dispatch_indirect(), blender::gpu::render_graph::CommandBufferLog::fill_buffer(), blender::gpu::MTLShader::finalize(), blender::gpu::GLShader::fragment_interface_declare(), blender::gpu::MTLShader::fragment_interface_declare(), blender::gpu::VKShader::fragment_interface_declare(), blender::gpu::MSLGeneratorInterface::generate_msl_fragment_struct(), blender::gpu::MSLGeneratorInterface::generate_msl_uniform_structs(), blender::gpu::VKShader::geometry_interface_declare(), blender::gpu::GLShader::geometry_layout_declare(), blender::gpu::render_graph::CommandBufferLog::pipeline_barrier(), print_interface(), print_interface_as_attributes(), print_interface_as_struct(), blender::gpu::debug::VKDebuggingTools::print_labels(), print_resource(), print_resource(), blender::gpu::GLShader::resources_declare(), blender::gpu::VKShader::resources_declare(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), blender::gpu::render_graph::CommandBufferLog::update_buffer(), blender::gpu::GLShader::vertex_interface_declare(), blender::gpu::MTLShader::vertex_interface_declare(), and blender::gpu::VKShader::vertex_interface_declare().

◆ to_string() [37/44]

std::string blender::gpu::to_string ( VkBuffer vk_handle)

Definition at line 23 of file vk_to_string.cc.

References to_string(), and to_string_handle().

◆ to_string() [38/44]

std::string blender::gpu::to_string ( VkDescriptorSet vk_handle)

Definition at line 58 of file vk_to_string.cc.

References to_string(), and to_string_handle().

◆ to_string() [39/44]

std::string blender::gpu::to_string ( VkFramebuffer vk_handle)

Definition at line 43 of file vk_to_string.cc.

References to_string(), and to_string_handle().

◆ to_string() [40/44]

std::string blender::gpu::to_string ( VkImage vk_handle)

Definition at line 28 of file vk_to_string.cc.

References to_string(), and to_string_handle().

◆ to_string() [41/44]

std::string blender::gpu::to_string ( VkImageView vk_handle)

Definition at line 33 of file vk_to_string.cc.

References to_string(), and to_string_handle().

◆ to_string() [42/44]

std::string blender::gpu::to_string ( VkPipeline vk_handle)

Definition at line 53 of file vk_to_string.cc.

References to_string(), and to_string_handle().

◆ to_string() [43/44]

std::string blender::gpu::to_string ( VkPipelineLayout vk_handle)

Definition at line 48 of file vk_to_string.cc.

References to_string(), and to_string_handle().

◆ to_string() [44/44]

std::string blender::gpu::to_string ( VkRenderPass vk_handle)

Definition at line 38 of file vk_to_string.cc.

References to_string(), and to_string_handle().

◆ to_string_handle()

std::string blender::gpu::to_string_handle ( uint64_t vk_handle)
static

Portable printing of vulkan handles across platforms.

Definition at line 16 of file vk_to_string.cc.

References to_string_handle().

Referenced by to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), to_string(), and to_string_handle().

◆ to_string_msl()

const char * blender::gpu::to_string_msl ( const shader::Interpolation & interp)
inline

◆ to_string_vk_access_flags()

std::string blender::gpu::to_string_vk_access_flags ( const VkAccessFlags vk_access_flags)

◆ to_string_vk_dependency_flags()

std::string blender::gpu::to_string_vk_dependency_flags ( const VkDependencyFlags vk_dependency_flags)

Definition at line 408 of file vk_to_string.cc.

References result, STRINGIFY, and to_string_vk_dependency_flags().

Referenced by to_string_vk_dependency_flags().

◆ to_string_vk_image_aspect_flags()

std::string blender::gpu::to_string_vk_image_aspect_flags ( const VkImageAspectFlags vk_image_aspect_flags)

◆ to_string_vk_pipeline_stage_flags()

std::string blender::gpu::to_string_vk_pipeline_stage_flags ( const VkPipelineStageFlags vk_pipeline_stage_flags)

◆ to_string_vk_rendering_flags()

std::string blender::gpu::to_string_vk_rendering_flags ( const VkRenderingFlags vk_rendering_flags)

Definition at line 527 of file vk_to_string.cc.

References result, STRINGIFY, and to_string_vk_rendering_flags().

Referenced by to_string(), and to_string_vk_rendering_flags().

◆ to_string_vk_shader_stage_flags()

std::string blender::gpu::to_string_vk_shader_stage_flags ( const VkShaderStageFlags vk_shader_stage_flags)

Definition at line 557 of file vk_to_string.cc.

References result, STRINGIFY, and to_string_vk_shader_stage_flags().

Referenced by to_string_vk_shader_stage_flags().

◆ to_texture_format() [1/3]

◆ to_texture_format() [2/3]

◆ to_texture_format() [3/3]

TextureFormat blender::gpu::to_texture_format ( TextureWriteFormat format)
inlineconstexpr

Definition at line 266 of file GPU_texture.hh.

References to_texture_format().

◆ to_vk_attachment_load_op()

VkAttachmentLoadOp blender::gpu::to_vk_attachment_load_op ( eGPULoadOp load_op)
static

◆ to_vk_attachment_store_op()

VkAttachmentStoreOp blender::gpu::to_vk_attachment_store_op ( eGPUStoreOp store_op)
static

◆ to_vk_clear_color_value()

◆ to_vk_component_swizzle()

VkComponentSwizzle blender::gpu::to_vk_component_swizzle ( const char swizzle)

◆ to_vk_cull_mode_flags()

VkCullModeFlags blender::gpu::to_vk_cull_mode_flags ( const eGPUFaceCullTest cull_test)

◆ to_vk_descriptor_type()

◆ to_vk_descriptor_type_image()

VkDescriptorType blender::gpu::to_vk_descriptor_type_image ( const shader::ImageType & image_type)
static

◆ to_vk_descriptor_type_sampler()

VkDescriptorType blender::gpu::to_vk_descriptor_type_sampler ( const shader::ImageType & image_type)
static

◆ to_vk_format() [1/3]

◆ to_vk_format() [2/3]

VkFormat blender::gpu::to_vk_format ( const GPUVertCompType type,
const uint32_t size,
GPUVertFetchMode fetch_mode )

◆ to_vk_format() [3/3]

◆ to_vk_format_float()

VkFormat blender::gpu::to_vk_format_float ( const GPUVertCompType type,
const uint32_t size )
static

Definition at line 362 of file vk_common.cc.

References BLI_assert_unreachable, GPU_COMP_F32, and to_vk_format_float().

Referenced by to_vk_format(), and to_vk_format_float().

◆ to_vk_format_int()

VkFormat blender::gpu::to_vk_format_int ( const GPUVertCompType type,
const uint32_t size )
static

◆ to_vk_format_norm()

VkFormat blender::gpu::to_vk_format_norm ( const GPUVertCompType type,
const uint32_t size )
static

◆ to_vk_image_aspect_flag_bits() [1/2]

VkImageAspectFlags blender::gpu::to_vk_image_aspect_flag_bits ( const eGPUFrameBufferBits buffers)

◆ to_vk_image_aspect_flag_bits() [2/2]

VkImageAspectFlags blender::gpu::to_vk_image_aspect_flag_bits ( const eGPUTextureFormat format)

Definition at line 14 of file vk_common.cc.

References BLI_assert_unreachable, GPU_DEPTH24_STENCIL8, GPU_DEPTH32F_STENCIL8, GPU_DEPTH_COMPONENT16, GPU_DEPTH_COMPONENT24, GPU_DEPTH_COMPONENT32F, GPU_R11F_G11F_B10F, GPU_R16, GPU_R16_SNORM, GPU_R16F, GPU_R16I, GPU_R16UI, GPU_R32F, GPU_R32I, GPU_R32UI, GPU_R8, GPU_R8_SNORM, GPU_R8I, GPU_R8UI, GPU_RG16, GPU_RG16_SNORM, GPU_RG16F, GPU_RG16I, GPU_RG16UI, GPU_RG32F, GPU_RG32I, GPU_RG32UI, GPU_RG8, GPU_RG8_SNORM, GPU_RG8I, GPU_RG8UI, GPU_RGB10_A2, GPU_RGB10_A2UI, GPU_RGB16, GPU_RGB16_SNORM, GPU_RGB16F, GPU_RGB16I, GPU_RGB16UI, GPU_RGB32F, GPU_RGB32I, GPU_RGB32UI, GPU_RGB8, GPU_RGB8_SNORM, GPU_RGB8I, GPU_RGB8UI, GPU_RGB9_E5, GPU_RGBA16, GPU_RGBA16_SNORM, GPU_RGBA16F, GPU_RGBA16I, GPU_RGBA16UI, GPU_RGBA32F, GPU_RGBA32I, GPU_RGBA32UI, GPU_RGBA8, GPU_RGBA8_DXT1, GPU_RGBA8_DXT3, GPU_RGBA8_DXT5, GPU_RGBA8_SNORM, GPU_RGBA8I, GPU_RGBA8UI, GPU_SRGB8, GPU_SRGB8_A8, GPU_SRGB8_A8_DXT1, GPU_SRGB8_A8_DXT3, GPU_SRGB8_A8_DXT5, and to_vk_image_aspect_flag_bits().

Referenced by blender::gpu::VKTexture::clear(), blender::gpu::VKTexture::clear_depth_stencil(), blender::gpu::VKTexture::copy_to(), blender::gpu::VKTexture::copy_to(), blender::gpu::VKTexture::generate_mipmap(), blender::gpu::VKTexture::read_sub(), blender::gpu::VKFrameBuffer::rendering_ensure_dynamic_rendering(), blender::gpu::VKFrameBuffer::rendering_ensure_render_pass(), to_vk_image_aspect_flag_bits(), to_vk_image_aspect_flag_bits(), blender::gpu::VKTexture::update_sub(), and blender::gpu::VKImageView::VKImageView().

◆ to_vk_image_aspect_single_bit()

VkImageAspectFlags blender::gpu::to_vk_image_aspect_single_bit ( const VkImageAspectFlags format,
bool stencil )
static

◆ to_vk_image_create()

VkImageCreateFlags blender::gpu::to_vk_image_create ( const eGPUTextureType texture_type,
const eGPUTextureFormatFlag format_flag,
const eGPUTextureUsage usage )
static

◆ to_vk_image_type()

◆ to_vk_image_usage()

◆ to_vk_image_view_type()

◆ to_vk_index_type()

VkIndexType blender::gpu::to_vk_index_type ( const GPUIndexBufType index_type)

◆ to_vk_object_type()

template<typename T>
VkObjectType blender::gpu::to_vk_object_type ( T )

◆ to_vk_primitive_topology()

◆ to_vk_query_type()

VkQueryType blender::gpu::to_vk_query_type ( const GPUQueryType query_type)

◆ to_vk_sampler_address_mode()

◆ type_of_conversion_float()

◆ type_of_conversion_half()

◆ type_of_conversion_int()

◆ type_of_conversion_r10g10b10a2()

ConversionType blender::gpu::type_of_conversion_r10g10b10a2 ( eGPUTextureFormat device_format)
static

◆ type_of_conversion_r11g11b10()

ConversionType blender::gpu::type_of_conversion_r11g11b10 ( eGPUTextureFormat device_format)
static

◆ type_of_conversion_ubyte()

◆ type_of_conversion_uint()

◆ type_of_conversion_uint248()

◆ uint32_t_to_float()

float blender::gpu::uint32_t_to_float ( uint32_t value)
static

Definition at line 701 of file vk_data_conversion.cc.

References uint32_t_to_float().

Referenced by convert(), and uint32_t_to_float().

◆ unwrap() [1/25]

VKBatch * blender::gpu::unwrap ( Batch * batch)
inline

Definition at line 32 of file vk_batch.hh.

References unwrap().

Referenced by blender::gpu::VKContext::active_framebuffer_get(), blender::gpu::GLImmediate::begin(), blender::gpu::MTLVertBuf::bind_as_texture(), blender::gpu::VKFrameBuffer::blit_to(), blender::gpu::MTLTexture::clear(), blender::gpu::VKFrameBuffer::clear(), blender::gpu::VKBackend::compute_dispatch_indirect(), blender::gpu::VKStorageBuffer::copy_sub(), blender::gpu::VKTexture::copy_to(), blender::gpu::GLBatch::draw_indirect(), blender::gpu::GLImmediate::end(), blender::gpu::MTLImmediate::end(), blender::gpu::VKImmediate::end(), blender::gpu::TexturePool::get(), GPU_batch_draw(), GPU_batch_draw_instance_range(), GPU_batch_draw_range(), GPU_context_active_set(), GPU_context_begin_frame(), GPU_context_discard(), GPU_context_end_frame(), GPU_fence_free(), GPU_fence_signal(), GPU_fence_wait(), GPU_framebuffer_bind(), GPU_framebuffer_bind_loadstore(), GPU_framebuffer_bind_no_srgb(), GPU_framebuffer_blit(), GPU_framebuffer_check_valid(), GPU_framebuffer_clear(), GPU_framebuffer_config_array(), GPU_framebuffer_default_size(), GPU_framebuffer_free(), GPU_framebuffer_get_name(), GPU_framebuffer_multi_clear(), GPU_framebuffer_multi_viewports_set(), GPU_framebuffer_py_reference_get(), GPU_framebuffer_py_reference_set(), GPU_framebuffer_read_color(), GPU_framebuffer_read_depth(), GPU_framebuffer_recursive_downsample(), GPU_framebuffer_subpass_transition_array(), gpu_framebuffer_texture_attach_ex(), GPU_framebuffer_texture_detach(), GPU_framebuffer_viewport_get(), GPU_framebuffer_viewport_reset(), GPU_framebuffer_viewport_set(), GPU_offscreen_bind(), GPU_offscreen_draw_to_screen(), GPU_pixel_buffer_free(), GPU_pixel_buffer_get_native_handle(), GPU_pixel_buffer_map(), GPU_pixel_buffer_size(), GPU_pixel_buffer_unmap(), GPU_shader_bind(), GPU_shader_free(), GPU_shader_get_builtin_shader_with_config(), GPU_shader_get_default_constant_state(), GPU_shader_get_name(), GPU_shader_set_parent(), GPU_shader_uniform_float_ex(), GPU_shader_uniform_int_ex(), GPU_shader_warm_cache(), GPU_storagebuf_bind(), GPU_storagebuf_clear(), GPU_storagebuf_copy_sub_from_vertbuf(), GPU_storagebuf_free(), GPU_storagebuf_read(), GPU_storagebuf_sync_as_indirect_buffer(), GPU_storagebuf_sync_to_host(), GPU_storagebuf_unbind(), GPU_storagebuf_update(), GPU_texture_anisotropic_filter(), GPU_texture_bind(), GPU_texture_bind_ex(), GPU_texture_clear(), GPU_texture_compare_mode(), GPU_texture_copy(), GPU_texture_create_view(), GPU_texture_depth(), GPU_texture_dimensions(), GPU_texture_extend_mode(), GPU_texture_extend_mode_x(), GPU_texture_extend_mode_y(), GPU_texture_filter_mode(), GPU_texture_format(), GPU_texture_free(), GPU_texture_get_mipmap_size(), GPU_texture_has_depth_format(), GPU_texture_has_float_format(), GPU_texture_has_integer_format(), GPU_texture_has_normalized_format(), GPU_texture_has_signed_format(), GPU_texture_has_stencil_format(), GPU_texture_height(), GPU_texture_image_bind(), GPU_texture_image_unbind(), GPU_texture_is_array(), GPU_texture_is_cube(), GPU_texture_layer_count(), GPU_texture_mip_count(), GPU_texture_mipmap_mode(), GPU_texture_opengl_bindcode(), GPU_texture_original_height(), GPU_texture_original_size_set(), GPU_texture_original_width(), GPU_texture_py_reference_get(), GPU_texture_py_reference_set(), GPU_texture_read(), GPU_texture_ref(), GPU_texture_swizzle_set(), GPU_texture_unbind(), GPU_texture_update(), GPU_texture_update_mipmap(), GPU_texture_update_mipmap_chain(), GPU_texture_update_sub(), GPU_texture_update_sub_from_pixel_buffer(), GPU_texture_width(), GPU_uniformbuf_bind(), GPU_uniformbuf_bind_as_ssbo(), GPU_uniformbuf_clear_to_zero(), GPU_uniformbuf_free(), GPU_uniformbuf_unbind(), GPU_uniformbuf_update(), blender::gpu::VKStateManager::image_bind(), blender::gpu::VKStateManager::image_unbind(), immEnd(), blender::gpu::VKBatch::index_buffer_get(), blender::gpu::GLTexture::init_internal(), blender::gpu::MTLTexture::init_internal(), blender::gpu::VKTexture::init_internal(), blender::gpu::VKTexture::init_internal(), blender::gpu::Texture::init_view(), blender::gpu::VKBatch::instance_buffer_get(), blender::gpu::GLBatch::multi_draw_indirect(), blender::gpu::VKBatch::multi_draw_indirect(), blender::gpu::VKFrameBuffer::read(), blender::gpu::VKFrameBuffer::rendering_ensure_dynamic_rendering(), blender::gpu::VKFrameBuffer::rendering_ensure_render_pass(), blender::gpu::GLShaderCompiler::specialize_shader(), blender::gpu::MTLShaderCompiler::specialize_shader(), blender::gpu::GLFrameBuffer::subpass_transition_impl(), blender::gpu::VKFrameBuffer::subpass_transition_impl(), blender::gpu::MTLFrameBuffer::update_attachments(), blender::gpu::GLVertArray::update_bindings(), blender::gpu::VKVertexAttributeObject::update_bindings(), blender::gpu::VKVertexAttributeObject::update_bindings(), blender::gpu::VKDescriptorSetTracker::update_descriptor_set(), blender::gpu::VKContext::update_pipeline_data(), blender::gpu::VKContext::update_pipeline_data(), blender::gpu::VKFrameBuffer::update_srgb(), blender::gpu::MTLTexture::update_sub(), blender::gpu::VKTexture::update_sub(), and blender::gpu::VKBatch::vertex_buffer_get().

◆ unwrap() [2/25]

const Context * blender::gpu::unwrap ( const GPUContext * ctx)
inlinestatic

Definition at line 170 of file gpu_context_private.hh.

References unwrap().

◆ unwrap() [3/25]

const Fence * blender::gpu::unwrap ( const GPUFence * pixbuf)
inlinestatic

Definition at line 188 of file gpu_state_private.hh.

References unwrap().

◆ unwrap() [4/25]

const FrameBuffer * blender::gpu::unwrap ( const GPUFrameBuffer * vert)
inlinestatic

Definition at line 282 of file gpu_framebuffer_private.hh.

References unwrap().

◆ unwrap() [5/25]

const PixelBuffer * blender::gpu::unwrap ( const GPUPixelBuffer * pixbuf)
inlinestatic

Definition at line 360 of file gpu_texture_private.hh.

References unwrap().

◆ unwrap() [6/25]

const Shader * blender::gpu::unwrap ( const GPUShader * vert)
inlinestatic

Definition at line 140 of file gpu_shader_private.hh.

References unwrap().

◆ unwrap() [7/25]

const StorageBuf * blender::gpu::unwrap ( const GPUStorageBuf * storage_buf)
inlinestatic

Definition at line 61 of file gpu_storage_buffer_private.hh.

References unwrap().

◆ unwrap() [8/25]

const Texture * blender::gpu::unwrap ( const GPUTexture * vert)
inlinestatic

Definition at line 331 of file gpu_texture_private.hh.

References unwrap().

◆ unwrap() [9/25]

const UniformBuf * blender::gpu::unwrap ( const GPUUniformBuf * vert)
inlinestatic

Definition at line 64 of file gpu_uniform_buffer_private.hh.

References unwrap().

◆ unwrap() [10/25]

VKFrameBuffer * blender::gpu::unwrap ( FrameBuffer * framebuffer)
inlinestatic

Definition at line 169 of file vk_framebuffer.hh.

References unwrap().

◆ unwrap() [11/25]

Context * blender::gpu::unwrap ( GPUContext * ctx)
inlinestatic

◆ unwrap() [12/25]

Fence * blender::gpu::unwrap ( GPUFence * pixbuf)
inlinestatic

Definition at line 184 of file gpu_state_private.hh.

References unwrap().

◆ unwrap() [13/25]

FrameBuffer * blender::gpu::unwrap ( GPUFrameBuffer * vert)
inlinestatic

Definition at line 278 of file gpu_framebuffer_private.hh.

References unwrap().

◆ unwrap() [14/25]

PixelBuffer * blender::gpu::unwrap ( GPUPixelBuffer * pixbuf)
inlinestatic

Definition at line 356 of file gpu_texture_private.hh.

References unwrap().

◆ unwrap() [15/25]

Shader * blender::gpu::unwrap ( GPUShader * vert)
inlinestatic

Definition at line 136 of file gpu_shader_private.hh.

References unwrap().

◆ unwrap() [16/25]

StorageBuf * blender::gpu::unwrap ( GPUStorageBuf * storage_buf)
inlinestatic

Definition at line 57 of file gpu_storage_buffer_private.hh.

References unwrap().

◆ unwrap() [17/25]

Texture * blender::gpu::unwrap ( GPUTexture * vert)
inlinestatic

Definition at line 327 of file gpu_texture_private.hh.

References unwrap().

◆ unwrap() [18/25]

UniformBuf * blender::gpu::unwrap ( GPUUniformBuf * vert)
inlinestatic

Definition at line 60 of file gpu_uniform_buffer_private.hh.

References unwrap().

◆ unwrap() [19/25]

VKIndexBuffer * blender::gpu::unwrap ( IndexBuf * index_buffer)
inlinestatic

Definition at line 52 of file vk_index_buffer.hh.

References unwrap().

◆ unwrap() [20/25]

VKPixelBuffer * blender::gpu::unwrap ( PixelBuffer * pixel_buffer)
inlinestatic

Definition at line 38 of file vk_pixel_buffer.hh.

References unwrap().

◆ unwrap() [21/25]

VKShader & blender::gpu::unwrap ( Shader & shader)
inlinestatic

Definition at line 135 of file vk_shader.hh.

References unwrap().

◆ unwrap() [22/25]

VKShader * blender::gpu::unwrap ( Shader * shader)
inlinestatic

Definition at line 140 of file vk_shader.hh.

References unwrap().

◆ unwrap() [23/25]

BLI_INLINE VKStorageBuffer * blender::gpu::unwrap ( StorageBuf * storage_buffer)

Definition at line 62 of file vk_storage_buffer.hh.

References BLI_INLINE, and unwrap().

◆ unwrap() [24/25]

BLI_INLINE VKTexture * blender::gpu::unwrap ( Texture * tex)

Definition at line 182 of file vk_texture.hh.

References BLI_INLINE, and unwrap().

◆ unwrap() [25/25]

BLI_INLINE VKVertexBuffer * blender::gpu::unwrap ( VertBuf * vertex_buffer)

Definition at line 77 of file vk_vertex_buffer.hh.

References BLI_INLINE, and unwrap().

◆ validate_data_format()

bool blender::gpu::validate_data_format ( eGPUTextureFormat tex_format,
eGPUDataFormat data_format )
constexpr

Definition at line 769 of file gpu_texture_private.hh.

References ATTR_FALLTHROUGH, BLI_assert_unreachable, ELEM, GPU_DATA_10_11_11_REV, GPU_DATA_2_10_10_10_REV, GPU_DATA_FLOAT, GPU_DATA_HALF_FLOAT, GPU_DATA_INT, GPU_DATA_UBYTE, GPU_DATA_UINT, GPU_DATA_UINT_24_8, GPU_DEPTH24_STENCIL8, GPU_DEPTH32F_STENCIL8, GPU_DEPTH_COMPONENT16, GPU_DEPTH_COMPONENT24, GPU_DEPTH_COMPONENT32F, GPU_R11F_G11F_B10F, GPU_R16, GPU_R16_SNORM, GPU_R16F, GPU_R16I, GPU_R16UI, GPU_R32F, GPU_R32I, GPU_R32UI, GPU_R8, GPU_R8_SNORM, GPU_R8I, GPU_R8UI, GPU_RG16, GPU_RG16_SNORM, GPU_RG16F, GPU_RG16I, GPU_RG16UI, GPU_RG32F, GPU_RG32I, GPU_RG32UI, GPU_RG8, GPU_RG8_SNORM, GPU_RG8I, GPU_RG8UI, GPU_RGB10_A2, GPU_RGB10_A2UI, GPU_RGB16, GPU_RGB16_SNORM, GPU_RGB16F, GPU_RGB16I, GPU_RGB16UI, GPU_RGB32F, GPU_RGB32I, GPU_RGB32UI, GPU_RGB8, GPU_RGB8_SNORM, GPU_RGB8I, GPU_RGB8UI, GPU_RGB9_E5, GPU_RGBA16, GPU_RGBA16_SNORM, GPU_RGBA16F, GPU_RGBA16I, GPU_RGBA16UI, GPU_RGBA32F, GPU_RGBA32I, GPU_RGBA32UI, GPU_RGBA8, GPU_RGBA8_DXT1, GPU_RGBA8_DXT3, GPU_RGBA8_DXT5, GPU_RGBA8_SNORM, GPU_RGBA8I, GPU_RGBA8UI, GPU_SRGB8, GPU_SRGB8_A8, GPU_SRGB8_A8_DXT1, GPU_SRGB8_A8_DXT3, GPU_SRGB8_A8_DXT5, and validate_data_format().

Referenced by blender::gpu::GLTexture::clear(), blender::gpu::GLTexture::read(), blender::gpu::MTLTexture::read(), blender::gpu::tests::texture_create_upload_read(), blender::gpu::tests::texture_create_upload_read_pixel(), blender::gpu::tests::texture_create_upload_read_with_bias(), blender::gpu::GLTexture::update_sub(), blender::gpu::GLTexture::update_sub(), blender::gpu::MTLTexture::update_sub(), and validate_data_format().

◆ vbo_bind()

uint16_t blender::gpu::vbo_bind ( const ShaderInterface * interface,
const GPUVertFormat * format,
uint v_first,
uint v_len,
const bool use_instancing )
static

◆ vertex_format_combine()

◆ vk_extension_get()

const char * blender::gpu::vk_extension_get ( int index)
static

◆ wrap() [1/10]

GPUContext * blender::gpu::wrap ( Context * ctx)
inlinestatic

Definition at line 162 of file gpu_context_private.hh.

References wrap().

Referenced by wrap(), wrap(), wrap(), wrap(), wrap(), wrap(), wrap(), wrap(), wrap(), and wrap().

◆ wrap() [2/10]

GPUFence * blender::gpu::wrap ( Fence * pixbuf)
inlinestatic

Definition at line 180 of file gpu_state_private.hh.

References wrap().

◆ wrap() [3/10]

GPUFrameBuffer * blender::gpu::wrap ( FrameBuffer * vert)
inlinestatic

Definition at line 274 of file gpu_framebuffer_private.hh.

References wrap().

◆ wrap() [4/10]

GPUPixelBuffer * blender::gpu::wrap ( PixelBuffer * pixbuf)
inlinestatic

Definition at line 352 of file gpu_texture_private.hh.

References wrap().

◆ wrap() [5/10]

GPUShader * blender::gpu::wrap ( Shader * vert)
inlinestatic

Definition at line 132 of file gpu_shader_private.hh.

References wrap().

◆ wrap() [6/10]

GPUStorageBuf * blender::gpu::wrap ( StorageBuf * storage_buf)
inlinestatic

Definition at line 53 of file gpu_storage_buffer_private.hh.

References wrap().

◆ wrap() [7/10]

GPUTexture * blender::gpu::wrap ( Texture * vert)
inlinestatic

Definition at line 323 of file gpu_texture_private.hh.

References wrap().

◆ wrap() [8/10]

GPUUniformBuf * blender::gpu::wrap ( UniformBuf * vert)
inlinestatic

Definition at line 56 of file gpu_uniform_buffer_private.hh.

References wrap().

◆ wrap() [9/10]

◆ wrap() [10/10]

BLI_INLINE UniformBuf * blender::gpu::wrap ( VKUniformBuffer * uniform_buffer)

Definition at line 70 of file vk_uniform_buffer.hh.

References BLI_INLINE, and wrap().

◆ write_spirv_to_disk()

Variable Documentation

◆ BIND_SPACE_IMAGE_OFFSET

int blender::gpu::BIND_SPACE_IMAGE_OFFSET = 512
staticconstexpr

Offset when searching for bindings.

When shaders combine images and samplers, the images have to be offset to find the correct shader input. Both textures and images are stored in the uniform list and their ID can be overlapping.

Definition at line 33 of file vk_state_manager.hh.

◆ DEFAULT_INTERNAL_BUFFER_SIZE

size_t blender::gpu::DEFAULT_INTERNAL_BUFFER_SIZE = 4 * 1024 * 1024
constexpr

◆ DEFAULT_SAMPLER_STATE

◆ g_autoreleasepool

NSAutoreleasePool* blender::gpu::g_autoreleasepool = nil
thread_local

◆ g_autoreleasepool_depth

int blender::gpu::g_autoreleasepool_depth = 0
thread_local

◆ GCaps

◆ GPG

◆ LOG [1/2]

CLG_LogRef blender::gpu::LOG = {"gpu.vulkan"}
static

Definition at line 24 of file vk_immediate.cc.

◆ LOG [2/2]

CLG_LogRef blender::gpu::LOG = {"gpu.vulkan"}
static

Definition at line 17 of file vk_pixel_buffer.cc.

Referenced by blender::gpu::VKPixelBuffer::get_native_handle().

◆ MASK_10_BITS

uint32_t blender::gpu::MASK_10_BITS = 0b1111111111
constexpr

Definition at line 964 of file vk_data_conversion.cc.

Referenced by convert().

◆ MASK_11_BITS

uint32_t blender::gpu::MASK_11_BITS = 0b11111111111
constexpr

Definition at line 965 of file vk_data_conversion.cc.

Referenced by convert().

◆ msl_patch_default_lock

std::mutex blender::gpu::msl_patch_default_lock

◆ MTL_MAX_FBO_ATTACHED

const int blender::gpu::MTL_MAX_FBO_ATTACHED = 16
static

Definition at line 137 of file mtl_texture.hh.

◆ MTL_MAX_MIPMAP_COUNT

const int blender::gpu::MTL_MAX_MIPMAP_COUNT = 15
static

Definition at line 136 of file mtl_texture.hh.

◆ PCI_ID_AMD

int32_t blender::gpu::PCI_ID_AMD = 0x1002
constexpr

Definition at line 406 of file vk_device.cc.

Referenced by blender::gpu::VKDevice::vendor_name().

◆ PCI_ID_APPLE

int32_t blender::gpu::PCI_ID_APPLE = 0x106b
constexpr

Definition at line 408 of file vk_device.cc.

Referenced by blender::gpu::VKDevice::vendor_name().

◆ PCI_ID_ATI

int32_t blender::gpu::PCI_ID_ATI = 0x1022
constexpr

Definition at line 407 of file vk_device.cc.

Referenced by blender::gpu::VKDevice::vendor_name().

◆ PCI_ID_INTEL

int32_t blender::gpu::PCI_ID_INTEL = 0x8086
constexpr

Definition at line 405 of file vk_device.cc.

Referenced by blender::gpu::VKDevice::vendor_name().

◆ PCI_ID_NVIDIA

int32_t blender::gpu::PCI_ID_NVIDIA = 0x10de
constexpr

Definition at line 404 of file vk_device.cc.

Referenced by blender::gpu::VKDevice::vendor_name().

◆ RESTART_INDEX

◆ SHIFT_B

uint8_t blender::gpu::SHIFT_B = 22
constexpr

Definition at line 966 of file vk_data_conversion.cc.

Referenced by convert(), and convert().

◆ SHIFT_G

uint8_t blender::gpu::SHIFT_G = 11
constexpr

Definition at line 967 of file vk_data_conversion.cc.

Referenced by convert(), and convert().

◆ SHIFT_R

uint8_t blender::gpu::SHIFT_R = 0
constexpr

Definition at line 968 of file vk_data_conversion.cc.

Referenced by convert(), and convert().

◆ VISIBILITY_COUNT_PER_BUFFER

const size_t blender::gpu::VISIBILITY_COUNT_PER_BUFFER = 512
static

◆ VISIBILITY_RESULT_SIZE_IN_BYTES

const size_t blender::gpu::VISIBILITY_RESULT_SIZE_IN_BYTES = 8
static

Definition at line 17 of file mtl_query.mm.

Referenced by blender::gpu::MTLQueryPool::begin_query().