SPV/OpenGL: Require locations on non-opaque uniform variables.

This commit is contained in:
John Kessenich
2017-07-21 13:36:33 -06:00
parent ab0086754e
commit 67eb497002
5 changed files with 26 additions and 13 deletions

View File

@@ -1,9 +1,10 @@
glspv.frag
ERROR: 0:4: '#error' : GL_SPIRV is set ( correct , not an error )
ERROR: 0:6: '#error' : GL_SPIR is 100
ERROR: 0:14: 'input_attachment_index' : only allowed when using GLSL for Vulkan
ERROR: 0:14: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 4 compilation errors. No code generated.
ERROR: 0:14: 'f' : non-opaque uniform variables need a layout(location=L)
ERROR: 0:19: 'input_attachment_index' : only allowed when using GLSL for Vulkan
ERROR: 0:19: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 5 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link

View File

@@ -1,4 +1,4 @@
#version 330
#version 450
#ifdef GL_SPIRV
#error GL_SPIRV is set ( correct, not an error )
@@ -11,4 +11,9 @@ void main()
{
}
uniform float f; // ERROR, no location
layout(location = 2) uniform float g;
uniform sampler2D s1;
layout(location = 3) uniform sampler2D s2;
layout(input_attachment_index = 1) uniform subpassInput sub; // ERROR, no inputs

View File

@@ -1,8 +1,9 @@
#version 450
layout(constant_id = 3) const int a = 2;
uniform float f;
layout(location = 2) uniform float f;
layout(location = 4) uniform sampler2D s1;
uniform sampler2D s2;
void main()
{