Blender V5.3
blender::gpu Namespace Reference

Namespaces

namespace  debug
namespace  GLVertArray
namespace  render_graph
namespace  shader
namespace  tests

Classes

struct  ArgumentStream
struct  AtomicLexer
struct  AttrType
struct  AttrType< StickBoneFlag >
struct  AttrType< VertexClass >
class  B10F_G11G_R11F
class  BindSpaceImages
class  BindSpaceStorageBuffers
class  BindSpaceTextures
class  BindSpaceTopLevelAS
class  BindSpaceUniformBuffers
class  BottomLevelAS
class  BottomLevelASDeleter
struct  CompareMTLBuffer
struct  ComponentValue
class  Context
struct  DebugScope
struct  DebugScopePipelineCreation
 Activate pipeline creation debugging for a certain scope. More...
struct  Depth32fStencil8
class  Directive
class  DummyBackend
class  DummyBatch
class  DummyContext
class  DummyFrameBuffer
class  DummyVertexBuffer
class  Fence
class  FloatingPointFormat
class  FrameBuffer
struct  GeneratedStreams
struct  GenericVertexFormat
struct  GenericVertexFormat< bool >
struct  GenericVertexFormat< int8_t >
struct  GenericVertexFormat< uint8_t >
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  GLTexturePool
class  GLUniformBuf
class  GLVaoCache
class  GLVertBuf
class  GLWorkInFlight
class  GPUBackend
struct  GPUCapabilities
struct  GPULogItem
class  GPULogParser
class  GPUPlatformGlobal
class  GPUSecondaryContext
struct  GPUSecondaryContextData
struct  GPUSource
union  GPUState
union  GPUStateMutable
class  GPUTest
class  GPUWorker
class  HALF4
class  Immediate
class  IndexBuf
class  IndexBufDeleter
struct  InstanceID
class  Line
struct  LogCursor
struct  MTLAccelerationStructureBinding
struct  MTLAttachment
class  MTLBackend
class  MTLBatch
struct  MTLBindingCache
class  MTLBottomLevelAS
struct  MTLBoundShaderState
class  MTLBuffer
struct  MTLBufferBindingCached
struct  MTLBufferHandle
class  MTLBufferPool
struct  MTLBufferRange
struct  MTLCapabilities
class  MTLCircularBuffer
class  MTLCommandBufferManager
struct  MTLComputeCommandEncoder
struct  MTLComputePipelineStateCommon
struct  MTLComputePipelineStateDescriptor
struct  MTLComputePipelineStateInstance
class  MTLComputeState
class  MTLContext
class  MTLContextComputeUtils
struct  MTLContextDepthStencilState
struct  MTLContextGlobalShaderPipelineState
struct  MTLContextTextureUtils
class  MTLFence
struct  MTLFragmentCommandEncoder
class  MTLFrameBuffer
class  MTLImmediate
class  MTLIndexBuf
class  MTLLogParser
class  MTLPixelBuffer
class  MTLPushConstantBuf
class  MTLQueryPool
class  MTLRenderPassState
struct  MTLRenderPipelineStateDescriptor
struct  MTLRenderPipelineStateInstance
class  MTLSafeFreeList
struct  MTLSamplerArray
struct  MTLSamplerBinding
struct  MTLSamplerState
struct  MTLSamplerStateBindingCached
class  MTLScratchBufferManager
class  MTLShader
class  MTLShaderCompiler
class  MTLShaderInterface
class  MTLStateManager
class  MTLStorageBuf
struct  MTLStorageBufferBinding
class  MTLTexture
struct  MTLTextureBinding
struct  MTLTextureBindingCached
class  MTLTexturePool
class  MTLTopLevelAS
class  MTLUniformBuf
struct  MTLUniformBufferBinding
class  MTLVertBuf
struct  MTLVertexAttributeDescriptorPSO
struct  MTLVertexBufferLayoutDescriptorPSO
struct  MTLVertexCommandEncoder
struct  MTLVertexDescriptor
class  MTLWorkInFlight
struct  PatchedShaderCreateInfo
class  PixelBuffer
struct  PixelValue
struct  Preprocessor
class  ProfileReport
struct  PruningStream
class  QueryPool
struct  Separator
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
class  TexturePool
class  TexturePoolBase
class  TexturePoolImpl
class  TimelineResources
struct  TokenPastingBuffer
struct  TokenRange
struct  TokenStream
class  TopLevelAS
class  TopLevelASDeleter
struct  TransferRegion
class  UniformBuf
struct  UnsignedNormalized
class  VertBuf
struct  VertBufBinding
class  VertBufDeleter
struct  VertexBufferID
class  VKBackend
class  VKBatch
class  VKBottomLevelAS
class  VKBuffer
class  VKBufferPool
 A pool of VkBuffers. More...
struct  VKBufferWithOffset
struct  VKComputeInfo
class  VKContext
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
struct  VKGraphicsPipelineCreateInfoBuilder
class  VKImageCache
struct  VKImageInfo
class  VKImageView
struct  VKImageViewInfo
class  VKImmediate
class  VKIndexBuffer
class  VKLogParser
struct  VKMemoryExport
struct  VKMemoryPool
struct  VKMemoryPools
struct  VKMemorySegment
class  VKPipelineMap
class  VKPipelinePool
class  VKPixelBuffer
class  VKPushConstants
class  VKQueryPool
struct  VKRenderGraphSubmitTask
struct  VKRenderGraphWait
struct  VKResourceBinding
struct  VKResourceWithHandle
class  VKSampler
class  VKSamplers
class  VKShader
class  VKShaderCompiler
class  VKShaderInterface
class  VKShaderModule
class  VKStagingBuffer
class  VKStateManager
class  VKStorageBuffer
class  VKStreamingBuffer
struct  VKSubImageRange
class  VKTexture
class  VKTexturePool
class  VKThreadData
class  VKTopLevelAS
class  VKUniformBuffer
class  VKVertexAttributeObject
class  VKVertexAttributeObjectCache
 Cache of VKVertexAttributeObjects keyed by VKShaderInterface. More...
class  VKVertexBuffer
struct  VKVertexInputDescription
 Description of vertex inputs used by graphic pipelines. More...
class  VKVertexInputDescriptionPool
 Pool with all used vertex input descriptions. More...
struct  VKWorkarounds
class  VKWorkInFlight
class  WorkInFlight
class  WorkInFlightDeleter

Typedefs

using IndexBufPtr = std::unique_ptr<IndexBuf, IndexBufDeleter>
using TopLevelASPtr = std::unique_ptr<TopLevelAS, TopLevelASDeleter>
using BottomLevelASPtr = std::unique_ptr<BottomLevelAS, BottomLevelASDeleter>
using VertBufPtr = std::unique_ptr<gpu::VertBuf, gpu::VertBufDeleter>
using WorkInFlightPtr = std::unique_ptr<gpu::WorkInFlight, gpu::WorkInFlightDeleter>
using WorkCallback = void (*)(void *)
using WorkID = uint64_t
using DebugStack = Vector<StringRef>
using GPUPrintFormatMap = Map<uint32_t, shader::PrintfFormat>
using GPUSourceDictionary = Map<StringRef, GPUSource *>
using GPUFunctionDictionary = Map<StringRef, GPUFunction *>
using LexerBase = shader::parser::LexerBase
using NullParser = shader::parser::NullParser
using Sep = Separator
using TimelineValue = uint64_t
using ResourceHandle = uint64_t
using AttributeMask = uint16_t
Memory Management.
using MTLTemporaryBuffer = MTLBufferRange

Enumerations

