summaryrefslogtreecommitdiff
path: root/source/slang/emit.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2018-11-21 13:41:34 -0500
committerGitHub <noreply@github.com>2018-11-21 13:41:34 -0500
commite21d5ad650130631e17662ce8f22d15315ab597a (patch)
treea1f5053efebc6184d21b0151e38ba1a52e74b07c /source/slang/emit.cpp
parent9bb11b69a08c66e2857f439837e2253658aed9a4 (diff)
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
Diffstat (limited to 'source/slang/emit.cpp')
-rw-r--r--source/slang/emit.cpp19
1 files changed, 18 insertions, 1 deletions
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<IREarlyDepthStencilDecoration>())
+ {
+ 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<IREarlyDepthStencilDecoration>())
+ {
+ // 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;