mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Handle GLSL (not SPIR-V) being passed to shader module create.
* We can't analyse or reflect it at all, but we should at least pass it through. * Currently invalid but there will probably be extensions that allow this, whether or not we'll allow them is a different matter.
This commit is contained in:
@@ -330,8 +330,16 @@ void VulkanCreationInfo::ImageView::Init(VulkanResourceManager *resourceMan, con
|
||||
|
||||
void VulkanCreationInfo::ShaderModule::Init(VulkanResourceManager *resourceMan, const VkShaderModuleCreateInfo* pCreateInfo)
|
||||
{
|
||||
RDCASSERT(pCreateInfo->codeSize % sizeof(uint32_t) == 0);
|
||||
ParseSPIRV((uint32_t *)pCreateInfo->pCode, pCreateInfo->codeSize/sizeof(uint32_t), spirv);
|
||||
const uint32_t SPIRVMagic = 0x07230203;
|
||||
if(pCreateInfo->codeSize < 4 || memcmp(pCreateInfo->pCode, &SPIRVMagic, sizeof(SPIRVMagic)))
|
||||
{
|
||||
RDCWARN("Shader not provided with SPIR-V");
|
||||
}
|
||||
else
|
||||
{
|
||||
RDCASSERT(pCreateInfo->codeSize % sizeof(uint32_t) == 0);
|
||||
ParseSPIRV((uint32_t *)pCreateInfo->pCode, pCreateInfo->codeSize/sizeof(uint32_t), spirv);
|
||||
}
|
||||
|
||||
spirv.MakeReflection(&reflTemplate, &mapping);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user