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
934855a6
Commit
934855a6
authored
Jul 19, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue #382: Detect implicitly-sized atomic_uint arrays.
parent
f2cfe270
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
420.frag
Test/420.frag
+2
-0
420.frag.out
Test/baseResults/420.frag.out
+3
-0
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+12
-2
No files found.
Test/420.frag
View file @
934855a6
...
...
@@ -10,3 +10,5 @@ void main()
layout
(
depth_less
)
in
float
depth
;
// ERROR: depth_less only applies to gl_FragDepth
layout
(
depth_any
)
out
float
gl_FragDepth
;
// ERROR, done after use
layout
(
binding
=
0
)
uniform
atomic_uint
a
[];
Test/baseResults/420.frag.out
View file @
934855a6
...
...
@@ -3,6 +3,7 @@ Warning, version 420 is not yet complete; most version-specific features are pre
ERROR: 0:4: 'redeclaration' : all redeclarations must use the same depth layout on gl_FragDepth
ERROR: 0:11: 'layout qualifier' : can only apply depth layout to gl_FragDepth
ERROR: 0:12: 'gl_FragDepth' : cannot redeclare after use
WARNING: 0:14: 'atomic_uint' : implicitly sized atomic_uint array treated as having one element for tracking the default offset
ERROR: 3 compilation errors. No code generated.
...
...
@@ -20,6 +21,7 @@ ERROR: node is still EOpNull!
0:? 'gl_FragDepth' (gl_FragDepth float FragDepth)
0:? 'gl_FragDepth' (gl_FragDepth float FragDepth)
0:? 'depth' (smooth in float)
0:? 'a' (layout(binding=0 offset=0 ) uniform implicitly-sized array of atomic_uint)
Linked fragment stage:
...
...
@@ -39,4 +41,5 @@ ERROR: node is still EOpNull!
0:? 'gl_FragDepth' (gl_FragDepth float FragDepth)
0:? 'gl_FragDepth' (gl_FragDepth float FragDepth)
0:? 'depth' (smooth in float)
0:? 'a' (layout(binding=0 offset=0 ) uniform 1-element array of atomic_uint)
glslang/MachineIndependent/ParseHelper.cpp
View file @
934855a6
...
...
@@ -4753,8 +4753,18 @@ void TParseContext::fixOffset(const TSourceLoc& loc, TSymbol& symbol)
// Check for overlap
int
numOffsets
=
4
;
if
(
symbol
.
getType
().
isArray
())
numOffsets
*=
symbol
.
getType
().
getCumulativeArraySize
();
if
(
symbol
.
getType
().
isArray
())
{
if
(
symbol
.
getType
().
isExplicitlySizedArray
())
numOffsets
*=
symbol
.
getType
().
getCumulativeArraySize
();
else
{
// TODO: functionality: implicitly-sized atomic_uint arrays.
// We don't know the full size until later. This might
// be a specification problem, will report to Khronos. For the
// cases that is not true, the rest of the checking would need
// to be done at link time instead of compile time.
warn
(
loc
,
"implicitly sized atomic_uint array treated as having one element for tracking the default offset"
,
"atomic_uint"
,
""
);
}
}
int
repeated
=
intermediate
.
addUsedOffsets
(
qualifier
.
layoutBinding
,
offset
,
numOffsets
);
if
(
repeated
>=
0
)
error
(
loc
,
"atomic counters sharing the same offset:"
,
"offset"
,
"%d"
,
repeated
);
...
...
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