enum class  ShaderStage : uint8_t { VERTEX = 1 << 0 , FRAGMENT = 1 << 1 , COMPUTE = 2 << 1 , ANY = (ShaderStage::VERTEX | ShaderStage::FRAGMENT | ShaderStage::COMPUTE) }
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  GPUTextureFormatFlag {
  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  GPUTextureType {
  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  GPUSamplerFormat {
  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  MTLInterfaceDataType {
  MTL_DATATYPE_CHAR , MTL_DATATYPE_CHAR2 , MTL_DATATYPE_CHAR3 , MTL_DATATYPE_CHAR4 ,
  MTL_DATATYPE_UCHAR , MTL_DATATYPE_UCHAR2 , MTL_DATATYPE_UCHAR3 , MTL_DATATYPE_UCHAR4 ,
  MTL_DATATYPE_BOOL , MTL_DATATYPE_BOOL2 , MTL_DATATYPE_BOOL3 , MTL_DATATYPE_BOOL4 ,
  MTL_DATATYPE_SHORT , MTL_DATATYPE_SHORT2 , MTL_DATATYPE_SHORT3 , MTL_DATATYPE_SHORT4 ,
  MTL_DATATYPE_USHORT , MTL_DATATYPE_USHORT2 , MTL_DATATYPE_USHORT3 , MTL_DATATYPE_USHORT4 ,
  MTL_DATATYPE_INT , MTL_DATATYPE_INT2 , MTL_DATATYPE_INT3 , MTL_DATATYPE_INT4 ,
  MTL_DATATYPE_UINT , MTL_DATATYPE_UINT2 , MTL_DATATYPE_UINT3 , MTL_DATATYPE_UINT4 ,
  MTL_DATATYPE_FLOAT , MTL_DATATYPE_FLOAT2 , MTL_DATATYPE_FLOAT3 , MTL_DATATYPE_FLOAT4 ,
  MTL_DATATYPE_PACKED_FLOAT2 , MTL_DATATYPE_PACKED_FLOAT3 , MTL_DATATYPE_LONG , MTL_DATATYPE_LONG2 ,
  MTL_DATATYPE_LONG3 , MTL_DATATYPE_LONG4 , MTL_DATATYPE_ULONG , MTL_DATATYPE_ULONG2 ,
  MTL_DATATYPE_ULONG3 , MTL_DATATYPE_ULONG4 , 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_FLOAT2x2 ,
  MTL_DATATYPE_FLOAT2x3 , MTL_DATATYPE_FLOAT2x4 , MTL_DATATYPE_FLOAT3x2 , MTL_DATATYPE_FLOAT3x3 ,
  MTL_DATATYPE_FLOAT3x4 , MTL_DATATYPE_FLOAT4x2 , MTL_DATATYPE_FLOAT4x3 , MTL_DATATYPE_FLOAT4x4 ,
  MTL_DATATYPE_UINT1010102_NORM , MTL_DATATYPE_INT1010102_NORM
}
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_SUBMISSION = 1 << 2 ,
  WAIT_FOR_COMPLETION = 1 << 3
}
enum  VKBindType {
  UNIFORM_BUFFER = 0 , STORAGE_BUFFER , SAMPLER , IMAGE ,
  ACCELERATION_STRUCTURE , INPUT_ATTACHMENT
}
enum class  VKImageViewFlags { DEFAULT = 0 , NO_SWIZZLING = 1 << 0 , FOR_STORAGE_IMAGE = 1 << 1 }
Data Formats
enum class  DataFormat : uint8_t { Invalid = 0 }

Functions

template<typename GPUType>
GPUType convert_normal (const float3 &src)
template<>
int1010102_norm convert_normal (const float3 &src)
template<>
short4 convert_normal (const float3 &src)
template<typename GPUType>
void convert_normals (Span< float3 > src, MutableSpan< GPUType > dst)
 ENUM_OPERATORS (ShaderStage)
GPUSecondaryContextData GPU_create_secondary_context ()
void GPU_activate_secondary_context (const GPUSecondaryContextData &data)
void GPU_deactivate_secondary_context (const GPUSecondaryContextData &data)
void GPU_destroy_secondary_context (GPUSecondaryContextData &data)
void imm_draw_circle_partial_wire_aspect_2d (uint pos, float x, float y, float2 radius, int nsegments, float start, float sweep)
void imm_draw_circle_partial_wire_aspect_3d (uint pos, float x, float y, float z, float2 radius, int nsegments, float start, float sweep)
void imm_draw_rounded_box_wire_2d (uint pos, float x, float y, float2 radius, float2 corner_radius, int nsegments)
void imm_draw_rounded_box_wire_3d (uint pos, float x, float y, float2 radius, float2 corner_radius, int nsegments)
size_t to_bytesize (GPUIndexBufType type)
int indices_per_primitive (GPUPrimType prim_type)
constexpr DataFormat to_data_format (VertAttrType format)
static GHOST_TDrawingContextType ghost_context_type ()
static GPUContext * wrap (Context *ctx)
static Context * unwrap (GPUContext *ctx)
static const Context * unwrap (const GPUContext *ctx)
void debug_validate_binding_image_format ()
static void imm_draw_circle_partial_aspect (const GPUPrimType prim_type, const uint pos, const float x, const float y, const float2 radius, const int nsegments, const float start, const float sweep)
static void imm_draw_circle_partial_aspect_3d (const GPUPrimType prim_type, const uint pos, const float x, const float y, const float z, const float2 radius, const int nsegments, const float start, const float sweep)
static char * create_key (GPUSupportLevel 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)
 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 *fence)
static Fence * unwrap (GPUFence *fence)
static const Fence * unwrap (const GPUFence *fence)
static Shader * get_update_mipmap_shader (TextureFormat texture_format, bool is_layered)
static void update_mipmaps_layers (Texture &texture, Shader &shader, const IndexRange layers, const TextureFormat view_format, const BitSpan modified_chunks)
static void update_mipmaps (Texture &texture, Shader &shader, const TextureFormat write_format, const int partial_layer, const BitSpan modified_chunks)
bool is_half_float (TextureFormat format)
bool is_half_integer (TextureFormat format)
static GPUPixelBuffer * wrap (PixelBuffer *pixbuf)
static PixelBuffer * unwrap (GPUPixelBuffer *pixbuf)
static const PixelBuffer * unwrap (const GPUPixelBuffer *pixbuf)
size_t to_bytesize (TextureFormat format)
size_t to_block_size (TextureFormat data_type)
GPUTextureFormatFlag to_format_flag (TextureFormat format)
int to_component_len (TextureFormat format)
size_t to_bytesize (eGPUDataFormat data_format)
size_t to_bytesize (TextureFormat tex_format, eGPUDataFormat data_format)
constexpr bool validate_data_format (TextureFormat tex_format, eGPUDataFormat data_format)
eGPUDataFormat to_texture_data_format (TextureFormat tex_format)
GPUFrameBufferBits to_framebuffer_bits (TextureFormat tex_format)
static TextureFormat to_texture_format (const GPUVertFormat *format)
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_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< int1010102_norm > dst)
template<>
void convert_normals (const Span< float3 > src, MutableSpan< short4 > dst)
 ENUM_OPERATORS (MTLPipelineStateDirtyFlag)
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 size_t padded_size (const shader::ShaderCreateInfo::PushConst &push_constant, size_t &alignment)
static MTLVisibilityResultMode to_mtl_type (GPUQueryType type)
static MTLPackedFloat4x3 pack_transform (const float4x4 &m)
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 format)
bool mtl_format_is_normalized (MTLVertexFormat format)
const char * to_string (ShaderStage stage)
std::string shader_stage_define (const ShaderStage stage)
static bool is_builtin_type (StringRefNull type)
static StringRefNull to_raw_type (ImageType type)
StringRefNull to_wrapper_type (ImageType type)
static StringRefNull to_component_type (ImageType type)
static const char * get_stage_class_name (ShaderStage stage)
static const char * get_stage_out_class_name (ShaderStage stage, const ShaderCreateInfo &info)
static const char * get_stage_in_class_name (ShaderStage stage)
static const char * get_stage_out_instance_name (ShaderStage stage)
static const char * get_stage_in_instance_name (ShaderStage stage)
static const char * get_stage_instance_name (ShaderStage stage)
static const char * get_stage_type (ShaderStage stage)
static std::string to_string (shader::Type type, SpecializationConstant::Value value)
static const char * to_string (const Interpolation &interp)
std::string wrap_type (StringRefNull type_name, const ShaderStage stage)
std::string ref_type (const ResourceString &str, const std::string &attribute="")
std::string ptr_type (const ResourceString &str)
static void generate_uniforms (GeneratedStreams &generated, Span< ShaderCreateInfo::PushConst > uniforms, const ShaderStage stage)
static void generate_buffer (GeneratedStreams &generated, const bool writeable, std::string type, ResourceString name, int slot, const ShaderStage stage)
StringRefNull to_access (const bool is_sampler, const shader::Qualifier qualifier)
static void generate_texture (GeneratedStreams &generated, bool is_sampler, shader::Qualifier qualifier, const shader::ImageType type, ResourceString name, int slot, const ShaderStage stage, const bool use_sampler_argument_buffer=false)
static void generate_acceleration_structure (GeneratedStreams &generated, StringRefNull name, int slot)
static void generate_resource (GeneratedStreams &generated, const ShaderCreateInfo::Resource &res, const ShaderStage stage, const ShaderCreateInfo &, const bool use_sampler_argument_buffer)
static void generate_compilation_constant (GeneratedStreams &generated, const CompilationConstant &constant)
static void generate_specialization_constant (GeneratedStreams &generated, const SpecializationConstant &constant, int index)
static void generate_shared_variable (GeneratedStreams &generated, const ShaderCreateInfo::SharedVariable &sv)
static void generate_sampler_argument_buffer (GeneratedStreams &generated, int sampler_count)
void generate_resources (GeneratedStreams &generated, const ShaderStage stage, const ShaderCreateInfo &info)
static void generate_vertex_attributes (GeneratedStreams &generated, const ShaderCreateInfo &info)
static void generate_raster_builtin (GeneratedStreams &ss, std::stringstream &declaration, const StringRefNull type, const StringRefNull var, const StringRefNull attribute, const StringRefNull array="", const bool is_const=false)
static std::string generate_raster_builtins (GeneratedStreams &ss, const ShaderCreateInfo &info, const ShaderStage stage)
static void generate_inout (std::stringstream &out, StringRefNull iface_name, const StageInterfaceInfo::InOut &inout)
static void generate_vertex_out (GeneratedStreams &generated, const ShaderCreateInfo &info, const ShaderStage stage)
static void generate_fragment_builtin (GeneratedStreams &ss, std::stringstream &declaration, const StringRefNull type, const StringRefNull var, const StringRefNull native_type, const StringRefNull attribute, const bool is_const=false)
static std::string generate_fragment_builtins (GeneratedStreams &ss, const ShaderCreateInfo &info)
static void generate_subpass_inputs (GeneratedStreams &generated, const ShaderCreateInfo &info)
static void generate_fragment_out (GeneratedStreams &generated, const ShaderCreateInfo &info)
static void generate_vertex_interface (GeneratedStreams &generated, const ShaderCreateInfo &info)
static void generate_fragment_interface (GeneratedStreams &generated, const ShaderCreateInfo &info)
static void generate_stage_interfaces (GeneratedStreams &generated, const ShaderStage stage, const ShaderCreateInfo &info)
static void generate_builtin (GeneratedStreams &ss, const StringRefNull wrapper_type, const StringRefNull wrapper_var, const StringRefNull native_type, const StringRefNull native_var)
static void generate_builtin (GeneratedStreams &generated, const StringRefNull wrapper_type, const StringRefNull wrapper_var, const StringRefNull native_var)
static void generate_instance_id (GeneratedStreams &ss)
static void generate_builtins (GeneratedStreams &ss, const ShaderStage stage, const ShaderCreateInfo &info)
std::pair< std::string, std::string > generate_entry_point (const ShaderCreateInfo &info, const ShaderStage stage, const StringRefNull entry_point_name)
uint32_t available_buffer_slots (const ShaderCreateInfo &info)
void patch_create_info_atomic_workaround (std::unique_ptr< PatchedShaderCreateInfo > &patched_info, const shader::ShaderCreateInfo &original_info)
uint mtl_get_data_type_size (MTLInterfaceDataType type)
MTLInterfaceDataType to_mtl_type (shader::Type type)
uint mtl_get_data_type_alignment (MTLInterfaceDataType type)
MTLInterfaceDataType gpu_type_to_mtl_type (GPUType 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 (GPUTextureType type)
bool mtl_format_is_writable (MTLPixelFormat format)
MTLPixelFormat mtl_format_get_writeable_view_format (MTLPixelFormat format)
MTLTextureUsage mtl_usage_from_gpu (eGPUTextureUsage usage)
eGPUTextureUsage gpu_usage_from_mtl (MTLTextureUsage mtl_usage)
BLI_INLINE MTLTexture * unwrap (Texture *tex)
BLI_INLINE Texture * wrap (MTLTexture *texture)
static bool check_texture_format_compatability (TextureFormat src_format, TextureFormat dst_format)
MTLVertexFormat gpu_vertex_format_to_metal (VertAttrType vert_format)
MTLVertexFormat gpu_type_to_metal_vertex_format (shader::Type type)
static GLenum to_gl (GPUIndexBufType type)
static GLenum to_gl (GPUPrimType prim_type)
static GLenum to_gl (GPUQueryType type)
static GLbitfield to_gl (GPUBarrier barrier_bits)
GLenum to_gl_internal_format (TextureFormat format)
GLenum to_gl_target (GPUTextureType type)
GLenum to_gl_proxy (GPUTextureType type)
GLenum swizzle_to_gl (const char swizzle)
GLenum to_gl (eGPUDataFormat format)
GLenum to_gl_data_format (TextureFormat format)
GLenum channel_len_to_gl (int channel_len)
BLI_INLINE Texture * wrap (GLTexture *texture)
static TextureFormat get_compatible_texture_format (TextureFormat format)
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< StringRefNull > missing_capabilities_get (VkPhysicalDevice vk_physical_device)
static void vk_restrict_loader_layers ()
static bool vk_instance_create_for_platform_checks (VkInstance *r_instance)
static GPUOSType determine_os_type ()
static void init_device_list (GHOST_IContext *ghost_context)
VKBatch * unwrap (Batch *batch)
VkImageAspectFlags to_vk_image_aspect_flag_bits (const TextureFormat format)
VkImageAspectFlags to_vk_image_aspect_flag_bits (const GPUFrameBufferBits buffers)
TextureFormat to_gpu_format (const VkFormat format)
std::string to_gpu_format_string (VkFormat format)
VkFormat to_vk_format (const TextureFormat format)
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 GPUTextureType type)
VkImageViewType to_vk_image_view_type (const GPUTextureType type, const eImageViewUsage view_type, VKImageViewArrayed arrayed)
VkComponentSwizzle to_vk_component_swizzle (const char swizzle)
VkClearColorValue to_vk_clear_color_value (const eGPUDataFormat format, const double4 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 GPUFaceCullTest 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)
bool vk_need_extended_usage_for_storage_image (const eGPUTextureUsage usage, const GPUTextureFormatFlag format_flag)
VkFormat vk_extended_usage_storage_image_format (const VkFormat format)
VkImageCreateFlags to_vk_image_create (const GPUTextureType texture_type, const GPUTextureFormatFlag format_flag, eGPUTextureUsage usage)
VkImageUsageFlags to_vk_image_usage (const eGPUTextureUsage usage, const GPUTextureFormatFlag format_flag, bool use_image_host_copy)
BLI_INLINE VkFormat to_vk_format (const TextureTargetFormat format)
template<typename T>
VkObjectType to_vk_object_type (T)
 ENUM_OPERATORS (RenderGraphFlushFlags)
