mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +00:00
Don't accept GLSL as shaders
* This isn't how they're passed even in the horrible NV extension that I won't be supporting
This commit is contained in:
@@ -495,23 +495,7 @@ void VulkanCreationInfo::ShaderModule::Init(VulkanResourceManager *resourceMan,
|
||||
}
|
||||
else
|
||||
{
|
||||
static const unsigned int MagicNumber = 0x07230203; // SPIR-V magic number
|
||||
|
||||
// is the SPIR-V version 0? assume GLSL
|
||||
|
||||
if(pCreateInfo->pCode[0] == MagicNumber && pCreateInfo->pCode[1] == 0)
|
||||
{
|
||||
// GLSL - compile to SPIR-V ourselves
|
||||
const char *src = (const char *)(pCreateInfo->pCode+3);
|
||||
vector<string> srcs; srcs.push_back(src);
|
||||
vector<uint32_t> spirv_code;
|
||||
string ret = CompileSPIRV((SPIRVShaderStage)StageIndex((VkShaderStageFlagBits)pCreateInfo->pCode[2]), srcs, spirv_code);
|
||||
ParseSPIRV(&spirv_code[0], spirv_code.size(), spirv);
|
||||
}
|
||||
else
|
||||
{
|
||||
RDCASSERT(pCreateInfo->codeSize % sizeof(uint32_t) == 0);
|
||||
ParseSPIRV((uint32_t *)pCreateInfo->pCode, pCreateInfo->codeSize/sizeof(uint32_t), spirv);
|
||||
}
|
||||
RDCASSERT(pCreateInfo->codeSize % sizeof(uint32_t) == 0);
|
||||
ParseSPIRV((uint32_t *)pCreateInfo->pCode, pCreateInfo->codeSize/sizeof(uint32_t), spirv);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user