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:
baldurk
2016-04-24 13:30:30 +02:00
parent 868ec1da5c
commit 4c609ab714
+2 -18
View File
@@ -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);
}
}