BLI_INLINE bool operator== (const VKContext &a, const VKContext &b)
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, TextureFormat device_format)
template<typename DestinationType, typename SourceType>
void convert_per_pixel (void *dst_memory, const void *src_memory, size_t buffer_size)
template<typename ComponentType>
void remap_components_3to4_front_to_back (MutableSpan< ComponentType > components, int64_t size, ComponentType component_4_value)
 Inline remapping from 3 components to 4 components where the data is stored at the end of the buffer.
static void convert_buffer (void *dst_memory, const void *src_memory, size_t buffer_size, TextureFormat device_format, ConversionType type)
constexpr GPULoadStore default_load_store ()
static VKFrameBuffer * unwrap (gpu::FrameBuffer *framebuffer)
const char * to_string (VkResult result)
static VkDeviceSize new_buffer_size (VkDeviceSize sub_buffer_size)
static VKIndexBuffer * unwrap (IndexBuf *index_buffer)
static VKIndexBuffer & unwrap (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)
constexpr VkExternalMemoryHandleTypeFlags vk_external_memory_handle_type ()
static VKPixelBuffer * unwrap (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 const VKTopLevelAS & unwrap (const TopLevelAS &blas)
static const VKBottomLevelAS & unwrap (const BottomLevelAS &blas)
std::ostream & operator<< (std::ostream &os, const VKDiscardPool &discard_pool)
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 StageInterfaceInfo * find_interface_by_name (const Span< ShaderCreateInfo::StageInterfaceInfoHandle > ifaces, const StringRefNull name)
static void declare_emit_vertex (std::stringstream &ss)
static VKShader & unwrap (Shader &shader)
static VKShader * unwrap (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 VKStorageBuffer * unwrap (StorageBuf *storage_buffer)
static VkImageAspectFlags to_vk_image_aspect_single_bit (const VkImageAspectFlags format, bool stencil)
static float memory_priority (const eGPUTextureUsage texture_usage)
BLI_INLINE Texture * wrap (VKTexture *texture)
static VKResourceWithHandle< VkImage > create_and_bind_vk_image (const VKImageInfo &info, const std::string &name_str)
VkMemoryRequirements get_image_memory_requirements (const VkImageCreateInfo &image_info)
static std::string to_string_handle (uint64_t vk_handle)
std::string to_string (VkBuffer 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 UniformBuf * wrap (VKUniformBuffer *uniform_buffer)
BLI_INLINE VKVertexBuffer * unwrap (VertBuf *vertex_buffer)
BLI_INLINE VKVertexBuffer & unwrap (VertBuf &vertex_buffer)
Utilities

Allow querying information about the format enum values.

int to_bytesize (const DataFormat format)
int format_component_len (const DataFormat format)
ShaderCompiler
static ThreadQueueWorkPriority to_work_priority (CompilationPriority priority)
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 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)
XR blitting function called from the GHOST Metal XR binding.
void xr_blit (id< MTLTexture > metal_xr_texture, int ofsx, int ofsy, int width, int height)
Global Context State
static void bind_atomic_workaround_buffer (StringRefNull texture_name, MTLTexture *gpu_tex, MTLShaderInterface &shader_interface, MTLShader &active_shader)
template<typename CommandEncoderT>
static void bind_sampler_argument_buffer (CommandEncoderT enc, MTLSamplerArray &sampler_array, Map< MTLSamplerArray, gpu::MTLBuffer * > &sampler_buffers_cache, MTLShaderInterface &shader_interface, id< MTLFunction > mtl_function, MTLBindingCache< CommandEncoderT > &bindings)
template<typename CommandEncoderT>
static void ensure_texture_bindings (MTLContext &ctx, MTLShader &shader, CommandEncoderT enc, MTLBindingCache< CommandEncoderT > &bindings, id< MTLFunction > mtl_function, uint16_t stage_ima_mask=uint16_t(-1), uint64_t stage_tex_mask=uint64_t(-1))
template<typename CommandEncoderT>
static void ensure_push_constant (MTLContext &ctx, MTLShader &shader, CommandEncoderT enc, MTLBindingCache< CommandEncoderT > &bindings, uint32_t stage_buf_mask=uint32_t(-1))
template<typename CommandEncoderT>
static void ensure_buffer_bindings (MTLContext &ctx, MTLShader &shader, CommandEncoderT enc, MTLBindingCache< CommandEncoderT > &bindings, uint32_t stage_buf_mask=uint32_t(-1))
Texture State Management
static MTLSamplerAddressMode to_mtl_type (GPUSamplerExtendMode wrap_mode)
METAL API Resources and Validation
MTLLoadAction mtl_load_action_from_gpu (GPULoadOp action)
MTLStoreAction mtl_store_action_from_gpu (GPUStoreOp 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 stage creation.
::MTLCompileOptions * get_compile_options (const bool use_subpass_input, const bool use_texture_atomic, const bool use_ray_query)
Shader specialization common utilities.
::MTLFunctionConstantValues * populate_specialization_constant_values (const shader::SpecializationConstants &shader_constants, const SpecializationStateDescriptor &specialization_descriptor)
Bake Pipeline State Objects
static uint32_t get_buffers_binding_mask (NSArray< MTLArgument * > *args)
static uint16_t get_images_binding_mask (NSArray< MTLArgument * > *args)
static uint64_t get_samplers_binding_mask (NSArray< MTLArgument * > *args)
State setting functions
static MTLCompareFunction gpu_depth_function_to_metal (GPUDepthTest depth_func)
static MTLCompareFunction gpu_stencil_func_to_metal (GPUStencilTest stencil_func)
static void mtl_stencil_set_op_separate (MTLContext *context, GPUFaceCullTest 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 (TextureFormat 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 format)
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 &format, 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 GPUFrameBufferBits 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 *format, uint v_first, uint v_len, const bool use_instancing)
API
bool needs_conversion (eGPUDataFormat host_format, TextureFormat host_texture_format, TextureFormat device_format)
 Check if data conversion is needed when uploading host_format to a device_format.
void convert_host_to_device (void *dst_buffer, const void *src_buffer, size_t buffer_size, eGPUDataFormat host_format, TextureFormat host_texture_format, TextureFormat device_format)
void convert_device_to_host (void *dst_buffer, const void *src_buffer, size_t buffer_size, eGPUDataFormat host_format, TextureFormat host_texture_format, TextureFormat device_format)
Load/Store operations
static VkAttachmentLoadOp to_vk_attachment_load_op (GPULoadOp load_op)
static VkAttachmentStoreOp to_vk_attachment_store_op (GPUStoreOp store_op)
static void set_load_store (VkRenderingAttachmentInfo &r_rendering_attachment, eGPUDataFormat data_format, 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)
Graphics pipelines
static VkPipeline create_graphics_pipeline_no_libs (const VKGraphicsInfo &graphics_info, VkPipelineCache vk_pipeline_cache, VkPipeline vk_pipeline_base, StringRefNull name)
static VkPipeline create_graphics_pipeline_libs (const VKGraphicsInfo &graphics_info, VkPipelineCache vk_pipeline_cache, VkPipeline vk_pipeline_base, StringRefNull name)
Create Info
static const char * to_string (const Interpolation &interp)
static const char * to_string (const Type &type)
static const char * to_string (const TextureFormat &type)
static const char * to_string (const PrimitiveIn &layout)
static const char * to_string (const PrimitiveOut &layout)
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, const ShaderCreateInfo &)
static void print_resource (std::ostream &os, const VKShaderInterface &shader_interface, const ShaderCreateInfo::Resource &res, const ShaderCreateInfo &info)
static void print_resource (std::ostream &os, const VKShaderInterface &shader_interface, const ShaderCreateInfo::Resource &res, const ShaderCreateInfo &info, StringRefNull res_frequency, StringRefNull &active_info_name)
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, const StringRefNull &suffix)
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="")
SPIR-V disk cache
static uint32_t spirv_target_version_get ()
static bool read_spirv_from_disk (VKShaderModule &shader_module, StringRef hash_extra)
static void write_spirv_to_disk (VKShaderModule &shader_module)
Compilation
static StringRef to_stage_name (shaderc_shader_kind stage)
static void spirv_inject_op_string (const Span< uint32_t > &spirv_in, Vector< uint32_t > &spirv_out, StringRef name, uint32_t glsl_version)
static std::string patch_line_directives (std::string source)
static bool compile_ex (shaderc::Compiler &compiler, VKShader &shader, shaderc_shader_kind stage, VKShaderModule &shader_module)

Variables

constexpr uint32_t RESTART_INDEX = 0xFFFFFFFF
GPUCapabilities GCaps = {}
static CLG_LogRef LOG = {"gpu.framebuffer"}
GPUPlatformGlobal GPG
static CLG_LogRef LOG = {"gpu.metal"}
NSAutoreleasePool * g_autoreleasepool = nil
int g_autoreleasepool_depth = 0
static CLG_LogRef LOG = {"gpu.metal"}
static CLG_LogRef LOG = {"gpu.metal"}
static CLG_LogRef LOG = {"gpu.metal"}
static CLG_LogRef LOG = {"gpu.metal"}
static CLG_LogRef LOG = {"gpu.metal"}
static const size_t VISIBILITY_COUNT_PER_BUFFER = 512
static const size_t VISIBILITY_RESULT_SIZE_IN_BYTES = 8
static CLG_LogRef LOG = {"gpu.metal"}
static CLG_LogRef LOG = {"gpu.metal"}
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.metal"}
static CLG_LogRef LOG = {"gpu.metal"}
static CLG_LogRef LOG = {"gpu.opengl"}
constexpr uint16_t HALF_VALUE_1 = 0x3c00
static CLG_LogRef LOG = {"gpu.vulkan"}
static CLG_LogRef LOG = {"gpu.vulkan"}
constexpr size_t DEFAULT_INTERNAL_BUFFER_SIZE = 4 * 1024 * 1024
static CLG_LogRef LOG = {"gpu.vulkan"}
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 format)
constexpr TextureFormat to_texture_format (TextureTargetFormat format)
constexpr TextureFormat to_texture_format (TextureWriteFormat format)

Type-safe identifier management.

