Merge pull request #337 from msiglreith/early_fragment_tests
HLSL: Support early_fragment_tests attribute
This commit is contained in:
commit
ac607e5382
9
reference/shaders-hlsl/frag/early-fragment-test.frag
Normal file
9
reference/shaders-hlsl/frag/early-fragment-test.frag
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
void frag_main()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[earlydepthstencil]
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
frag_main();
|
||||||
|
}
|
7
shaders-hlsl/frag/early-fragment-test.frag
Normal file
7
shaders-hlsl/frag/early-fragment-test.frag
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#version 420
|
||||||
|
|
||||||
|
layout(early_fragment_tests) in;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
}
|
@ -1437,7 +1437,9 @@ void CompilerHLSL::emit_hlsl_entry_point()
|
|||||||
|
|
||||||
auto &execution = get_entry_point();
|
auto &execution = get_entry_point();
|
||||||
|
|
||||||
if (execution.model == ExecutionModelGLCompute)
|
switch (execution.model)
|
||||||
|
{
|
||||||
|
case ExecutionModelGLCompute:
|
||||||
{
|
{
|
||||||
SpecializationConstant wg_x, wg_y, wg_z;
|
SpecializationConstant wg_x, wg_y, wg_z;
|
||||||
get_work_group_size_specialization_constants(wg_x, wg_y, wg_z);
|
get_work_group_size_specialization_constants(wg_x, wg_y, wg_z);
|
||||||
@ -1454,6 +1456,14 @@ void CompilerHLSL::emit_hlsl_entry_point()
|
|||||||
z = get<SPIRConstant>(wg_z.id).scalar();
|
z = get<SPIRConstant>(wg_z.id).scalar();
|
||||||
|
|
||||||
statement("[numthreads(", x, ", ", y, ", ", z, ")]");
|
statement("[numthreads(", x, ", ", y, ", ", z, ")]");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ExecutionModelFragment:
|
||||||
|
if (execution.flags & (1ull << ExecutionModeEarlyFragmentTests))
|
||||||
|
statement("[earlydepthstencil]");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
statement(require_output ? "SPIRV_Cross_Output " : "void ", "main(", merge(arguments), ")");
|
statement(require_output ? "SPIRV_Cross_Output " : "void ", "main(", merge(arguments), ")");
|
||||||
|
Loading…
Reference in New Issue
Block a user