From e21d5ad650130631e17662ce8f22d15315ab597a Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 21 Nov 2018 13:41:34 -0500 Subject: Feature/early depth stencil (#727) * First pass support for early depth stencil. * Add a simple test to check if output has attributes. * Use cross compilation to test [earlydepthstencil] on glsl. * If target is dxil, use dxc to test against. Add hlsl to test earlydepthstencil against. * * Added spSessionHasCompileTargetSupport * Made slang-test use spSessionHasCompileTargetSupport to ignore tests that cannot run --- source/slang/emit.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'source/slang/emit.cpp') diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index a3b99691d..bf98a1b24 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -4702,6 +4702,14 @@ struct EmitVisitor break; } + case Stage::Pixel: + { + if (irFunc->findDecoration()) + { + emit("[earlydepthstencil]\n"); + } + break; + } // TODO: There are other stages that will need this kind of handling. default: break; @@ -4709,7 +4717,7 @@ struct EmitVisitor } void emitIREntryPointAttributes_GLSL( - IRFunc* /*irFunc*/, + IRFunc* irFunc, EmitContext* /*ctx*/, EntryPointLayout* entryPointLayout) { @@ -4805,6 +4813,15 @@ struct EmitVisitor } break; + case Stage::Pixel: + { + if (irFunc->findDecoration()) + { + // https://www.khronos.org/opengl/wiki/Early_Fragment_Test + emit("layout(early_fragment_tests) in;\n"); + } + break; + } // TODO: There are other stages that will need this kind of handling. default: break; -- cgit v1.2.3