enum class  DirectiveType : char {
  Define = TokenType::Define , Undef = TokenType::Undef , Line = TokenType::Line , If = TokenType::If ,
  Ifdef = TokenType::Ifdef , Ifndef = TokenType::Ifndef , Elif = TokenType::Elif , Else = TokenType::Else ,
  Endif = TokenType::Endif , Pragma = TokenType::Pragma , Other = TokenType::Word
}
static DirectiveType increment_to_next_conditional (Directive &dir)
static Directive find_next_matching_conditional (Directive dir)
PruningStream & operator<< (PruningStream &dst, const TokenStream &src)
PruningStream & operator<< (PruningStream &dst, const TokenRange< Token > &range)
PruningStream & operator<< (PruningStream &dst, const Token &tok)

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_B10F_G11F_R11F , B10F_G11F_R11F_TO_FLOAT , FLOAT3_TO_HALF4 , HALF4_TO_FLOAT3 ,
  FLOAT3_TO_FLOAT4 , FLOAT4_TO_FLOAT3 , UINT_TO_DEPTH32F_STENCIL8 , DEPTH32F_STENCIL8_TO_UINT ,
  UNSUPPORTED
}
static ConversionType type_of_conversion_float (const TextureFormat host_format, const TextureFormat device_format)
static ConversionType type_of_conversion_int (TextureFormat device_format)
static ConversionType type_of_conversion_uint (TextureFormat device_format)
static ConversionType type_of_conversion_half (TextureFormat device_format)
static ConversionType type_of_conversion_ubyte (TextureFormat device_format)
static ConversionType type_of_conversion_uint248 (const TextureFormat device_format)
static ConversionType type_of_conversion_r11g11b10 (TextureFormat device_format)
static ConversionType type_of_conversion_r10g10b10a2 (TextureFormat device_format)
static ConversionType host_to_device (const eGPUDataFormat host_format, const TextureFormat host_texture_format, const TextureFormat 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 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 (FLOAT3 &dst, const HALF4 &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)

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

This file contains API that the GHOST_ContextVK can invoke directly.

Typedef Documentation

◆ AttributeMask

◆ BottomLevelASPtr

Definition at line 105 of file GPU_ray_tracing.hh.

◆ DebugStack

Definition at line 18 of file gpu_debug_private.hh.

◆ F16

Definition at line 718 of file vk_data_conversion.cc.

◆ F32

Definition at line 719 of file vk_data_conversion.cc.

◆ FLOAT3

Definition at line 720 of file vk_data_conversion.cc.

◆ FLOAT4

◆ FormatF10

Definition at line 151 of file vk_data_conversion.hh.

◆ FormatF11

Definition at line 150 of file vk_data_conversion.hh.

◆ FormatF32

Definition at line 149 of file vk_data_conversion.hh.

◆ GPUFunctionDictionary

◆ GPUPrintFormatMap

◆ GPUSourceDictionary

◆ I16

Definition at line 716 of file vk_data_conversion.cc.

◆ I32

Definition at line 717 of file vk_data_conversion.cc.

◆ I8

Definition at line 715 of file vk_data_conversion.cc.

◆ IndexBufPtr

Definition at line 321 of file GPU_index_buffer.hh.

◆ LexerBase

◆ MTLTemporaryBuffer

◆ NullParser

◆ ResourceHandle

Definition at line 68 of file vk_common.hh.

◆ Sep

Definition at line 54 of file mtl_shader_generate.cc.

◆ TimelineValue

Definition at line 39 of file vk_common.hh.

◆ TopLevelASPtr

Definition at line 104 of file GPU_ray_tracing.hh.

◆ UI16

Definition at line 713 of file vk_data_conversion.cc.

◆ UI32

Definition at line 714 of file vk_data_conversion.cc.

◆ UI8

Definition at line 712 of file vk_data_conversion.cc.

◆ VertBufPtr

Definition at line 86 of file GPU_vertex_buffer.hh.

◆ WorkCallback

using blender::gpu::WorkCallback = void (*)(void *)

Definition at line 24 of file GPU_worker.hh.

◆ WorkID

Definition at line 25 of file GPU_worker.hh.

◆ WorkInFlightPtr

Enumeration Type Documentation

◆ AppleGPUType

Enumerator
APPLE_GPU_UNKNOWN 
APPLE_GPU_M1 
APPLE_GPU_M2 
APPLE_GPU_M3 

Definition at line 36 of file mtl_capabilities.hh.

◆ ConversionType

enum class blender::gpu::ConversionType
strong
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_B10F_G11F_R11F 
B10F_G11F_R11F_TO_FLOAT 
FLOAT3_TO_HALF4 
HALF4_TO_FLOAT3 
FLOAT3_TO_FLOAT4 
FLOAT4_TO_FLOAT3 
UINT_TO_DEPTH32F_STENCIL8 
DEPTH32F_STENCIL8_TO_UINT 
UNSUPPORTED 

The requested conversion isn't supported.

Definition at line 23 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 128 of file GPU_format.hh.

◆ DirectiveType

enum class blender::gpu::DirectiveType : char
strong
Enumerator
Define 
Undef 
Line 
If 
Ifdef 
Ifndef 
Elif 
Else 
Endif 
Pragma 
Other 

Definition at line 313 of file gpu_shader_preprocessor.cc.

◆ eImageViewUsage

enum class blender::gpu::eImageViewUsage
strong

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 48 of file vk_common.hh.

◆ GPUIndexBufType

Enumerator
GPU_INDEX_U16 
GPU_INDEX_U32 

Definition at line 26 of file GPU_index_buffer.hh.

◆ GPUQueryType

Enumerator
GPU_QUERY_OCCLUSION 

Definition at line 17 of file gpu_query.hh.

◆ GPUSamplerFormat

Enumerator
GPU_SAMPLER_TYPE_FLOAT 
GPU_SAMPLER_TYPE_INT 
GPU_SAMPLER_TYPE_UINT 
GPU_SAMPLER_TYPE_DEPTH 
GPU_SAMPLER_TYPE_MAX 

Definition at line 87 of file gpu_texture_private.hh.

◆ GPUTextureFormatFlag

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 47 of file gpu_texture_private.hh.

◆ GPUTextureType

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 70 of file gpu_texture_private.hh.

◆ MTLInterfaceDataType

Enumerator
MTL_DATATYPE_CHAR 
MTL_DATATYPE_CHAR2 
MTL_DATATYPE_CHAR3 
MTL_DATATYPE_CHAR4 
MTL_DATATYPE_UCHAR 
MTL_DATATYPE_UCHAR2 
MTL_DATATYPE_UCHAR3 
MTL_DATATYPE_UCHAR4 
MTL_DATATYPE_BOOL 
MTL_DATATYPE_BOOL2 
MTL_DATATYPE_BOOL3 
MTL_DATATYPE_BOOL4 
MTL_DATATYPE_SHORT 
MTL_DATATYPE_SHORT2 
MTL_DATATYPE_SHORT3 
MTL_DATATYPE_SHORT4 
MTL_DATATYPE_USHORT 
MTL_DATATYPE_USHORT2 
MTL_DATATYPE_USHORT3 
MTL_DATATYPE_USHORT4 
MTL_DATATYPE_INT 
MTL_DATATYPE_INT2 
MTL_DATATYPE_INT3 
MTL_DATATYPE_INT4 
MTL_DATATYPE_UINT 
MTL_DATATYPE_UINT2 
MTL_DATATYPE_UINT3 
MTL_DATATYPE_UINT4 
MTL_DATATYPE_FLOAT 
MTL_DATATYPE_FLOAT2 
MTL_DATATYPE_FLOAT3 
MTL_DATATYPE_FLOAT4 
MTL_DATATYPE_PACKED_FLOAT2 
MTL_DATATYPE_PACKED_FLOAT3 
MTL_DATATYPE_LONG 
MTL_DATATYPE_LONG2 
MTL_DATATYPE_LONG3 
MTL_DATATYPE_LONG4 
MTL_DATATYPE_ULONG 
MTL_DATATYPE_ULONG2 
MTL_DATATYPE_ULONG3 
MTL_DATATYPE_ULONG4 
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_FLOAT2x2 
MTL_DATATYPE_FLOAT2x3 
MTL_DATATYPE_FLOAT2x4 
MTL_DATATYPE_FLOAT3x2 
MTL_DATATYPE_FLOAT3x3 
MTL_DATATYPE_FLOAT3x4 
MTL_DATATYPE_FLOAT4x2 
MTL_DATATYPE_FLOAT4x3 
MTL_DATATYPE_FLOAT4x4 
MTL_DATATYPE_UINT1010102_NORM 
MTL_DATATYPE_INT1010102_NORM 

Definition at line 15 of file mtl_shader_interface_type.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 343 of file mtl_context.hh.

◆ RenderGraphFlushFlags

Enumerator
NONE 
RENEW_RENDER_GRAPH 
SUBMIT 
WAIT_FOR_SUBMISSION 
WAIT_FOR_COMPLETION 

Definition at line 33 of file vk_context.hh.

◆ Severity

enum class blender::gpu::Severity
strong
Enumerator
Unknown 
Warning 
Error 
Note 

Definition at line 245 of file gpu_shader_private.hh.

◆ ShaderStage

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

Definition at line 82 of file GPU_common_types.hh.

◆ TextureFormat

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

Formats compatible with read-only texture.

Enumerator
Invalid 

Definition at line 41 of file GPU_texture.hh.

◆ TextureTargetFormat

Formats compatible with frame-buffer attachments.

Enumerator
Invalid 

Definition at line 140 of file GPU_texture.hh.

◆ TextureWriteFormat

Formats compatible with shader load/store.

Enumerator
Invalid 

Definition at line 211 of file GPU_texture.hh.

◆ VertAttrType

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

Definition at line 25 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 
ACCELERATION_STRUCTURE 
INPUT_ATTACHMENT 

Definition at line 34 of file vk_shader_interface.hh.

◆ VKImageViewArrayed

Enumerator
DONT_CARE 
NOT_ARRAYED 
ARRAYED 

Definition at line 55 of file vk_common.hh.

◆ VKImageViewFlags

enum class blender::gpu::VKImageViewFlags
strong

Additional modifiers when requesting image views.

Enumerator
DEFAULT 
NO_SWIZZLING 
FOR_STORAGE_IMAGE 

Definition at line 27 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 82 of file vk_memory_layout.hh.

References blender::ceil_to_multiple_ul().

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 114 of file vk_memory_layout.hh.

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

◆ array_stride()

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

Definition at line 67 of file vk_memory_layout.hh.

References array_stride().

Referenced by array_stride(), and reserve().

◆ available_buffer_slots()

◆ bind_atomic_workaround_buffer()

◆ bind_sampler_argument_buffer()

◆ 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()

◆ 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 358 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().

◆ check_texture_format_compatability()

bool blender::gpu::check_texture_format_compatability ( TextureFormat src_format,
TextureFormat dst_format )
static

◆ combine_sources()

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

Definition at line 500 of file vk_shader.cc.

References combine_sources().

Referenced by combine_sources().

◆ compile_ex()

◆ convert() [1/17]

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

◆ convert() [2/17]

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

◆ convert() [3/17]

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

Definition at line 850 of file vk_data_conversion.cc.

References convert().

◆ convert() [4/17]

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

◆ convert() [5/17]

◆ convert() [6/17]

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

◆ convert() [7/17]

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

◆ convert() [8/17]

◆ convert() [9/17]

◆ convert() [10/17]

◆ convert() [11/17]

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

◆ convert() [12/17]

◆ convert() [13/17]

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

◆ convert() [14/17]

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

◆ convert() [15/17]

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

◆ convert() [16/17]

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

Definition at line 837 of file vk_data_conversion.cc.

References BLI_assert_unreachable, and convert().

◆ convert() [17/17]

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,
TextureFormat host_texture_format,
TextureFormat 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 1200 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 180 of file vk_data_conversion.hh.

References convert_float_formats(), is_zero(), and blender::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,
TextureFormat host_texture_format,
TextureFormat 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 1188 of file vk_data_conversion.cc.

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

Referenced by 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 26 of file GPU_attribute_convert.hh.

References convert_normal().

◆ convert_normal() [2/3]

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

Definition at line 21 of file GPU_attribute_convert.hh.

References convert_normal().

◆ convert_normal() [3/3]

◆ convert_normals() [1/3]

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

Definition at line 27 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 31 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,
TextureFormat 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 )

◆ create_and_bind_vk_image()

◆ create_gpu_name()

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

◆ create_graphics_pipeline_libs()

◆ create_graphics_pipeline_no_libs()

◆ create_key()

◆ debug_validate_binding_image_format()

◆ 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 blender::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_workarounds()

void blender::gpu::detect_workarounds ( )
static

Definition at line 415 of file gl_backend.cc.

