From dc0e9d7bca21d8a67ec9f044c0d390bda6ebfcbf Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 17 Jul 2017 10:51:18 -0700 Subject: Pick correct GLSL version when `gl_Layer` used `gl_Layer` as a fragment input requires at least version 4.30 of GLSL, so we try to track that information when we see the name used. Note that this does *not* override a user-specified `#version` line. This required re-ordering when lowering happens relative to emitting the `#version` directive, since this code works by actually modifying the chosen profile for the entry point. Yes, that is kind of gross and we should do something cleaner in the long term. --- tests/cross-compile/gl-layer-pick-version.slang | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/cross-compile/gl-layer-pick-version.slang (limited to 'tests/cross-compile/gl-layer-pick-version.slang') diff --git a/tests/cross-compile/gl-layer-pick-version.slang b/tests/cross-compile/gl-layer-pick-version.slang new file mode 100644 index 000000000..c68d68427 --- /dev/null +++ b/tests/cross-compile/gl-layer-pick-version.slang @@ -0,0 +1,11 @@ +//TEST:CROSS_COMPILE: -profile ps_5_0 -entry main -target spirv-assembly + +struct VS_OUT +{ + nointerpolation uint layerID : SV_RenderTargetArrayIndex; +}; + +float4 main(VS_OUT vsOut) : SV_Target +{ + return float4(float(vsOut.layerID)); +} -- cgit v1.2.3