Blender V5.3
blender::gpu::MTLShaderInterface Class Reference

#include <mtl_shader_interface.hh>

Inherits blender::gpu::ShaderInterface.

Public Member Functions

 MTLShaderInterface (const char *name, const shader::ShaderCreateInfo &info, MTLPushConstantBuf *push_constant_buf=nullptr)
 ~MTLShaderInterface () override
uint32_t vertex_buffer_mask () const
uint32_t enabled_accel_mask () const
bool use_layer () const
bool use_viewport_index () const
bool use_samplers_argument_buffer () const
bool use_texture_atomic () const
bool is_point_shader () const
const char * name_at_offset (uint32_t offset) const
const char * name_get () const
const char * image_name_get (int slot) const
const char * sampler_name_get (int slot) const
id< MTLArgumentEncoder > ensure_argument_encoder (id< MTLFunction > mtl_function)
 MEM_CXX_CLASS_ALLOC_FUNCS ("MTLShaderInterface")
Public Member Functions inherited from blender::gpu::ShaderInterface
 ShaderInterface ()
virtual ~ShaderInterface ()
void debug_print () const
const ShaderInput * attr_get (const StringRefNull name) const
const ShaderInput * attr_get (const int binding) const
const ShaderInput * ubo_get (const StringRefNull name) const
const ShaderInput * ubo_get (const int binding) const
const ShaderInput * uniform_get (const StringRefNull name) const
const ShaderInput * texture_get (const int binding) const
const ShaderInput * ssbo_get (const StringRefNull name) const
const ShaderInput * ssbo_get (const int binding) const
const ShaderInput * tlas_get (const StringRefNull name) const
const ShaderInput * tlas_get (const int binding) const
const ShaderInput * constant_get (const StringRefNull name) const
const char * input_name_get (const ShaderInput *input) const
int32_t uniform_builtin (const GPUUniformBuiltin builtin) const
int32_t ubo_builtin (const GPUUniformBlockBuiltin builtin) const
uint valid_bindings_get (const ShaderInput *const inputs, const uint inputs_len) const
bool attr_len_get () const
bool ubo_len_get () const
bool uniform_len_get () const
bool ssbo_len_get () const
bool constant_len_get () const

Additional Inherited Members

Public Types inherited from blender::gpu::ShaderInterface
using Key = uint64_t
Public Attributes inherited from blender::gpu::ShaderInterface
Key uid = 0
ShaderInput * inputs_ = nullptr
char * name_buffer_ = nullptr
uint attr_len_ = 0
uint ubo_len_ = 0
uint uniform_len_ = 0
uint ssbo_len_ = 0
uint tlas_len_ = 0
uint constant_len_ = 0
uint16_t enabled_attr_mask_ = 0
uint16_t enabled_ubo_mask_ = 0
uint8_t enabled_ima_mask_ = 0
uint64_t enabled_tex_mask_ = 0
uint16_t enabled_ssbo_mask_ = 0
uint16_t ssbo_attr_mask_ = 0
int32_t builtins_ [GPU_NUM_UNIFORMS]
int32_t builtin_blocks_ [GPU_NUM_UNIFORM_BLOCKS]
uint8_t attr_types_ [GPU_VERT_ATTR_MAX_LEN]
std::array< TextureWriteFormat, GPU_MAX_IMAGE > image_formats_
Static Public Attributes inherited from blender::gpu::ShaderInterface
static std::atomic< Key > next_uid_ {1}
Protected Member Functions inherited from blender::gpu::ShaderInterface
uint32_t set_input_name (ShaderInput *input, char *name, uint32_t name_len) const
void copy_input_name (ShaderInput *input, const StringRefNull &name, char *name_buffer, uint32_t &name_buffer_offset) const
void sort_inputs ()
void set_image_formats_from_info (const shader::ShaderCreateInfo &info)
Static Protected Member Functions inherited from blender::gpu::ShaderInterface
static const char * builtin_uniform_name (GPUUniformBuiltin u)
static const char * builtin_uniform_block_name (GPUUniformBlockBuiltin u)

Detailed Description

Implementation of Shader interface for Metal Back-end.

Definition at line 74 of file mtl_shader_interface.hh.

Constructor & Destructor Documentation

◆ MTLShaderInterface()

blender::gpu::MTLShaderInterface::MTLShaderInterface ( const char * name,
const shader::ShaderCreateInfo & info,
MTLPushConstantBuf * push_constant_buf = nullptr )

Definition at line 29 of file mtl_shader_interface.mm.

