mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-08 11:30:06 +00:00
SPV: Fix #904: Correctly check for built-in block redeclations for location check.
This commit is contained in:
parent
84cc15f0d0
commit
7c9129bcb7
@ -1,11 +1,11 @@
|
||||
#version 450
|
||||
|
||||
layout(location = 1) in vec4 in1;
|
||||
in vec4 in2;
|
||||
in vec4 in2; // ERROR
|
||||
layout(location = 3) in vec4 in3;
|
||||
|
||||
layout(location = 1) out vec4 out1;
|
||||
out vec4 out2;
|
||||
out vec4 out2; // ERROR
|
||||
layout(location = 3) out vec4 out3;
|
||||
|
||||
layout(location = 10) out inb1 {
|
||||
@ -16,18 +16,24 @@ out inb2 {
|
||||
layout(location = 12) vec4 a;
|
||||
layout(location = 13) vec4 b;
|
||||
} inbi2;
|
||||
out inb3 {
|
||||
out inb3 { // ERROR
|
||||
vec4 a;
|
||||
vec4 b;
|
||||
} inbi3;
|
||||
|
||||
layout(location = 14) out struct S1 { vec4 a; } s1;
|
||||
out struct S2 { vec4 a; } s2;
|
||||
out struct S2 { vec4 a; } s2; // ERROR
|
||||
|
||||
struct SS { int a; };
|
||||
out layout(location = 15) SS ss1;
|
||||
out SS ss2;
|
||||
out SS ss2; // ERROR
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
float gl_ClipDistance[2];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_ClipDistance[0] = 1.0;
|
||||
}
|
||||
|
@ -4343,7 +4343,9 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb
|
||||
switch (qualifier.storage) {
|
||||
case EvqVaryingIn:
|
||||
case EvqVaryingOut:
|
||||
if (type.getBasicType() != EbtBlock || !(*type.getStruct())[0].type->getQualifier().hasLocation())
|
||||
if (type.getBasicType() != EbtBlock ||
|
||||
(!(*type.getStruct())[0].type->getQualifier().hasLocation() &&
|
||||
(*type.getStruct())[0].type->getQualifier().builtIn == EbvNone))
|
||||
error(loc, "SPIR-V requires location for user input/output", "location", "");
|
||||
break;
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user