mirror of
https://github.com/KhronosGroup/SPIRV-Cross.git
synced 2024-11-09 22:00:05 +00:00
Also consider NonSemantic ExtInst in block_is_noop.
This commit is contained in:
parent
9d8ef6b36c
commit
bcbe33ad11
@ -8,19 +8,9 @@ layout(binding = 0, std430) buffer SSBO
|
||||
|
||||
void main()
|
||||
{
|
||||
int i = 0;
|
||||
for (;;)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (i < 4)
|
||||
{
|
||||
_64.v[i] += 10;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
_64.v[i] += 10;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -644,7 +644,8 @@ struct SPIRExtension : IVariant
|
||||
SPV_AMD_shader_trinary_minmax,
|
||||
SPV_AMD_gcn_shader,
|
||||
NonSemanticDebugPrintf,
|
||||
NonSemanticShaderDebugInfo
|
||||
NonSemanticShaderDebugInfo,
|
||||
NonSemanticGeneric
|
||||
};
|
||||
|
||||
explicit SPIRExtension(Extension ext_)
|
||||
|
@ -1481,18 +1481,26 @@ bool Compiler::block_is_noop(const SPIRBlock &block) const
|
||||
switch (op)
|
||||
{
|
||||
// Non-Semantic instructions.
|
||||
case OpNop:
|
||||
case OpSourceContinued:
|
||||
case OpSource:
|
||||
case OpSourceExtension:
|
||||
case OpName:
|
||||
case OpMemberName:
|
||||
case OpString:
|
||||
case OpLine:
|
||||
case OpNoLine:
|
||||
case OpModuleProcessed:
|
||||
break;
|
||||
|
||||
case OpExtInst:
|
||||
{
|
||||
auto *ops = stream(i);
|
||||
auto ext = get<SPIRExtension>(ops[2]).ext;
|
||||
|
||||
bool ext_is_nonsemantic_only =
|
||||
ext == SPIRExtension::NonSemanticShaderDebugInfo ||
|
||||
ext == SPIRExtension::SPV_debug_info ||
|
||||
ext == SPIRExtension::NonSemanticGeneric;
|
||||
|
||||
if (!ext_is_nonsemantic_only)
|
||||
return false;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -13320,7 +13320,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
|
||||
emit_spv_amd_gcn_shader_op(ops[0], ops[1], ops[3], &ops[4], length - 4);
|
||||
}
|
||||
else if (ext == SPIRExtension::SPV_debug_info ||
|
||||
ext == SPIRExtension::NonSemanticShaderDebugInfo)
|
||||
ext == SPIRExtension::NonSemanticShaderDebugInfo ||
|
||||
ext == SPIRExtension::NonSemanticGeneric)
|
||||
{
|
||||
break; // Ignore SPIR-V debug information extended instructions.
|
||||
}
|
||||
|
@ -295,6 +295,8 @@ void Parser::parse(const Instruction &instruction)
|
||||
spirv_ext = SPIRExtension::NonSemanticDebugPrintf;
|
||||
else if (ext == "NonSemantic.Shader.DebugInfo.100")
|
||||
spirv_ext = SPIRExtension::NonSemanticShaderDebugInfo;
|
||||
else if (ext.find("NonSemantic.") == 0)
|
||||
spirv_ext = SPIRExtension::NonSemanticGeneric;
|
||||
|
||||
set<SPIRExtension>(id, spirv_ext);
|
||||
// Other SPIR-V extensions which have ExtInstrs are currently not supported.
|
||||
|
Loading…
Reference in New Issue
Block a user