References blender::BLI_windows_get_directx_driver_version(), blender::BLI_windows_get_directx_intel_driver_info(), blender::gpu::GLContext::debug_layer_support, blender::gpu::GLContext::debug_layer_workaround, blender::gpu::GPUCapabilities::depth_blitting_workaround, blender::gpu::GLContext::derivative_control_support, detect_workarounds(), blender::gpu::GLContext::direct_state_access_support, blender::gpu::GLContext::framebuffer_fetch_support, blender::gpu::GPUCapabilities::frontbuffer_read_workaround, blender::G, blender::G_DEBUG_GPU_FORCE_WORKAROUNDS, blender::G_DEBUG_GPU_NO_TEXTURE_POOL, GCaps, blender::Gen12, blender::Gen9AndOlder, blender::GPU_DEVICE_ATI, blender::GPU_DEVICE_INTEL, blender::GPU_DEVICE_INTEL_UHD, blender::GPU_DEVICE_QUALCOMM, blender::GPU_DRIVER_ANY, blender::GPU_DRIVER_OFFICIAL, blender::GPU_DRIVER_OPENSOURCE, blender::GPU_OS_ANY, blender::GPU_OS_UNIX, blender::GPU_OS_WIN, blender::GPU_platform_get_intel_arch(), blender::GPU_type_matches(), blender::gpu::GPUCapabilities::hdr_viewport_support, is_bad_AMD_driver(), L, blender::gpu::GLContext::layered_rendering_support, match_renderer(), blender::gpu::GPUCapabilities::minimum_per_vertex_stride, blender::gpu::GLContext::multi_bind_image_support, blender::gpu::GLContext::multi_bind_support, blender::gpu::GLContext::native_barycentric_support, blender::gpu::shader::metadata::printf, blender::gpu::GPUCapabilities::srgb_write_view_support, blender::gpu::GPUCapabilities::stencil_classify_buffer_workaround, blender::gpu::GPUCapabilities::stencil_export_support, blender::gpu::GLContext::texture_barrier_support, blender::gpu::GLContext::texture_filter_anisotropic_support, blender::gpu::GPUCapabilities::texture_pool_workaround, blender::gpu::GLContext::unused_fb_slot_workaround, blender::gpu::GPUCapabilities::use_hq_normals_workaround, blender::gpu::GPUCapabilities::use_main_context_workaround, blender::gpu::GLContext::vertex_shader_layer_support, and blender::gpu::GLContext::vertex_shader_viewport_index_support.

Referenced by detect_workarounds().

◆ determine_os_type()

GPUOSType 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 62 of file vk_memory_layout.hh.

References element_stride().

Referenced by element_stride(), and reserve().

◆ ensure_buffer_bindings()

template<typename CommandEncoderT>
void blender::gpu::ensure_buffer_bindings ( MTLContext & ctx,
MTLShader & shader,
CommandEncoderT enc,
MTLBindingCache< CommandEncoderT > & bindings,
uint32_t stage_buf_mask = uint32_t(-1) )
static

◆ ensure_push_constant()

◆ ensure_texture_bindings()

template<typename CommandEncoderT>
void blender::gpu::ensure_texture_bindings ( MTLContext & ctx,
MTLShader & shader,
CommandEncoderT enc,
MTLBindingCache< CommandEncoderT > & bindings,
id< MTLFunction > mtl_function,
uint16_t stage_ima_mask = uint16_t(-1),
uint64_t stage_tex_mask = uint64_t(-1) )
static

Definition at line 787 of file mtl_context.mm.

References blender::gpu::MTLContextGlobalShaderPipelineState::active_shader, bind_atomic_workaround_buffer(), blender::gpu::MTLBindingCache< CommandEncoderT >::bind_sampler(), bind_sampler_argument_buffer(), blender::gpu::MTLBindingCache< CommandEncoderT >::bind_texture(), DEFAULT_SAMPLER_STATE, blender::gpu::ShaderInterface::enabled_ima_mask_, blender::gpu::ShaderInterface::enabled_tex_mask_, ensure_texture_bindings(), blender::gpu::MTLBackend::get_capabilities(), blender::gpu::MTLContext::get_default_sampler_state(), blender::gpu::MTLTexture::get_metal_handle(), blender::gpu::MTLTexture::get_metal_handle_base(), blender::gpu::MTLContext::get_sampler_arg_buf_cache(), blender::gpu::MTLContext::get_sampler_array(), blender::gpu::MTLContext::get_sampler_from_state(), blender::GPU_TEXTURE_USAGE_ATOMIC, blender::gpu::MTLTexture::has_custom_swizzle(), blender::gpu::MTLContextGlobalShaderPipelineState::image_bindings, blender::gpu::MTLShaderInterface::image_name_get(), blender::bits::iter_1_indices(), MTL_IMAGE_SLOT_OFFSET, MTL_LOG_ERROR, MTL_SAMPLER_SLOT_OFFSET, blender::gpu::MTLShaderInterface::name_at_offset(), blender::gpu::ShaderInput::name_offset, blender::gpu::MTLContext::pipeline_state, blender::gpu::MTLContextGlobalShaderPipelineState::sampler_bindings, blender::gpu::MTLShaderInterface::sampler_name_get(), blender::gpu::MTLSamplerBinding::state, blender::gpu::MTLContextGlobalShaderPipelineState::texture_bindings, blender::gpu::ShaderInterface::texture_get(), blender::gpu::Texture::usage_get(), blender::gpu::MTLShaderInterface::use_samplers_argument_buffer(), and blender::gpu::MTLShaderInterface::use_texture_atomic().

Referenced by blender::gpu::MTLContext::compute_dispatch(), blender::gpu::MTLContext::compute_dispatch_indirect(), blender::gpu::MTLContext::ensure_render_pipeline_state(), and ensure_texture_bindings().

◆ ENUM_OPERATORS() [1/3]

blender::gpu::ENUM_OPERATORS ( MTLPipelineStateDirtyFlag )

References ENUM_OPERATORS().

◆ ENUM_OPERATORS() [2/3]

blender::gpu::ENUM_OPERATORS ( RenderGraphFlushFlags )

References ENUM_OPERATORS().

◆ ENUM_OPERATORS() [3/3]

blender::gpu::ENUM_OPERATORS ( ShaderStage )

◆ find_interface_by_name()

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

◆ find_next_matching_conditional()

◆ float_to_uint32_t()

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

Definition at line 685 of file vk_data_conversion.cc.

References float_to_uint32_t().

Referenced by convert(), and float_to_uint32_t().

◆ format_component_len()

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

◆ format_get_component_type()

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

Definition at line 338 of file mtl_shader.hh.

References format_get_component_type(), and format_resize_comp().

Referenced by format_get_component_type().

◆ format_resize_comp()

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

◆ generate_acceleration_structure()

◆ generate_buffer()

◆ generate_builtin() [1/2]

void blender::gpu::generate_builtin ( GeneratedStreams & generated,
const StringRefNull wrapper_type,
const StringRefNull wrapper_var,
const StringRefNull native_var )
static

Definition at line 1327 of file mtl_shader_generate.cc.

References generate_builtin().

◆ generate_builtin() [2/2]

◆ generate_builtins()

◆ generate_compilation_constant()

◆ generate_entry_point()

◆ generate_fragment_builtin()

void blender::gpu::generate_fragment_builtin ( GeneratedStreams & ss,
std::stringstream & declaration,
const StringRefNull type,
const StringRefNull var,
const StringRefNull native_type,
const StringRefNull attribute,
const bool is_const = false )
static

◆ generate_fragment_builtins()

◆ generate_fragment_interface()

void blender::gpu::generate_fragment_interface ( GeneratedStreams & generated,
const ShaderCreateInfo & info )
static

◆ generate_fragment_out()

◆ generate_inout()

◆ generate_instance_id()

◆ generate_raster_builtin()

void blender::gpu::generate_raster_builtin ( GeneratedStreams & ss,
std::stringstream & declaration,
const StringRefNull type,
const StringRefNull var,
const StringRefNull attribute,
const StringRefNull array = "",
const bool is_const = false )
static

◆ generate_raster_builtins()

◆ generate_resource()

◆ generate_resources()

◆ generate_sampler_argument_buffer()

◆ generate_shared_variable()

◆ generate_specialization_constant()

◆ generate_stage_interfaces()

void blender::gpu::generate_stage_interfaces ( GeneratedStreams & generated,
const ShaderStage stage,
const ShaderCreateInfo & info )
static

◆ generate_subpass_inputs()

◆ generate_texture()

◆ generate_uniforms()

◆ generate_vertex_attributes()

◆ generate_vertex_interface()

void blender::gpu::generate_vertex_interface ( GeneratedStreams & generated,
const ShaderCreateInfo & info )
static

◆ generate_vertex_out()

◆ get_buffers_binding_mask()

uint32_t blender::gpu::get_buffers_binding_mask ( NSArray< MTLArgument * > * args)
static

◆ get_compatible_texture_format()

◆ get_compile_options()

::MTLCompileOptions * blender::gpu::get_compile_options ( const bool use_subpass_input,
const bool use_texture_atomic,
const bool use_ray_query )
static

Definition at line 213 of file mtl_shader.mm.

References get_compile_options(), blender::bke::subdiv::init(), and options.

Referenced by get_compile_options().

◆ get_image_memory_requirements()

◆ get_images_binding_mask()

uint16_t blender::gpu::get_images_binding_mask ( NSArray< MTLArgument * > * args)
static

◆ get_location_count()

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

◆ 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_samplers_binding_mask()

uint64_t blender::gpu::get_samplers_binding_mask ( NSArray< MTLArgument * > * args)
static

◆ get_stage_class_name()

const char * blender::gpu::get_stage_class_name ( ShaderStage stage)
static

◆ get_stage_in_class_name()

const char * blender::gpu::get_stage_in_class_name ( ShaderStage stage)
static

◆ get_stage_in_instance_name()

const char * blender::gpu::get_stage_in_instance_name ( ShaderStage stage)
static

◆ get_stage_instance_name()

const char * blender::gpu::get_stage_instance_name ( ShaderStage stage)
static

◆ get_stage_out_class_name()

◆ get_stage_out_instance_name()

const char * blender::gpu::get_stage_out_instance_name ( ShaderStage stage)
static

◆ get_stage_type()

const char * blender::gpu::get_stage_type ( ShaderStage stage)
static

◆ get_update_mipmap_shader()

◆ ghost_context_type()

◆ gl_extension_get()

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

Definition at line 410 of file gl_backend.cc.

References gl_extension_get().

Referenced by gl_extension_get().

◆ GPU_activate_secondary_context()

◆ GPU_create_secondary_context()

◆ GPU_deactivate_secondary_context()

void blender::gpu::GPU_deactivate_secondary_context ( const GPUSecondaryContextData & data)

◆ gpu_depth_function_to_metal()

◆ GPU_destroy_secondary_context()

◆ gpu_prim_type_to_metal()

◆ gpu_stencil_func_to_metal()

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

◆ gpu_texture_format_to_metal()

◆ gpu_type_from_gl_type()

◆ gpu_type_to_metal_vertex_format()

MTLVertexFormat blender::gpu::gpu_type_to_metal_vertex_format ( shader::Type type)

◆ gpu_type_to_mtl_type()

◆ gpu_usage_from_mtl()

◆ gpu_vertex_format_to_metal()

MTLVertexFormat blender::gpu::gpu_vertex_format_to_metal ( VertAttrType vert_format)

◆ 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 55 of file vk_backend.cc.

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

Referenced by GPU_vulkan_is_supported_driver(), init_device_list(), blender::gpu::VKBackend::is_supported(), GHOST_InstanceVK::select_physical_device(), and blender::gpu::VKBackend::supported_devices_print().

◆ 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

◆ imm_draw_circle_partial_aspect()

void blender::gpu::imm_draw_circle_partial_aspect ( const GPUPrimType prim_type,
const uint pos,
const float x,
const float y,
const float2 radius,
const int nsegments,
const float start,
const float sweep )
static

◆ imm_draw_circle_partial_aspect_3d()

void blender::gpu::imm_draw_circle_partial_aspect_3d ( const GPUPrimType prim_type,
const uint pos,
const float x,
const float y,
const float z,
const float2 radius,
const int nsegments,
const float start,
const float sweep )
static

◆ imm_draw_circle_partial_wire_aspect_2d()

void blender::gpu::imm_draw_circle_partial_wire_aspect_2d ( uint pos,
float x,
float y,
float2 radius,
int nsegments,
float start,
float sweep )

