Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
7c9129bc
Commit
7c9129bc
authored
May 24, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV: Fix #904: Correctly check for built-in block redeclations for location check.
parent
84cc15f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
spv.noLocation.vert
Test/spv.noLocation.vert
+11
-5
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+3
-1
No files found.
Test/spv.noLocation.vert
View file @
7c9129bc
#version 450
#version 450
layout
(
location
=
1
)
in
vec4
in1
;
layout
(
location
=
1
)
in
vec4
in1
;
in
vec4
in2
;
in
vec4
in2
;
// ERROR
layout
(
location
=
3
)
in
vec4
in3
;
layout
(
location
=
3
)
in
vec4
in3
;
layout
(
location
=
1
)
out
vec4
out1
;
layout
(
location
=
1
)
out
vec4
out1
;
out
vec4
out2
;
out
vec4
out2
;
// ERROR
layout
(
location
=
3
)
out
vec4
out3
;
layout
(
location
=
3
)
out
vec4
out3
;
layout
(
location
=
10
)
out
inb1
{
layout
(
location
=
10
)
out
inb1
{
...
@@ -16,18 +16,24 @@ out inb2 {
...
@@ -16,18 +16,24 @@ out inb2 {
layout
(
location
=
12
)
vec4
a
;
layout
(
location
=
12
)
vec4
a
;
layout
(
location
=
13
)
vec4
b
;
layout
(
location
=
13
)
vec4
b
;
}
inbi2
;
}
inbi2
;
out
inb3
{
out
inb3
{
// ERROR
vec4
a
;
vec4
a
;
vec4
b
;
vec4
b
;
}
inbi3
;
}
inbi3
;
layout
(
location
=
14
)
out
struct
S1
{
vec4
a
;
}
s1
;
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
;
};
struct
SS
{
int
a
;
};
out
layout
(
location
=
15
)
SS
ss1
;
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
()
void
main
()
{
{
gl_ClipDistance
[
0
]
=
1
.
0
;
}
}
glslang/MachineIndependent/ParseHelper.cpp
View file @
7c9129bc
...
@@ -4343,7 +4343,9 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb
...
@@ -4343,7 +4343,9 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb
switch
(
qualifier
.
storage
)
{
switch
(
qualifier
.
storage
)
{
case
EvqVaryingIn
:
case
EvqVaryingIn
:
case
EvqVaryingOut
:
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"
,
""
);
error
(
loc
,
"SPIR-V requires location for user input/output"
,
"location"
,
""
);
break
;
break
;
default
:
default
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment