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
1d585ac8
Commit
1d585ac8
authored
May 20, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV: Correctly enforce 'location' presence on in/out blocks.
Blocks have this on members, not the object.
parent
557caf24
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
6 deletions
+33
-6
spv.noLocation.vert.out
Test/baseResults/spv.noLocation.vert.out
+4
-1
spv.noLocation.vert
Test/spv.noLocation.vert
+19
-0
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+10
-5
No files found.
Test/baseResults/spv.noLocation.vert.out
View file @
1d585ac8
...
@@ -2,7 +2,10 @@ spv.noLocation.vert
...
@@ -2,7 +2,10 @@ spv.noLocation.vert
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
ERROR: spv.noLocation.vert:4: 'location' : SPIR-V requires location for user input/output
ERROR: spv.noLocation.vert:4: 'location' : SPIR-V requires location for user input/output
ERROR: spv.noLocation.vert:8: 'location' : SPIR-V requires location for user input/output
ERROR: spv.noLocation.vert:8: 'location' : SPIR-V requires location for user input/output
ERROR: 2 compilation errors. No code generated.
ERROR: spv.noLocation.vert:19: 'location' : SPIR-V requires location for user input/output
ERROR: spv.noLocation.vert:25: 'location' : SPIR-V requires location for user input/output
ERROR: spv.noLocation.vert:29: 'location' : SPIR-V requires location for user input/output
ERROR: 5 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link
SPIR-V is not generated for failed compile or link
Test/spv.noLocation.vert
View file @
1d585ac8
...
@@ -8,6 +8,25 @@ layout(location = 1) out vec4 out1;
...
@@ -8,6 +8,25 @@ layout(location = 1) out vec4 out1;
out
vec4
out2
;
out
vec4
out2
;
layout
(
location
=
3
)
out
vec4
out3
;
layout
(
location
=
3
)
out
vec4
out3
;
layout
(
location
=
10
)
out
inb1
{
vec4
a
;
vec4
b
;
}
inbi1
;
out
inb2
{
layout
(
location
=
12
)
vec4
a
;
layout
(
location
=
13
)
vec4
b
;
}
inbi2
;
out
inb3
{
vec4
a
;
vec4
b
;
}
inbi3
;
layout
(
location
=
14
)
out
struct
S1
{
vec4
a
;
}
s1
;
out
struct
S2
{
vec4
a
;
}
s2
;
struct
SS
{
int
a
;
};
out
layout
(
location
=
15
)
SS
ss1
;
out
SS
ss2
;
void
main
()
void
main
()
{
{
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
1d585ac8
...
@@ -4332,14 +4332,19 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb
...
@@ -4332,14 +4332,19 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb
default
:
default
:
break
;
break
;
}
}
}
else
if
(
spvVersion
.
spv
>
0
)
{
}
// user-variable location check, which are required for SPIR-V in/out:
// - variables have it directly,
// - blocks have it on each member (already enforced), so check first one
if
(
spvVersion
.
spv
>
0
&&
!
parsingBuiltins
&&
qualifier
.
builtIn
==
EbvNone
&&
!
qualifier
.
hasLocation
()
&&
!
intermediate
.
getAutoMapLocations
())
{
switch
(
qualifier
.
storage
)
{
switch
(
qualifier
.
storage
)
{
case
EvqVaryingIn
:
case
EvqVaryingIn
:
case
EvqVaryingOut
:
case
EvqVaryingOut
:
if
(
!
parsingBuiltins
&&
qualifier
.
builtIn
==
EbvNone
)
{
if
(
type
.
getBasicType
()
!=
EbtBlock
||
!
(
*
type
.
getStruct
())[
0
].
type
->
getQualifier
().
hasLocation
())
if
(
!
intermediate
.
getAutoMapLocations
())
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
:
break
;
break
;
...
...
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