◆ imm_draw_circle_partial_wire_aspect_3d()

void blender::gpu::imm_draw_circle_partial_wire_aspect_3d ( uint pos,
float x,
float y,
float z,
float2 radius,
int nsegments,
float start,
float sweep )

◆ imm_draw_rounded_box_wire_2d()

◆ imm_draw_rounded_box_wire_3d()

◆ increment_to_next_conditional()

◆ 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

Try to check if the driver is older than 22.6.1, preferring false positives.

Definition at line 97 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()

bool blender::gpu::is_builtin_type ( StringRefNull type)
static

◆ is_fetch_float()

◆ is_fetch_normalized()

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

◆ is_half_float()

bool blender::gpu::is_half_float ( TextureFormat format)
inline

◆ is_half_integer()

bool blender::gpu::is_half_integer ( TextureFormat format)
inline

Definition at line 34 of file gpu_texture_private.hh.

References is_half_integer().

Referenced by is_half_integer(), and blender::gpu::GLTexture::update_sub().

◆ 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_extensions_get_null()

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

Definition at line 323 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 427 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

Definition at line 467 of file mtl_shader.hh.

References FORMAT_PER_TYPE, and mtl_format_is_normalized().

Referenced by mtl_format_is_normalized().

◆ mtl_format_is_writable()

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

Definition at line 590 of file mtl_texture.hh.

References mtl_format_is_writable().

Referenced by mtl_format_is_writable().

◆ mtl_format_supports_blending()

◆ mtl_get_data_type_alignment()

uint blender::gpu::mtl_get_data_type_alignment ( MTLInterfaceDataType type)
inline

Definition at line 254 of file mtl_shader_interface_type.hh.

References 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_PACKED_FLOAT2, MTL_DATATYPE_PACKED_FLOAT3, 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_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, MTL_DATATYPE_USHORT4, and mtl_get_data_type_alignment().

Referenced by mtl_get_data_type_alignment().

◆ mtl_get_data_type_size()

uint blender::gpu::mtl_get_data_type_size ( MTLInterfaceDataType type)
inline

◆ mtl_load_action_from_gpu()

MTLLoadAction blender::gpu::mtl_load_action_from_gpu ( GPULoadOp 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 ( GPUStoreOp 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

◆ needs_conversion()

bool blender::gpu::needs_conversion ( eGPUDataFormat host_format,
TextureFormat host_texture_format,
TextureFormat device_format )

Check if data conversion is needed when uploading host_format to a device_format.

Parameters
host_formatformat of the host buffer.
host_texture_formattexture format of the host buffer.
device_formatformat of the device buffer.

Definition at line 1180 of file vk_data_conversion.cc.

References host_to_device(), needs_conversion(), and PASS_THROUGH.

Referenced by needs_conversion(), and blender::gpu::VKTexture::update_sub().

◆ new_buffer_size()

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

Definition at line 117 of file vk_immediate.cc.

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

Referenced by new_buffer_size().

◆ operator!=() [1/2]

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

Definition at line 62 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 109 of file gpu_state_private.hh.

References b, and operator!=().

◆ operator<<() [1/4]

PruningStream & blender::gpu::operator<< ( PruningStream & dst,
const Token & tok )
inline

◆ operator<<() [2/4]

◆ operator<<() [3/4]

◆ operator<<() [4/4]

std::ostream & blender::gpu::operator<< ( std::ostream & os,
const VKDiscardPool & discard_pool )

Definition at line 210 of file vk_resource_pool.cc.

◆ operator==() [1/3]

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

◆ operator==() [2/3]

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

Definition at line 104 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 180 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 67 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

◆ operator~() [1/2]

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

Definition at line 74 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

◆ pack_transform()

MTLPackedFloat4x3 blender::gpu::pack_transform ( const float4x4 & m)
static

◆ padded_size()

size_t blender::gpu::padded_size ( const shader::ShaderCreateInfo::PushConst & push_constant,
size_t & alignment )
static

◆ parse_version()

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

Definition at line 57 of file gl_backend.cc.

References blender::IndexRange::IndexRange(), parse_version(), and blender::v.

Referenced by is_bad_AMD_driver(), and parse_version().

◆ patch_create_info_atomic_workaround()

◆ patch_line_directives()

std::string blender::gpu::patch_line_directives ( std::string source)
static

Definition at line 318 of file vk_shader_compiler.cc.

References patch_line_directives().

Referenced by compile_ex(), and patch_line_directives().

◆ 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()

::MTLFunctionConstantValues * blender::gpu::populate_specialization_constant_values ( const shader::SpecializationConstants & shader_constants,
const SpecializationStateDescriptor & specialization_descriptor )
static

◆ 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,
const StringRefNull & suffix )
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]

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

◆ print_resource() [3/3]

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

◆ printf_begin()

◆ printf_end()

◆ ptr_type()

std::string blender::gpu::ptr_type ( const ResourceString & str)

◆ read_spirv_from_disk()

◆ ref_type()

std::string blender::gpu::ref_type ( const ResourceString & str,
const std::string & attribute = "" )

Definition at line 475 of file mtl_shader_generate.cc.

References attribute, ref_type(), and str.

Referenced by generate_buffer(), generate_shared_variable(), and ref_type().

◆ remap_components_3to4_front_to_back()

template<typename ComponentType>
void blender::gpu::remap_components_3to4_front_to_back ( MutableSpan< ComponentType > components,
int64_t size,
ComponentType component_4_value )

Inline remapping from 3 components to 4 components where the data is stored at the end of the buffer.

Definition at line 978 of file vk_data_conversion.cc.

References blender::IndexRange::IndexRange(), and remap_components_3to4_front_to_back().

Referenced by convert_buffer(), and remap_components_3to4_front_to_back().

◆ 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 101 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()

◆ shader_input_index()

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

Definition at line 328 of file vk_shader_interface.cc.

References shader_input_index().

Referenced by shader_input_index().

◆ shader_stage_define()

std::string blender::gpu::shader_stage_define ( const ShaderStage stage)

Definition at line 67 of file mtl_shader.mm.

References BLI_assert_unreachable, COMPUTE, FRAGMENT, shader_stage_define(), and VERTEX.

Referenced by shader_stage_define().

◆ sort_input_list()

◆ spirv_inject_op_string()

void blender::gpu::spirv_inject_op_string ( const Span< uint32_t > & spirv_in,
Vector< uint32_t > & spirv_out,
StringRef name,
uint32_t glsl_version )
static

Injects an "OpString" holding the shader name into the SPIR-V binary, and references it via an "OpSource" instruction. This is not necessary when G_DEBUG_GPU_SHADER_DEBUG_INFO is used, as then shaderc/glslang will generate this OpString together with an OpSource instruction that contains the full GLSL source code.

This way, the human-readable shader name can be found/referenced when inspecting the binary or debugging even when not using the flag G_DEBUG_GPU_SHADER_DEBUG_INFO.

Definition at line 213 of file vk_shader_compiler.cc.

References BLI_assert_msg, blender::blender::StringRefBase::data(), blender::Span< T >::data(), lexit::Vector< T >::data(), blender::divide_ceil_u(), blender::Span< T >::drop_front(), ELEM, length(), lexit::Vector< T >::reserve(), lexit::Vector< T >::resize(), blender::blender::StringRefBase::size(), blender::Span< T >::size(), lexit::Vector< T >::size(), spirv_inject_op_string(), and blender::Span< T >::take_front().

Referenced by compile_ex(), and spirv_inject_op_string().

◆ spirv_target_version_get()

◆ ssbo_binding()

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

◆ struct_size()

◆ 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 208 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 1429 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]

◆ 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_access()

StringRefNull blender::gpu::to_access ( const bool is_sampler,
const shader::Qualifier qualifier )

◆ to_bind_type()

◆ to_block_size()

◆ to_bytesize() [1/5]

◆ to_bytesize() [2/5]

◆ to_bytesize() [3/5]

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

Definition at line 31 of file GPU_index_buffer.hh.

References GPU_INDEX_U32, and to_bytesize().

◆ to_bytesize() [4/5]

size_t blender::gpu::to_bytesize ( TextureFormat format)
inline

Definition at line 395 of file gpu_texture_private.hh.

References to_bytesize().

◆ to_bytesize() [5/5]

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

◆ to_component_len()

◆ to_component_type() [1/2]

◆ to_component_type() [2/2]

StringRefNull blender::gpu::to_component_type ( ImageType type)
static

◆ to_data_format() [1/2]

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

◆ to_data_format() [2/2]

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

Definition at line 152 of file GPU_vertex_format.hh.

References to_data_format().

◆ to_format_flag()

◆ to_framebuffer_bits()

◆ to_gl() [1/10]

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

Definition at line 131 of file gl_framebuffer.hh.

References ATTACHMENT, blender::BLI_assert(), and to_gl().

◆ to_gl() [2/10]

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

◆ to_gl() [3/10]

◆ to_gl() [4/10]

◆ to_gl() [5/10]

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

Definition at line 68 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 46 of file gl_query.hh.

References blender::BLI_assert(), GPU_QUERY_OCCLUSION, and to_gl().

◆ to_gl() [8/10]

◆ to_gl() [9/10]

◆ to_gl() [10/10]

◆ to_gl_data_format()

◆ to_gl_internal_format()

◆ to_gl_proxy()

◆ to_gl_target()

◆ to_gpu_format()

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

◆ to_gpu_format_string()

std::string blender::gpu::to_gpu_format_string ( VkFormat format)

◆ to_metal_type()

◆ to_mtl()

◆ to_mtl_type() [1/3]

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

◆ to_mtl_type() [2/3]

◆ to_mtl_type() [3/3]

MTLInterfaceDataType blender::gpu::to_mtl_type ( shader::Type type)
inline

Definition at line 181 of file mtl_shader_interface_type.hh.

References blender::BLI_assert(), 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_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_UINT1010102_NORM, 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.

◆ to_raw_type()

◆ to_stage_name()

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

Definition at line 185 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/40]

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

◆ to_string() [2/40]

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

◆ to_string() [3/40]

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

◆ to_string() [4/40]

◆ to_string() [5/40]

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

◆ to_string() [6/40]

const char * blender::gpu::to_string ( const TextureFormat & type)
static

Definition at line 93 of file vk_shader.cc.

References to_string().

◆ to_string() [7/40]

◆ to_string() [8/40]

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

Definition at line 115 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [9/40]

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

Definition at line 133 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [10/40]

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

Definition at line 645 of file vk_to_string.cc.

References to_string(), and UNUSED_VARS.

◆ to_string() [11/40]

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

Definition at line 656 of file vk_to_string.cc.

References to_string().

◆ to_string() [12/40]

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

Definition at line 678 of file vk_to_string.cc.

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

◆ to_string() [13/40]

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

Definition at line 691 of file vk_to_string.cc.

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

◆ to_string() [14/40]

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

Definition at line 701 of file vk_to_string.cc.

References to_string(), and UNUSED_VARS.

◆ to_string() [15/40]

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

Definition at line 712 of file vk_to_string.cc.

References to_string().

◆ to_string() [16/40]

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

Definition at line 725 of file vk_to_string.cc.

References to_string(), and UNUSED_VARS.

◆ to_string() [17/40]

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

Definition at line 735 of file vk_to_string.cc.

References to_string(), and UNUSED_VARS.

◆ to_string() [18/40]

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

Definition at line 152 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [19/40]

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

Definition at line 746 of file vk_to_string.cc.

References to_string().

◆ to_string() [20/40]

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

Definition at line 761 of file vk_to_string.cc.

References to_string().

◆ to_string() [21/40]

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

Definition at line 167 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [22/40]

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

Definition at line 788 of file vk_to_string.cc.

References to_string(), and to_string_vk_access_flags().

◆ to_string() [23/40]

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

