Add a hack flag to allow subgroup bitwise or

This commit is contained in:
baldurk
2022-06-09 16:56:02 +01:00
parent a68f9ba86a
commit ed9ac9f7bf
2 changed files with 47 additions and 2 deletions
+30 -1
View File
@@ -1920,6 +1920,36 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray<ThreadState>
SetDst(bitwise.result, var);
break;
}
case Op::GroupNonUniformBitwiseOr:
{
OpGroupNonUniformBitwiseOr group(it);
ShaderVariable var;
for(size_t i = 0; i < workgroup.size(); i++)
{
if(i == 0)
{
var = workgroup[i].GetSrc(group.value);
}
else
{
ShaderVariable b = workgroup[i].GetSrc(group.value);
for(uint8_t c = 0; c < var.columns; c++)
{
#undef _IMPL
#define _IMPL(I, S, U) comp<U>(var, c) = comp<U>(var, c) | comp<U>(b, c)
IMPL_FOR_INT_TYPES(_IMPL);
}
}
}
SetDst(group.result, var);
break;
}
case Op::Not:
{
OpNot bitwise(it);
@@ -3484,7 +3514,6 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray<ThreadState>
case Op::GroupNonUniformUMax:
case Op::GroupNonUniformFMax:
case Op::GroupNonUniformBitwiseAnd:
case Op::GroupNonUniformBitwiseOr:
case Op::GroupNonUniformBitwiseXor:
case Op::GroupNonUniformLogicalAnd:
case Op::GroupNonUniformLogicalOr:
@@ -32,6 +32,10 @@
RDOC_CONFIG(bool, Vulkan_Debug_UseDebugColumnInformation, false,
"Control whether column information should be read from vulkan debug info.");
RDOC_CONFIG(bool, Vulkan_Hack_AllowNonUniformSubgroups, false,
"Allow shaders to be debugged with subgroup ops. Most subgroup ops will break, this "
"will only work for a limited set and not with the 'real' subgroup.");
// this could be cleaner if ShaderVariable wasn't a very public struct, but it's not worth it so
// we just reserve value slots that we know won't be used in opaque variables
static const uint32_t PointerVariableSlot = 0;
@@ -376,6 +380,19 @@ void Reflector::CheckDebuggable(bool &debuggable, rdcstr &debugStatus) const
break;
}
case Capability::GroupNonUniformArithmetic:
{
if(Vulkan_Hack_AllowNonUniformSubgroups())
{
supported = true;
}
else
{
supported = false;
}
break;
}
// we plan to support these but needs additional testing/proving
// physical pointers
@@ -398,7 +415,6 @@ void Reflector::CheckDebuggable(bool &debuggable, rdcstr &debugStatus) const
case Capability::Groups:
case Capability::GroupNonUniform:
case Capability::GroupNonUniformVote:
case Capability::GroupNonUniformArithmetic:
case Capability::GroupNonUniformBallot:
case Capability::GroupNonUniformShuffle:
case Capability::GroupNonUniformShuffleRelative: