OGRE-Next
2.3
Object-Oriented Graphics Rendering Engine
|
#include <OgreVulkanRootLayout.h>
Public Member Functions | |
VulkanRootLayout (VulkanGpuProgramManager *programManager) | |
~VulkanRootLayout () | |
void | bind (VulkanDevice *device, VulkanVaoManager *vaoManager, const VulkanGlobalBindingTable &table) |
Takes an emulated D3D11/Metal-style table and binds it according to this layout's rules. More... | |
void | copyFrom (const RootLayout &rootLayout, bool bIncludeArrayBindings=true) |
void | copyTo (RootLayout &outRootLayout, bool bIncludeArrayBindings) |
Performs outRootLayout.copyFrom( this ) This function is necessary because RootLayout is a protected base class. More... | |
VkPipelineLayout | createVulkanHandles () |
Creates most of our Vulkan handles required to build a PSO. More... | |
void | dump (String &outJson) const |
Dumps the current RootLayout to a JSON string. More... | |
bool | findBindingIndex (const uint32 setIdx, const uint32 targetBindingIdx, DescBindingTypes::DescBindingTypes &outType, size_t &outRelativeSlotIndex) const |
O( N ) search to find DescBindingRange via its flattened vulkan binding idx (i.e. More... | |
bool | findParamsBuffer (uint32 shaderStage, size_t &outSetIdx, size_t &outBindingIdx) const |
Retrieves the set and binding idx of the params buffer. More... | |
void | generateRootLayoutMacros (uint32 shaderStage, ShaderSyntax shaderType, String &inOutString) const |
Generates all the macros for compiling shaders, based on our layout. More... | |
const DescBindingRange * | getDescBindingRanges (size_t setIdx) const |
const DescBindingRange * | getDescBindingRanges (size_t setIdx) const |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, const char *, int, const char *) |
void | operator delete (void *ptr, void *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, const char *, int, const char *) |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, const char *file, int line, const char *func) |
operator new, with debug line info More... | |
void * | operator new (size_t sz, void *ptr) |
placement operator new More... | |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info More... | |
bool | operator< (const VulkanRootLayout &other) const |
void | parseRootLayout (const char *rootLayout, const bool bCompute, const String &filename) |
void | validateArrayBindings (const RootLayout &groundTruth, const String &filename) const |
Validates that the array bindings in groundTruth.mArrayRanges are included in this->mArrayRanges. More... | |
Static Public Member Functions | |
static VulkanRootLayout * | findBest (VulkanRootLayout *a, VulkanRootLayout *b) |
Two root layouts can be incompatible. More... | |
Private Member Functions | |
void | dump (String &outJson) const |
Dumps the current RootLayout to a JSON string. More... | |
bool | findParamsBuffer (uint32 shaderStage, size_t &outSetIdx, size_t &outBindingIdx) const |
Retrieves the set and binding idx of the params buffer. More... | |
void | validateArrayBindings (const RootLayout &groundTruth, const String &filename) const |
Validates that the array bindings in groundTruth.mArrayRanges are included in this->mArrayRanges. More... | |
Ogre::VulkanRootLayout::VulkanRootLayout | ( | VulkanGpuProgramManager * | programManager | ) |
Ogre::VulkanRootLayout::~VulkanRootLayout | ( | ) |
void Ogre::VulkanRootLayout::bind | ( | VulkanDevice * | device, |
VulkanVaoManager * | vaoManager, | ||
const VulkanGlobalBindingTable & | table | ||
) |
Takes an emulated D3D11/Metal-style table and binds it according to this layout's rules.
This updates N descriptors (1 for each set) and binds them
device | |
vaoManager | The VaoManager so we can grab new VulkanDescriptorPools shall we need them |
table | The emulated table to bind it |
void Ogre::VulkanRootLayout::copyFrom | ( | const RootLayout & | rootLayout, |
bool | bIncludeArrayBindings = true |
||
) |
void Ogre::VulkanRootLayout::copyTo | ( | RootLayout & | outRootLayout, |
bool | bIncludeArrayBindings | ||
) |
Performs outRootLayout.copyFrom( this ) This function is necessary because RootLayout is a protected base class.
VkPipelineLayout Ogre::VulkanRootLayout::createVulkanHandles | ( | ) |
Creates most of our Vulkan handles required to build a PSO.
This function is not called by parseRootLayout because if two Root Layouts are identical, then after calling a->parseRootLayout(), instead of calling a->createVulkanHandles() we first must look for an already existing VulkanRootLayout and reuse it.
void Ogre::RootLayout::dump |
Dumps the current RootLayout to a JSON string.
|
static |
Two root layouts can be incompatible.
If so, we return nullptr
If a and b are compatible, we return the best one (one that can satisfy both a and b).
a or b can be nullptr
bool Ogre::VulkanRootLayout::findBindingIndex | ( | const uint32 | setIdx, |
const uint32 | targetBindingIdx, | ||
DescBindingTypes::DescBindingTypes & | outType, | ||
size_t & | outRelativeSlotIndex | ||
) | const |
O( N ) search to find DescBindingRange via its flattened vulkan binding idx (i.e.
reverse search)
setIdx | |
targetBindingIdx | |
outType | [out] The type located. Not touched if not found |
outRelativeSlotIndex | [out] The slot index expressed in the respective DescBindingTypes. Not touched if not found |
bool Ogre::RootLayout::findParamsBuffer |
Retrieves the set and binding idx of the params buffer.
shaderStage | See GpuProgramType |
outSetIdx | [out] Set in which it is located Value will not be modified if we return false |
outBindingIdx | [out] Binding index in which it is located Value will not be modified if we return false |
void Ogre::VulkanRootLayout::generateRootLayoutMacros | ( | uint32 | shaderStage, |
ShaderSyntax | shaderType, | ||
String & | inOutString | ||
) | const |
Generates all the macros for compiling shaders, based on our layout.
e.g. a layout like this:
will generate the following:
shaderStage | See GpuProgramType |
inOutString | [in/out] String to output our macros |
|
inline |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
|
inlineinherited |
placement operator new
|
inlineinherited |
|
inlineinherited |
array operator new, with debug line info
bool Ogre::VulkanRootLayout::operator< | ( | const VulkanRootLayout & | other | ) | const |
void Ogre::VulkanRootLayout::parseRootLayout | ( | const char * | rootLayout, |
const bool | bCompute, | ||
const String & | filename | ||
) |
void Ogre::RootLayout::validateArrayBindings |
Validates that the array bindings in groundTruth.mArrayRanges are included in this->mArrayRanges.
Will throw otherwise
groundTruth | Root Layout to compare against. Its data should've been obtrained through reflection |
filename | Filename for logging purposes if errors are found |