Definition at line 804 of file vk_to_string.cc.

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

◆ to_string() [24/40]

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

Definition at line 817 of file vk_to_string.cc.

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

◆ to_string() [25/40]

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

Definition at line 230 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [26/40]

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

Definition at line 831 of file vk_to_string.cc.

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

◆ to_string() [27/40]

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

Definition at line 245 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [28/40]

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

Definition at line 841 of file vk_to_string.cc.

References to_string(), and UNUSED_VARS.

◆ to_string() [29/40]

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

Definition at line 851 of file vk_to_string.cc.

References to_string(), and UNUSED_VARS.

◆ to_string() [30/40]

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

Definition at line 343 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [31/40]

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

Definition at line 862 of file vk_to_string.cc.

References to_string().

◆ to_string() [32/40]

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

Definition at line 893 of file vk_to_string.cc.

References to_string(), and UNUSED_VARS.

◆ to_string() [33/40]

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

Definition at line 909 of file vk_to_string.cc.

References to_string(), and to_string_vk_rendering_flags().

◆ to_string() [34/40]

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

Definition at line 877 of file vk_to_string.cc.

References to_string().

◆ to_string() [35/40]

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

Definition at line 358 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [36/40]

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

Definition at line 382 of file vk_to_string.cc.

References STRINGIFY, STRINGIFY_ARG, and to_string().

◆ to_string() [37/40]

◆ to_string() [38/40]

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_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(), GHOST_InstanceVK::create_device(), blender::gpu::render_graph::CommandBufferLog::dispatch_indirect(), blender::ui::draw_horizontal_scale_indicators(), blender::ui::draw_vertical_scale_indicators(), blender::ed::spreadsheet::estimate_max_column_width(), blender::gpu::render_graph::CommandBufferLog::fill_buffer(), blender::gpu::GLShader::fragment_interface_declare(), blender::gpu::VKShader::fragment_interface_declare(), generate_compilation_constant(), generate_inout(), blender::gpu::GLShader::geometry_layout_declare(), blender::gpu::VKShader::geometry_layout_declare(), blender::ui::get_label_width(), blender::ui::get_min_line_distance_x(), blender::MANTA::getFrame(), blender::MANTA::getTimestep(), blender::gpu::shader::SourceProcessor::guarded_scope_mutation(), blender::fixed_width_int::UIntF< uint8_t, 8 >::operator float(), blender::fixed_width_int::IntF< uint16_t, 4 >::operator UIntF< uint16_t, S >(), blender::gpu::render_graph::CommandBufferLog::pipeline_barrier(), blender::print_interface(), print_interface_as_attributes(), print_interface_as_struct(), blender::gpu::debug::VKDebuggingTools::print_labels(), print_resource(), blender::print_resource(), blender::gpu::GLShader::resources_declare(), blender::gpu::VKShader::resources_declare(), GHOST_ContextVK::swapBufferRelease(), 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::to_string(), blender::to_string(), blender::to_string(), blender::to_string(), blender::to_string(), blender::to_string(), blender::gpu::render_graph::CommandBufferLog::update_buffer(), blender::MANTA::updatePointers(), blender::gpu::GLShader::vertex_interface_declare(), blender::gpu::VKShader::vertex_interface_declare(), and blender::gpu::VKDevice::wait_for_timeline().

◆ to_string() [39/40]

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

Definition at line 73 of file vk_to_string.cc.

References to_string(), and to_string_handle().

◆ to_string() [40/40]

const char * blender::gpu::to_string ( VkResult result)

Definition at line 23 of file vk_to_string.cc.

References FORMAT_ERROR, blender::result, and to_string().

◆ 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(), and to_string_handle().

◆ 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)

◆ 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)

◆ to_string_vk_shader_stage_flags()

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

◆ to_texture_data_format()

◆ to_texture_format() [1/3]

TextureFormat blender::gpu::to_texture_format ( const GPUVertFormat * format)
inlinestatic

Definition at line 910 of file gpu_texture_private.hh.

References BLI_assert_msg, and to_texture_format().

◆ to_texture_format() [2/3]

◆ to_texture_format() [3/3]

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

Definition at line 268 of file GPU_texture.hh.

References to_texture_format().

◆ to_vk_attachment_load_op()

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

◆ to_vk_attachment_store_op()

VkAttachmentStoreOp blender::gpu::to_vk_attachment_store_op ( GPUStoreOp 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 GPUFaceCullTest 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/4]

◆ to_vk_format() [2/4]

◆ to_vk_format() [3/4]

◆ to_vk_format() [4/4]

BLI_INLINE VkFormat blender::gpu::to_vk_format ( const TextureTargetFormat format)

Definition at line 95 of file vk_common.hh.

References BLI_INLINE, to_texture_format(), and to_vk_format().

◆ to_vk_format_float()

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

◆ to_vk_format_int()

◆ to_vk_format_norm()

◆ to_vk_image_aspect_flag_bits() [1/2]

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

◆ to_vk_image_aspect_flag_bits() [2/2]

◆ 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()

◆ 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()

◆ to_work_priority()

◆ to_wrapper_type()

◆ type_of_conversion_float()

◆ type_of_conversion_half()

ConversionType blender::gpu::type_of_conversion_half ( TextureFormat device_format)
static

◆ type_of_conversion_int()

ConversionType blender::gpu::type_of_conversion_int ( TextureFormat device_format)
static

◆ type_of_conversion_r10g10b10a2()

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

◆ type_of_conversion_r11g11b10()

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

◆ type_of_conversion_ubyte()

ConversionType blender::gpu::type_of_conversion_ubyte ( TextureFormat device_format)
static

◆ type_of_conversion_uint()

ConversionType blender::gpu::type_of_conversion_uint ( TextureFormat device_format)
static

◆ type_of_conversion_uint248()

ConversionType blender::gpu::type_of_conversion_uint248 ( const TextureFormat device_format)
static

◆ uint32_t_to_float()

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

Definition at line 695 of file vk_data_conversion.cc.

References uint32_t_to_float().

Referenced by convert(), and uint32_t_to_float().

◆ unwrap() [1/19]

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

Definition at line 50 of file vk_batch.hh.

References unwrap().

◆ unwrap() [2/19]

const VKBottomLevelAS & blender::gpu::unwrap ( const BottomLevelAS & blas)
inlinestatic

Definition at line 106 of file vk_ray_tracing.hh.

References unwrap().

◆ unwrap() [3/19]

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

Definition at line 175 of file gpu_context_private.hh.

References unwrap().

◆ unwrap() [4/19]

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

Definition at line 185 of file gpu_state_private.hh.

References unwrap().

◆ unwrap() [5/19]

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

Definition at line 390 of file gpu_texture_private.hh.

References unwrap().

◆ unwrap() [6/19]

const VKTopLevelAS & blender::gpu::unwrap ( const TopLevelAS & blas)
inlinestatic

Definition at line 102 of file vk_ray_tracing.hh.

References unwrap().

◆ unwrap() [7/19]

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

Definition at line 148 of file vk_framebuffer.hh.

References unwrap().

◆ unwrap() [8/19]

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

◆ unwrap() [9/19]

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

Definition at line 181 of file gpu_state_private.hh.

References unwrap().

◆ unwrap() [10/19]

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

Definition at line 386 of file gpu_texture_private.hh.

References unwrap().

◆ unwrap() [11/19]

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

Definition at line 75 of file vk_index_buffer.hh.

References unwrap().

◆ unwrap() [12/19]

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

Definition at line 70 of file vk_index_buffer.hh.

References unwrap().

◆ unwrap() [13/19]

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

Definition at line 38 of file vk_pixel_buffer.hh.

References unwrap().

◆ unwrap() [14/19]

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

Definition at line 158 of file vk_shader.hh.

References unwrap().

◆ unwrap() [15/19]

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

Definition at line 163 of file vk_shader.hh.

References unwrap().

◆ unwrap() [16/19]

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

Definition at line 71 of file vk_storage_buffer.hh.

References BLI_INLINE, and unwrap().

◆ unwrap() [17/19]

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

Definition at line 692 of file mtl_texture.hh.

References BLI_INLINE, and unwrap().

Referenced by blender::gpu::GLTexturePool::acquire_texture_impl(), blender::gpu::MTLTexturePool::acquire_texture_impl(), blender::gpu::VKContext::active_framebuffer_get(), blender::gpu::VKBottomLevelAS::add_geometry(), blender::gpu::VKFrameBuffer::blit_to(), blender::gpu::VKTopLevelAS::build(), blender::gpu::VKFrameBuffer::clear(), blender::gpu::VKBackend::compute_dispatch_indirect(), blender::gpu::VKStorageBuffer::copy_sub(), blender::gpu::VKVertexBuffer::copy_sub(), blender::gpu::VKTexture::copy_to(), blender::gpu::TexturePool::get(), blender::GPU_context_active_set(), blender::GPU_context_begin_frame(), blender::GPU_context_debug_pipeline_creation(), blender::GPU_context_discard(), blender::GPU_context_end_frame(), blender::GPU_fence_free(), blender::GPU_fence_signal(), blender::GPU_fence_wait(), blender::GPU_pixel_buffer_free(), blender::GPU_pixel_buffer_get_native_handle(), blender::GPU_pixel_buffer_map(), blender::GPU_pixel_buffer_size(), blender::GPU_pixel_buffer_unmap(), blender::gpu::VKStateManager::image_bind(), blender::gpu::VKStateManager::image_unbind(), blender::gpu::VKBatch::index_buffer_get(), blender::gpu::VKTexture::init_internal(), blender::gpu::VKTexture::init_internal(), blender::gpu::VKBatch::multi_draw_indirect(), blender::gpu::GLTexturePool::offset_users_count(), blender::gpu::MTLTexturePool::offset_users_count(), blender::gpu::VKTexturePool::offset_users_count(), blender::gpu::VKFrameBuffer::read(), blender::gpu::GLTexturePool::release_texture(), blender::gpu::MTLTexturePool::release_texture(), blender::gpu::VKTexturePool::release_texture(), blender::gpu::VKFrameBuffer::rendering_ensure_dynamic_rendering(), blender::gpu::VKFrameBuffer::subpass_transition_impl(), 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() [18/19]

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

Definition at line 93 of file vk_vertex_buffer.hh.

References BLI_INLINE, and unwrap().

◆ unwrap() [19/19]

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

Definition at line 89 of file vk_vertex_buffer.hh.

References BLI_INLINE, and unwrap().

◆ update_mipmaps()

◆ update_mipmaps_layers()

◆ validate_data_format()

◆ vbo_bind()

◆ vertex_format_combine()

◆ vk_extended_usage_storage_image_format()

VkFormat blender::gpu::vk_extended_usage_storage_image_format ( const VkFormat format)

Other format to use for binding a storage image when the format itself is not supported.

Definition at line 850 of file vk_common.cc.

References vk_extended_usage_storage_image_format(), VK_FORMAT_R8G8B8_SRGB, VK_FORMAT_R8G8B8_UNORM, VK_FORMAT_R8G8B8A8_SRGB, and VK_FORMAT_R8G8B8A8_UNORM.

Referenced by blender::gpu::VKTexture::image_view_get(), and vk_extended_usage_storage_image_format().

◆ vk_extension_get()

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

◆ vk_external_memory_handle_type()

VkExternalMemoryHandleTypeFlags blender::gpu::vk_external_memory_handle_type ( )
constexpr

◆ vk_instance_create_for_platform_checks()

bool blender::gpu::vk_instance_create_for_platform_checks ( VkInstance * r_instance)
static

◆ vk_need_extended_usage_for_storage_image()

bool blender::gpu::vk_need_extended_usage_for_storage_image ( const eGPUTextureUsage usage,
const GPUTextureFormatFlag format_flag )

Test if these settings need EXTENDED_USAGE to be able to bind the texture as a (writable) storage image.

