HLSL: Add test for HelperInvocation.

This commit is contained in:
Hans-Kristian Arntzen 2022-03-04 10:58:40 +01:00
parent 005c14ad6a
commit 5d9fc2d903
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,26 @@
static float FragColor;
struct SPIRV_Cross_Input
{
};
struct SPIRV_Cross_Output
{
float FragColor : SV_Target0;
};
void frag_main()
{
FragColor = float(IsHelperLane());
discard;
bool _16 = IsHelperLane();
FragColor = float(_16);
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -0,0 +1,11 @@
#version 450
#extension GL_EXT_demote_to_helper_invocation : require
layout(location = 0) out float FragColor;
void main()
{
FragColor = float(gl_HelperInvocation);
demote;
FragColor = float(helperInvocationEXT());
}