Blender V4.3
blender::gpu::VKShaderInterface Class Reference

#include <vk_shader_interface.hh>

Inherits blender::gpu::ShaderInterface.

Public Member Functions

 VKShaderInterface ()=default
 
void init (const shader::ShaderCreateInfo &info)
 
const VKDescriptorSet::Location descriptor_set_location (const shader::ShaderCreateInfo::Resource &resource) const
 
const std::optional< VKDescriptorSet::Locationdescriptor_set_location (const shader::ShaderCreateInfo::Resource::BindType &bind_type, int binding) const
 
const VkAccessFlags access_mask (const shader::ShaderCreateInfo::Resource::BindType &bind_type, int binding) const
 
const VKImageViewArrayed arrayed (const shader::ShaderCreateInfo::Resource::BindType &bind_type, int binding) const
 
const VKPushConstants::Layoutpush_constants_layout_get () const
 
const VKDescriptorSetLayoutInfodescriptor_set_layout_info_get () const
 
shader::Type get_attribute_type (int location) const
 
bool is_point_shader () const
 
const Span< VKResourceBindingresource_bindings_get () const
 
- Public Member Functions inherited from blender::gpu::ShaderInterface
 ShaderInterface ()
 
virtual ~ShaderInterface ()
 
void debug_print () const
 
const ShaderInputattr_get (const char *name) const
 
const ShaderInputattr_get (const int binding) const
 
const ShaderInputubo_get (const char *name) const
 
const ShaderInputubo_get (const int binding) const
 
const ShaderInputuniform_get (const char *name) const
 
const ShaderInputtexture_get (const int binding) const
 
const ShaderInputssbo_get (const char *name) const
 
const ShaderInputssbo_get (const int binding) const
 
const ShaderInputconstant_get (const char *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
 

Additional Inherited Members

- Public Attributes inherited from blender::gpu::ShaderInterface
ShaderInputinputs_ = nullptr
 
char * name_buffer_ = nullptr
 
uint attr_len_ = 0
 
uint ubo_len_ = 0
 
uint uniform_len_ = 0
 
uint ssbo_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]
 
- 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 ()
 
- 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

Definition at line 33 of file vk_shader_interface.hh.

Constructor & Destructor Documentation

◆ VKShaderInterface()

blender::gpu::VKShaderInterface::VKShaderInterface ( )
default

Member Function Documentation

◆ access_mask()

const VkAccessFlags blender::gpu::VKShaderInterface::access_mask ( const shader::ShaderCreateInfo::Resource::BindType & bind_type,
int binding ) const

Get the access mask for a binding.

Is used to build the correct resource accesses in the render graph (dispatch/draw nodes).

Will return VK_ACCESS_NONE when binding isn't found or not compatible with the given bind type.

Definition at line 356 of file vk_shader_interface.cc.

References blender::gpu::VKResourceBinding::access_mask, and blender::gpu::VKResourceBinding::bind_type.

◆ arrayed()

const VKImageViewArrayed blender::gpu::VKShaderInterface::arrayed ( const shader::ShaderCreateInfo::Resource::BindType & bind_type,
int binding ) const

Definition at line 370 of file vk_shader_interface.cc.

References blender::gpu::VKResourceBinding::arrayed, and blender::gpu::DONT_CARE.

Referenced by init().

◆ descriptor_set_layout_info_get()

const VKDescriptorSetLayoutInfo & blender::gpu::VKShaderInterface::descriptor_set_layout_info_get ( ) const
inline

Definition at line 72 of file vk_shader_interface.hh.

◆ descriptor_set_location() [1/2]

const VKDescriptorSet::Location blender::gpu::VKShaderInterface::descriptor_set_location ( const shader::ShaderCreateInfo::Resource & resource) const

◆ descriptor_set_location() [2/2]

const std::optional< VKDescriptorSet::Location > blender::gpu::VKShaderInterface::descriptor_set_location ( const shader::ShaderCreateInfo::Resource::BindType & bind_type,
int binding ) const

◆ get_attribute_type()

shader::Type blender::gpu::VKShaderInterface::get_attribute_type ( int location) const
inline

Definition at line 77 of file vk_shader_interface.hh.

References blender::gpu::ShaderInterface::attr_types_.

◆ init()

void blender::gpu::VKShaderInterface::init ( const shader::ShaderCreateInfo & info)

Definition at line 16 of file vk_shader_interface.cc.

