diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-07-17 10:51:18 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-07-17 10:54:05 -0700 |
| commit | dc0e9d7bca21d8a67ec9f044c0d390bda6ebfcbf (patch) | |
| tree | 2db423b4b6e8420e614cb49fe7534f2b7591078d /tests/cross-compile/gl-layer-pick-version.slang | |
| parent | 0b4992fb69e359a7e566cca42331a196904556f5 (diff) | |
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.
Diffstat (limited to 'tests/cross-compile/gl-layer-pick-version.slang')
| -rw-r--r-- | tests/cross-compile/gl-layer-pick-version.slang | 11 |
1 files changed, 11 insertions, 0 deletions
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)); +} |
