Blender V4.3
blender::gpu::VKPushConstants::Layout Struct Reference

#include <vk_push_constants.hh>

Classes

struct  PushConstant
 

Public Member Functions

void init (const shader::ShaderCreateInfo &info, const VKShaderInterface &interface, StorageType storage_type, VKDescriptorSet::Location location)
 
StorageType storage_type_get () const
 
VKDescriptorSet::Location descriptor_set_location_get () const
 
uint32_t size_in_bytes () const
 
const PushConstantfind (int32_t location) const
 
void debug_print () const
 

Static Public Member Functions

static StorageType determine_storage_type (const shader::ShaderCreateInfo &info, const VKDevice &device)
 

Static Public Attributes

static constexpr StorageType STORAGE_TYPE_DEFAULT = StorageType::PUSH_CONSTANTS
 
static constexpr StorageType STORAGE_TYPE_FALLBACK = StorageType::UNIFORM_BUFFER
 

Detailed Description

Describe the layout of the push constants and the storage type that should be used.

Definition at line 69 of file vk_push_constants.hh.

Member Function Documentation

◆ debug_print()

void blender::gpu::VKPushConstants::Layout::debug_print ( ) const

◆ descriptor_set_location_get()

VKDescriptorSet::Location blender::gpu::VKPushConstants::Layout::descriptor_set_location_get ( ) const
inline

Get the binding location for the uniform buffer.

Only valid when storage_type=StorageType::UNIFORM_BUFFER.

Definition at line 135 of file vk_push_constants.hh.

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

◆ determine_storage_type()

VKPushConstants::StorageType blender::gpu::VKPushConstants::Layout::determine_storage_type ( const shader::ShaderCreateInfo & info,
const VKDevice & device )
static

Return the desired storage type that can fit the push constants of the given shader create info, matching the limits of the given device.

Returns:

Definition at line 52 of file vk_push_constants.cc.

References blender::gpu::VKPushConstants::NONE, blender::gpu::VKDevice::physical_device_properties_get(), blender::gpu::shader::ShaderCreateInfo::push_constants_, STORAGE_TYPE_DEFAULT, STORAGE_TYPE_FALLBACK, and blender::gpu::struct_size().

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

◆ find()

const VKPushConstants::Layout::PushConstant * blender::gpu::VKPushConstants::Layout::find ( int32_t location) const

Find the push constant layout for the given location. Location = ShaderInput.location.

Definition at line 96 of file vk_push_constants.cc.

References push_constant().

◆ init()

void blender::gpu::VKPushConstants::Layout::init ( const shader::ShaderCreateInfo & info,
const VKShaderInterface & interface,
StorageType storage_type,
VKDescriptorSet::Location location )

Initialize the push constants of the given shader create info with the binding location.

interface: Uniform locations of the interface are used as lookup key. storage_type: The type of storage for push constants to use. location: When storage_type=StorageType::UNIFORM_BUFFER this contains the location in the descriptor set where the uniform buffer can be bound.

Definition at line 78 of file vk_push_constants.cc.

References BLI_assert, blender::gpu::init_struct(), and blender::gpu::VKPushConstants::UNIFORM_BUFFER.

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

◆ size_in_bytes()

uint32_t blender::gpu::VKPushConstants::Layout::size_in_bytes ( ) const
inline

Get the size needed to store the push constants.

Definition at line 143 of file vk_push_constants.hh.

Referenced by blender::gpu::VKPushConstants::create_resource(), and blender::gpu::VKPushConstants::VKPushConstants().

◆ storage_type_get()

StorageType blender::gpu::VKPushConstants::Layout::storage_type_get ( ) const
inline

Member Data Documentation

◆ STORAGE_TYPE_DEFAULT

StorageType blender::gpu::VKPushConstants::Layout::STORAGE_TYPE_DEFAULT = StorageType::PUSH_CONSTANTS
staticconstexpr

Definition at line 70 of file vk_push_constants.hh.

Referenced by determine_storage_type().

◆ STORAGE_TYPE_FALLBACK

StorageType blender::gpu::VKPushConstants::Layout::STORAGE_TYPE_FALLBACK = StorageType::UNIFORM_BUFFER
staticconstexpr

Definition at line 71 of file vk_push_constants.hh.

Referenced by determine_storage_type().


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