References blender::gpu::ARRAYED, arrayed(), blender::gpu::ShaderInterface::attr_len_, blender::gpu::ShaderInterface::attr_types_, blender::gpu::shader::ShaderCreateInfo::batch_resources_, blender::gpu::BIND_SPACE_IMAGE_OFFSET, blender::gpu::ShaderInput::binding, BLI_assert, BLI_assert_msg, blender::gpu::ShaderInterface::builtin_blocks_, blender::gpu::ShaderInterface::builtin_uniform_block_name(), blender::gpu::ShaderInterface::builtin_uniform_name(), blender::gpu::shader::ShaderCreateInfo::builtins_, blender::gpu::ShaderInterface::builtins_, blender::gpu::ShaderInterface::constant_len_, blender::gpu::ShaderInterface::copy_input_name(), blender::gpu::shader::DEPTH_2D_ARRAY, blender::gpu::shader::DEPTH_CUBE_ARRAY, descriptor_set_location(), blender::gpu::VKPushConstants::Layout::determine_storage_type(), blender::gpu::VKBackend::device, blender::gpu::DONT_CARE, ELEM, blender::gpu::ShaderInterface::enabled_attr_mask_, blender::Vector< T, InlineBufferCapacity, Allocator >::extend(), blender::gpu::shader::FLOAT_1D_ARRAY, blender::gpu::shader::FLOAT_2D_ARRAY, blender::gpu::shader::FLOAT_CUBE_ARRAY, blender::gpu::shader::ShaderCreateInfo::geometry_resources_, blender::gpu::VKBackend::get(), GPU_NUM_UNIFORM_BLOCKS, GPU_NUM_UNIFORMS, blender::gpu::VKPushConstants::Layout::init(), blender::gpu::ShaderInterface::input_name_get(), blender::gpu::ShaderInterface::inputs_, blender::gpu::shader::INT_1D_ARRAY, blender::gpu::shader::INT_2D_ARRAY, blender::gpu::shader::INT_2D_ARRAY_ATOMIC, blender::gpu::shader::INT_CUBE_ARRAY, blender::gpu::shader::ShaderCreateInfo::interface_names_size_, blender::gpu::ShaderInput::location, MEM_calloc_arrayN, MEM_mallocN, blender::gpu::ShaderInterface::name_buffer_, blender::gpu::NOT_ARRAYED, blender::gpu::shader::ShaderCreateInfo::pass_resources_, push_constant(), blender::gpu::shader::ShaderCreateInfo::push_constants_, blender::gpu::shader::ShaderCreateInfo::Resource::SAMPLER, blender::gpu::shader::SHADOW_2D_ARRAY, blender::gpu::shader::SHADOW_CUBE_ARRAY, blender::gpu::ShaderInterface::sort_inputs(), blender::gpu::shader::ShaderCreateInfo::specialization_constants_, blender::gpu::ShaderInterface::ssbo_attr_mask_, blender::gpu::ShaderInterface::ssbo_len_, STREQ, blender::gpu::shader::ShaderCreateInfo::subpass_inputs_, blender::gpu::ShaderInterface::ubo_get(), blender::gpu::ShaderInterface::ubo_len_, blender::gpu::shader::UINT_1D_ARRAY, blender::gpu::shader::UINT_2D_ARRAY, blender::gpu::shader::UINT_2D_ARRAY_ATOMIC, blender::gpu::shader::UINT_CUBE_ARRAY, blender::gpu::shader::ShaderCreateInfo::Resource::UNIFORM_BUFFER, blender::gpu::VKPushConstants::UNIFORM_BUFFER, blender::gpu::ShaderInterface::uniform_get(), blender::gpu::ShaderInterface::uniform_len_, and blender::gpu::shader::ShaderCreateInfo::vertex_inputs_.

Referenced by blender::gpu::VKShader::init().

◆ is_point_shader()

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

Definition at line 82 of file vk_shader_interface.hh.

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

◆ push_constants_layout_get()

const VKPushConstants::Layout & blender::gpu::VKShaderInterface::push_constants_layout_get ( ) const
inline

Get the Layout of the shader.

Definition at line 67 of file vk_shader_interface.hh.

Referenced by blender::gpu::VKShader::finalize(), and blender::gpu::VKShader::resources_declare().

◆ resource_bindings_get()

const Span< VKResourceBinding > blender::gpu::VKShaderInterface::resource_bindings_get ( ) const
inline

Definition at line 87 of file vk_shader_interface.hh.


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