DXIL Reflection for compute shaders correctly detect threadIdInGroup

Searches for "dx.op.threadId" was also incorrectly matching "dx.op.threadIdInGroup"
This commit is contained in:
Jake Turner
2024-06-26 08:38:34 +01:00
parent 419d321a4a
commit 3373f4b50e
+11 -10
View File
@@ -576,7 +576,17 @@ void Program::FetchComputeProperties(DXBC::Reflection *reflection)
{
const Function &f = *m_Functions[i];
if(f.name.beginsWith("dx.op.threadId"))
// Match "dx.op.threadIdGroup" before "dx.op.threadId"
if(f.name.beginsWith("dx.op.threadIdInGroup"))
{
SigParameter param;
param.systemValue = ShaderBuiltin::GroupThreadIndex;
param.compCount = 3;
param.regChannelMask = param.channelUsedMask = 0x7;
param.semanticIdxName = param.semanticName = "threadIdInGroup";
reflection->InputSig.push_back(param);
}
else if(f.name.beginsWith("dx.op.threadId"))
{
SigParameter param;
param.systemValue = ShaderBuiltin::DispatchThreadIndex;
@@ -594,15 +604,6 @@ void Program::FetchComputeProperties(DXBC::Reflection *reflection)
param.semanticIdxName = param.semanticName = "groupID";
reflection->InputSig.push_back(param);
}
else if(f.name.beginsWith("dx.op.threadIdInGroup"))
{
SigParameter param;
param.systemValue = ShaderBuiltin::GroupThreadIndex;
param.compCount = 3;
param.regChannelMask = param.channelUsedMask = 0x7;
param.semanticIdxName = param.semanticName = "threadIdInGroup";
reflection->InputSig.push_back(param);
}
else if(f.name.beginsWith("dx.op.flattenedThreadIdInGroup"))
{
SigParameter param;