Definition at line 841 of file vk_common.cc.

References GPU_FORMAT_COMPRESSED, GPU_FORMAT_SRGB, blender::GPU_TEXTURE_USAGE_FORMAT_VIEW, and vk_need_extended_usage_for_storage_image().

Referenced by to_vk_image_create(), to_vk_image_usage(), vk_need_extended_usage_for_storage_image(), and blender::gpu::VKImageView::VKImageView().

◆ vk_restrict_loader_layers()

void blender::gpu::vk_restrict_loader_layers ( )
static

Disable implicit layers and only allow layers that we trust.

Render doc layer is hidden behind a debug flag. There are malicious layers that impersonate RenderDoc and can crash when loaded. See #139543.

Must be called before any vkCreateInstance so temporary Vulkan instances created during argument handling (e.g. --gpu-device help) don't load implicit layers either.

Definition at line 211 of file vk_backend.cc.

References blender::BLI_setenv(), blender::G, blender::G_DEBUG_GPU, and vk_restrict_loader_layers().

Referenced by vk_instance_create_for_platform_checks(), and vk_restrict_loader_layers().

◆ wrap() [1/7]

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

Definition at line 167 of file gpu_context_private.hh.

References wrap().

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

◆ wrap() [2/7]

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

Definition at line 177 of file gpu_state_private.hh.

References wrap().

◆ wrap() [3/7]

BLI_INLINE Texture * blender::gpu::wrap ( GLTexture * texture)

Definition at line 380 of file gl_texture.hh.

References BLI_INLINE, texture(), and wrap().

◆ wrap() [4/7]

BLI_INLINE Texture * blender::gpu::wrap ( MTLTexture * texture)

Definition at line 697 of file mtl_texture.hh.

References BLI_INLINE, texture(), and wrap().

Referenced by blender::acf_fcurve_name(), blender::achannel_is_part_of_disconnected_slot(), blender::gpu::GLTexturePool::acquire_texture_impl(), blender::gpu::MTLTexturePool::acquire_texture_impl(), blender::gpu::VKTexturePool::acquire_texture_impl(), blender::bke::action_blend_read_data(), blender::bke::action_blend_write(), blender::bke::action_foreach_id(), blender::bke::action_free_data(), blender::action_preview_render_prepare(), blender::ANIM_animchannel_keyframes_loop(), blender::ANIM_animdata_filter(), blender::animchannels_delete_containers(), blender::ed::greasepencil::apply_eval_grease_pencil_data(), blender::ed::object::apply_objects_internal(), blender::BKE_grease_pencil_has_curve_with_type(), blender::BKE_grease_pencil_material_index_remove(), blender::BKE_grease_pencil_material_index_used(), blender::BKE_grease_pencil_material_remap(), blender::BKE_grease_pencil_nomain_to_grease_pencil(), blender::BKE_grease_pencil_point_coords_apply(), blender::BKE_grease_pencil_point_coords_apply_with_mat4(), blender::BKE_grease_pencil_point_coords_get(), blender::BKE_grease_pencil_stroke_point_count(), blender::BKE_grease_pencil_vgroup_name_update(), blender::BKE_image_stamp_buf(), blender::blf_font_wrap_apply(), blender::blinn_specular(), blender::BPy_IDGroup_MapDataToPy(), blender::bke::greasepencil::clear_vertex_groups(), blender::click_select_channel_grease_pencil_layer_group(), blender::convert_grease_pencil_stroke_hardness_to_softness(), blender::ed::greasepencil::copy_layer_group_content(), blender::io::usd::create_usd_preview_shader(), blender::bke::CurvesFieldContext::CurvesFieldContext(), blender::ed::greasepencil::undo::StepDrawingGeometryBase::decode_valid_drawingtype_at_index_ensure(), blender::do_2d_mapping(), blender::draw_nla_main_data(), blender::ED_anim_ale_fcurve_delete(), blender::ED_grease_pencil_join_objects_exec(), blender::fix_curve_nurbs_knot_mode_custom(), blender::bke::GeometryFieldContext::GeometryFieldContext(), blender::get_keyframe_extents(), blender::io::usd::get_node_tex_image_wrap(), blender::GPU_context_active_get(), blender::GPU_context_create(), blender::GPU_fence_create(), blender::GPU_pixel_buffer_create(), blender::nodes::node_geo_store_named_attribute_cc::grease_pencil_add_missing_update_tags(), blender::ed::object::grease_pencil_clear_from_vgroup(), blender::grease_pencil_initialize_drawing_user_counts(), blender::ed::transform::grease_pencil_layer_apply_trans_data(), blender::bke::tests::ArmatureDeformTestBase::grease_pencil_test(), blender::ed::transform::grease_pencil_transdata_add_fake_drawing_users(), blender::ed::transform::grease_pencil_transdata_remove_fake_drawing_users(), blender::idprop_py_from_idp_idparray(), blender::ed::greasepencil::join_object_with_active(), blender::ui::greasepencil::LayerViewItemDragController::LayerViewItemDragController(), blender::metadata_box_height_get(), blender::ed::object::object_origin_set_exec(), blender::ed::animation::pastebuf_find_matching_copybuf_item(), blender::io::usd::USDBasisCurvesReader::read_curve_sample(), blender::rearrange_layered_action_slots(), blender::ui::rna_collection_search_update_fn(), blender::ed::vse::sequencer_write_copy_paste_file(), blender::io::grease_pencil::shift_to_bounds_center(), blender::space_text_draw_wrapped(), blender::ui::template_search_add_button_name(), blender::txt_find_string(), blender::bke::greasepencil::validate_drawing_vertex_groups(), blender::versioning_grease_pencil_stroke_radii_scaling(), blender::WM_cursor_grab_enable(), blender::wm_macro_modal(), blender::wm_operator_invoke(), blender::math::wrap_coord(), blender::gpu::GLTexturePool::~GLTexturePool(), and blender::gpu::MTLTexturePool::~MTLTexturePool().

◆ wrap() [5/7]

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

Definition at line 382 of file gpu_texture_private.hh.

References wrap().

◆ wrap() [6/7]

BLI_INLINE Texture * blender::gpu::wrap ( VKTexture * texture)

Definition at line 192 of file vk_texture.hh.

References BLI_INLINE, texture(), and wrap().

◆ wrap() [7/7]

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

Definition at line 74 of file vk_uniform_buffer.hh.

References BLI_INLINE, and wrap().

◆ wrap_type()

std::string blender::gpu::wrap_type ( StringRefNull type_name,
const ShaderStage stage )

◆ write_spirv_to_disk()

◆ xr_blit()

void blender::gpu::xr_blit ( id< MTLTexture > metal_xr_texture,
int ofsx,
int ofsy,
int width,
int height )

Definition at line 2105 of file mtl_context.mm.

Referenced by blender::gpu::MTLContext::MTLContext().

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 34 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

GPUCapabilities blender::gpu::GCaps = {}

Definition at line 24 of file gpu_capabilities.cc.

Referenced by blender::gpu::VKBackend::capabilities_init(), detect_workarounds(), blender::GPU_compilation_subprocess_override_set(), blender::GPU_depth_blitting_workaround(), blender::GPU_extension_get(), blender::GPU_extensions_len(), blender::GPU_frontbuffer_read_workaround(), blender::GPU_geometry_shader_support(), blender::GPU_hdr_support(), blender::GPU_max_batch_indices(), blender::GPU_max_batch_vertices(), blender::GPU_max_buffer_texture_size(), blender::GPU_max_compute_shader_storage_blocks(), blender::GPU_max_images(), blender::GPU_max_parallel_compilations(), blender::GPU_max_shader_storage_buffer_bindings(), blender::GPU_max_storage_buffer_size(), blender::GPU_max_texture_3d_size(), blender::GPU_max_texture_layers(), blender::GPU_max_texture_size(), blender::GPU_max_textures(), blender::GPU_max_uniform_buffer_size(), blender::GPU_max_uniforms_frag(), blender::GPU_max_uniforms_vert(), blender::GPU_max_varying_floats(), blender::GPU_max_vertex_attribs(), blender::GPU_max_work_group_count(), blender::GPU_max_work_group_size(), blender::GPU_mem_stats_supported(), blender::GPU_minimum_per_vertex_stride(), blender::GPU_multi_viewport_support(), blender::GPU_ray_query_support(), blender::GPU_stencil_classify_buffer_workaround(), blender::GPU_stencil_export_support(), blender::GPU_storage_buffer_alignment(), blender::GPU_texture_mipmap_usage(), blender::GPU_use_hq_normals_workaround(), blender::GPU_use_main_context_workaround(), blender::GPU_use_subprocess_compilation(), blender::GPU_vertex_pipeline_stores_and_atomics_support(), blender::gpu::GLBackend::init_resources(), blender::gpu::VKWorkarounds::log(), blender::gpu::VKContext::sync_backbuffer(), blender::texture_update_mipmap_chain(), blender::gpu::GLBackend::texturepool_alloc(), and blender::gpu::VKBackend::texturepool_alloc().

◆ GPG

◆ HALF_VALUE_1

uint16_t blender::gpu::HALF_VALUE_1 = 0x3c00
constexpr

FP16 value 1.0

Definition at line 17 of file vk_data_conversion.cc.

Referenced by convert_buffer().

◆ LOG [1/16]

◆ LOG [2/16]

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

Definition at line 42 of file mtl_backend.mm.

Referenced by blender::gpu::MTLBackend::metal_is_supported().

◆ LOG [3/16]

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

Definition at line 33 of file mtl_batch.mm.

◆ LOG [4/16]

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

Definition at line 28 of file mtl_command_buffer.mm.

Referenced by blender::gpu::MTLCommandBufferManager::submit().

◆ LOG [5/16]

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

◆ LOG [6/16]

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

Definition at line 43 of file mtl_debug.mm.

Referenced by blender::gpu::MTLContext::debug_capture_begin().

◆ LOG [7/16]

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

Definition at line 34 of file mtl_memory.mm.

Referenced by blender::gpu::MTLBufferPool::update_memory_pools().

◆ LOG [8/16]

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

◆ LOG [9/16]

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

Definition at line 28 of file mtl_storage_buffer.mm.

Referenced by blender::gpu::MTLStorageBuf::bind().

◆ LOG [10/16]

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

Definition at line 21 of file mtl_texture_pool.mm.

◆ LOG [11/16]

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

Definition at line 32 of file mtl_texture_util.mm.

◆ LOG [12/16]

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

Definition at line 20 of file gl_texture_pool.cc.

◆ LOG [13/16]

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

Definition at line 24 of file vk_descriptor_set.cc.

◆ LOG [14/16]

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

Definition at line 25 of file vk_immediate.cc.

◆ LOG [15/16]

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().

◆ LOG [16/16]

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

Definition at line 39 of file vk_shader_compiler.cc.

◆ MASK_10_BITS

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

Definition at line 902 of file vk_data_conversion.cc.

Referenced by convert().

◆ MASK_11_BITS

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

Definition at line 903 of file vk_data_conversion.cc.

Referenced by convert().

◆ MTL_MAX_FBO_ATTACHED

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

Definition at line 141 of file mtl_texture.hh.

◆ MTL_MAX_MIPMAP_COUNT

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

Definition at line 140 of file mtl_texture.hh.

◆ PCI_ID_AMD

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

Definition at line 374 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 376 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 375 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 373 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 372 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 904 of file vk_data_conversion.cc.

Referenced by convert(), and convert().

◆ SHIFT_G

uint8_t blender::gpu::SHIFT_G = 11
constexpr

Definition at line 905 of file vk_data_conversion.cc.

Referenced by convert(), and convert().

◆ SHIFT_R

uint8_t blender::gpu::SHIFT_R = 0
constexpr

Definition at line 906 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().