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 --- tests/cross-compile/early-depth-stencil.hlsl | 9 +++++++++ tests/cross-compile/early-depth-stencil.hlsl.glsl | 16 ++++++++++++++++ tests/cross-compile/early-depth-stencil.hlsl.hlsl | 8 ++++++++ 3 files changed, 33 insertions(+) create mode 100644 tests/cross-compile/early-depth-stencil.hlsl create mode 100644 tests/cross-compile/early-depth-stencil.hlsl.glsl create mode 100644 tests/cross-compile/early-depth-stencil.hlsl.hlsl (limited to 'tests') diff --git a/tests/cross-compile/early-depth-stencil.hlsl b/tests/cross-compile/early-depth-stencil.hlsl new file mode 100644 index 000000000..b40a29aba --- /dev/null +++ b/tests/cross-compile/early-depth-stencil.hlsl @@ -0,0 +1,9 @@ +//TEST:CROSS_COMPILE:-target spirv-assembly -entry main -stage fragment +//TEST:CROSS_COMPILE:-profile ps_6_0 -target dxil-assembly -entry main + +[earlydepthstencil] +float4 main(): SV_Target +{ + return float4(1, 0, 0, 1); +} + diff --git a/tests/cross-compile/early-depth-stencil.hlsl.glsl b/tests/cross-compile/early-depth-stencil.hlsl.glsl new file mode 100644 index 000000000..73e258a82 --- /dev/null +++ b/tests/cross-compile/early-depth-stencil.hlsl.glsl @@ -0,0 +1,16 @@ +//TEST_IGNORE_FILE: +#version 450 +layout(row_major) uniform; +layout(row_major) buffer; + +#line 5 0 +layout(location = 0) +out vec4 _S1; + +#line 5 +layout(early_fragment_tests) in; +void main() +{ + _S1 = vec4(float(1), float(0), float(0), float(1)); + return; +} diff --git a/tests/cross-compile/early-depth-stencil.hlsl.hlsl b/tests/cross-compile/early-depth-stencil.hlsl.hlsl new file mode 100644 index 000000000..378c5c0a1 --- /dev/null +++ b/tests/cross-compile/early-depth-stencil.hlsl.hlsl @@ -0,0 +1,8 @@ +//TEST_IGNORE_FILE: +#pragma pack_matrix(column_major) + +[earlydepthstencil] +vector main() : SV_TARGET +{ + return vector((float) 1, (float) 0, (float) 0, (float) 1); +} -- cgit v1.2.3