References blender::gpu::shader::ShaderCreateInfo::Resource::ACCELERATION_STRUCTURE, blender::gpu::MTLPushConstantBuf::append(), blender::gpu::ShaderInterface::attr_len_, blender::gpu::ShaderInterface::attr_types_, blender::gpu::shader::ShaderCreateInfo::batch_resources_, blender::ShaderCreateInfo::Resource::bind_type, blender::gpu::ShaderInput::binding, BLI_assert_msg, blender::gpu::ShaderInterface::builtin_blocks_, blender::gpu::ShaderInterface::builtin_uniform_block_name(), blender::gpu::ShaderInterface::builtin_uniform_name(), blender::gpu::ShaderInterface::builtins_, blender::gpu::shader::ShaderCreateInfo::builtins_combined(), blender::gpu::ShaderInterface::constant_len_, blender::gpu::ShaderInterface::copy_input_name(), blender::gpu::ShaderInterface::enabled_attr_mask_, blender::gpu::ShaderInterface::enabled_ima_mask_, blender::gpu::ShaderInterface::enabled_ssbo_mask_, blender::gpu::ShaderInterface::enabled_tex_mask_, blender::gpu::ShaderInterface::enabled_ubo_mask_, blender::gpu::shader::ShaderCreateInfo::geometry_resources_, blender::GPU_NUM_UNIFORM_BLOCKS, GPU_NUM_UNIFORMS, blender::gpu::shader::ShaderCreateInfo::Resource::IMAGE, blender::ShaderCreateInfo::VertIn::index, blender::gpu::ShaderInterface::inputs_, blender::gpu::shader::ShaderCreateInfo::interface_names_size_, blender::gpu::ShaderInput::location, blender::MEM_new_array_uninitialized(), blender::MEM_new_array_zeroed(), MTL_ACCELERATION_STRUCTURE_SLOT, MTL_SSBO_SLOT_OFFSET, MTL_UBO_SLOT_OFFSET, blender::gpu::shader::SpecializationConstant::name, blender::ShaderCreateInfo::VertIn::name, blender::gpu::ShaderInterface::name_buffer_, blender::gpu::shader::ShaderCreateInfo::pass_resources_, push_constant, blender::gpu::shader::ShaderCreateInfo::push_constants_, blender::gpu::shader::ShaderCreateInfo::Resource::SAMPLER, blender::gpu::ShaderInterface::set_image_formats_from_info(), blender::ShaderCreateInfo::Resource::slot, blender::gpu::ShaderInterface::sort_inputs(), blender::gpu::shader::ShaderCreateInfo::specialization_constants_, blender::gpu::ShaderInterface::ssbo_attr_mask_, blender::gpu::ShaderInterface::ssbo_len_, blender::gpu::shader::ShaderCreateInfo::Resource::STORAGE_BUFFER, blender::STRNCPY(), blender::gpu::ShaderInterface::tlas_len_, blender::ShaderCreateInfo::VertIn::type, blender::gpu::ShaderInterface::ubo_get(), blender::gpu::ShaderInterface::ubo_len_, blender::gpu::shader::ShaderCreateInfo::Resource::UNIFORM_BUFFER, blender::gpu::ShaderInterface::uniform_get(), blender::gpu::ShaderInterface::uniform_len_, and blender::gpu::shader::ShaderCreateInfo::vertex_inputs_.

◆ ~MTLShaderInterface()

blender::gpu::MTLShaderInterface::~MTLShaderInterface ( )
override

Definition at line 186 of file mtl_shader_interface.mm.

Member Function Documentation

◆ enabled_accel_mask()

uint32_t blender::gpu::MTLShaderInterface::enabled_accel_mask ( ) const
inline

Definition at line 107 of file mtl_shader_interface.hh.

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

◆ ensure_argument_encoder()

id< MTLArgumentEncoder > blender::gpu::MTLShaderInterface::ensure_argument_encoder ( id< MTLFunction > mtl_function)

◆ image_name_get()

const char * blender::gpu::MTLShaderInterface::image_name_get ( int slot) const
inline

Definition at line 143 of file mtl_shader_interface.hh.

References name_at_offset().

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

◆ is_point_shader()

bool blender::gpu::MTLShaderInterface::is_point_shader ( ) const
inline

Definition at line 129 of file mtl_shader_interface.hh.

References blender::gpu::shader::POINT_SIZE.

◆ MEM_CXX_CLASS_ALLOC_FUNCS()

blender::gpu::MTLShaderInterface::MEM_CXX_CLASS_ALLOC_FUNCS ( "MTLShaderInterface" )

◆ name_at_offset()

const char * blender::gpu::MTLShaderInterface::name_at_offset ( uint32_t offset) const

◆ name_get()

const char * blender::gpu::MTLShaderInterface::name_get ( ) const
inline

◆ sampler_name_get()

const char * blender::gpu::MTLShaderInterface::sampler_name_get ( int slot) const
inline

Definition at line 148 of file mtl_shader_interface.hh.

References name_at_offset().

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

◆ use_layer()

bool blender::gpu::MTLShaderInterface::use_layer ( ) const
inline

Definition at line 112 of file mtl_shader_interface.hh.

References blender::gpu::shader::LAYER.

◆ use_samplers_argument_buffer()

bool blender::gpu::MTLShaderInterface::use_samplers_argument_buffer ( ) const
inline

◆ use_texture_atomic()

bool blender::gpu::MTLShaderInterface::use_texture_atomic ( ) const
inline

◆ use_viewport_index()

bool blender::gpu::MTLShaderInterface::use_viewport_index ( ) const
inline

Definition at line 116 of file mtl_shader_interface.hh.

References blender::gpu::shader::VIEWPORT_INDEX.

◆ vertex_buffer_mask()

uint32_t blender::gpu::MTLShaderInterface::vertex_buffer_mask ( ) const
inline

Definition at line 102 of file mtl_shader_interface.hh.


The documentation for this class was generated from the following files: