Nameless Engine
Loading...
Searching...
No Matches
ne::DescriptorSetLayoutGenerator Class Reference

#include <DescriptorSetLayoutGenerator.h>

Classes

struct  Collected
 
struct  Generated
 

Public Member Functions

 DescriptorSetLayoutGenerator (const DescriptorSetLayoutGenerator &)=delete
 
DescriptorSetLayoutGeneratoroperator= (const DescriptorSetLayoutGenerator &)=delete
 

Static Public Member Functions

static std::variant< Collected, ErrorcollectInfoFromBytecode (void *pSpirvBytecode, size_t iSizeInBytes)
 
static std::variant< Generated, ErrorgenerateGraphics (VulkanRenderer *pRenderer, GlslShader *pVertexShader, GlslShader *pFragmentShader)
 
static std::variant< Generated, ErrorgenerateCompute (VulkanRenderer *pRenderer, GlslShader *pComputeShader)
 

Static Private Member Functions

static std::variant< std::pair< VkDescriptorSetLayoutBinding, VkDescriptorBindingFlags >, ErrorgenerateLayoutBinding (uint32_t iBindingIndex, const Collected::DescriptorSetLayoutBindingInfo &bindingInfo, bool bIsComputeShader)
 

Detailed Description

Generates Descriptor Set Layout based on GLSL code.

Member Function Documentation

◆ collectInfoFromBytecode()

std::variant< DescriptorSetLayoutGenerator::Collected, Error > ne::DescriptorSetLayoutGenerator::collectInfoFromBytecode ( void *  pSpirvBytecode,
size_t  iSizeInBytes 
)
static

Collection information from the specified SPIR-V bytecode that can be used to generate a descriptor set layout.

Parameters
pSpirvBytecodeSPIR-V bytecode to analyze.
iSizeInBytesSize of bytecode in bytes.
Returns
Error if something went wrong, otherwise collected info.

◆ generateCompute()

std::variant< DescriptorSetLayoutGenerator::Generated, Error > ne::DescriptorSetLayoutGenerator::generateCompute ( VulkanRenderer pRenderer,
GlslShader pComputeShader 
)
static

Generates a new descriptor layout, pool and descriptor sets using the specified compute shader.

Remarks
Expects that descriptor layout information is already collected for both shaders (see collectInfoFromBytecode), otherwise returns error.
Parameters
pRendererVulkan renderer.
pComputeShaderCompute shader.
Returns
Error if something went wrong, otherwise generated descriptor layout data.

◆ generateGraphics()

std::variant< DescriptorSetLayoutGenerator::Generated, Error > ne::DescriptorSetLayoutGenerator::generateGraphics ( VulkanRenderer pRenderer,
GlslShader pVertexShader,
GlslShader pFragmentShader 
)
static

Generates a new descriptor layout, pool and descriptor sets using the specified vertex and fragment shaders.

Remarks
Expects that descriptor layout information is already collected for both shaders (see collectInfoFromBytecode), otherwise returns error.
Parameters
pRendererVulkan renderer.
pVertexShaderVertex shader.
pFragmentShaderFragment shader. Specify nullptr to generate descriptor layout only for vertex shader.
Returns
Error if something went wrong, otherwise generated descriptor layout data.

◆ generateLayoutBinding()

std::variant< std::pair< VkDescriptorSetLayoutBinding, VkDescriptorBindingFlags >, Error > ne::DescriptorSetLayoutGenerator::generateLayoutBinding ( uint32_t  iBindingIndex,
const Collected::DescriptorSetLayoutBindingInfo bindingInfo,
bool  bIsComputeShader 
)
staticprivate

Generates Vulkan layout binding that could be used to create a descriptor set layout.

Parameters
iBindingIndexIndex of the binding that was specified in the GLSL code.
bindingInfoInformation about the GLSL resource used in this binding.
bIsComputeShadertrue if this binding is being generated for a compute shader, otherwise false.
Returns
Error if something went wrong, otherwise generated binding with flags.

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