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
3cd0024e
Commit
3cd0024e
authored
Sep 30, 2015
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GLSL front-end: Check recursively for opaque types in a block; these are all illegal.
parent
ee21fc90
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
10 deletions
+23
-10
300block.frag
Test/300block.frag
+2
-2
300block.frag.out
Test/baseResults/300block.frag.out
+3
-2
310.vert.out
Test/baseResults/310.vert.out
+1
-1
Types.h
glslang/Include/Types.h
+13
-0
revision.h
glslang/Include/revision.h
+2
-2
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+2
-3
No files found.
Test/300block.frag
View file @
3cd0024e
...
...
@@ -18,10 +18,10 @@ uniform fooBlock {
uvec4
bv
;
uniform
mat2
bm2
;
lowp
isampler2D
sampler
;
// ERROR
struct
T2
{
// ERROR
struct
T2
{
// ERROR
int
a
;
}
t
;
S
fbs
;
S
fbs
;
// ERROR, contains a sampler
};
uniform
barBlock
{
...
...
Test/baseResults/300block.frag.out
View file @
3cd0024e
300block.frag
ERROR: 0:10: '' : cannot nest a structure definition inside a structure or block
ERROR: 0:21: '' : cannot nest a structure definition inside a structure or block
ERROR: 0:20: 'sampler' : member of block cannot be a sampler type
ERROR: 0:20: 'sampler' : member of block cannot be or contain a sampler, image, or atomic_uint type
ERROR: 0:24: 'fbs' : member of block cannot be or contain a sampler, image, or atomic_uint type
ERROR: 0:45: 'variable indexing uniform block array' : not supported for this version or the enabled extensions
ERROR: 0:46: 'fooBlock' : cannot be used (maybe an instance name is needed)
ERROR: 0:46: 'fooBlock' : undeclared identifier
...
...
@@ -15,7 +16,7 @@ ERROR: 0:55: 'barBlockArray' : cannot be used (maybe an instance name is needed)
ERROR: 0:55: 'barBlockArray' : undeclared identifier
ERROR: 0:55: '*' : wrong operand types: no operation '*' exists that takes a left-hand operand of type 'const int' and a right operand of type 'temp float' (or there is no acceptable conversion)
ERROR: 0:58: 'fooBlock' : redefinition
ERROR: 1
6
compilation errors. No code generated.
ERROR: 1
7
compilation errors. No code generated.
Shader version: 300
...
...
Test/baseResults/310.vert.out
View file @
3cd0024e
...
...
@@ -15,7 +15,7 @@ ERROR: 0:79: 'vertex-shader array-of-struct output' : not supported with this pr
ERROR: 0:81: 'vertex-shader struct output containing an array' : not supported with this profile: es
ERROR: 0:83: 'vertex-shader struct output containing structure' : not supported with this profile: es
ERROR: 0:85: 'std430 on a uniform block' : not supported with this profile: es
ERROR: 0:97: 's' : member of block cannot be
a sampler
type
ERROR: 0:97: 's' : member of block cannot be
or contain a sampler, image, or atomic_uint
type
ERROR: 0:105: 'location' : overlapping use of location 12
ERROR: 0:107: 'input block' : not supported in this stage: vertex
ERROR: 0:109: 'gl_PerVertex' : block redeclaration has extra members
...
...
glslang/Include/Types.h
View file @
3cd0024e
...
...
@@ -1161,6 +1161,19 @@ public:
return
false
;
}
virtual
bool
containsOpaque
()
const
{
if
(
basicType
==
EbtSampler
||
basicType
==
EbtAtomicUint
)
return
true
;
if
(
!
structure
)
return
false
;
for
(
unsigned
int
i
=
0
;
i
<
structure
->
size
();
++
i
)
{
if
((
*
structure
)[
i
].
type
->
containsOpaque
())
return
true
;
}
return
false
;
}
// Array editing methods. Array descriptors can be shared across
// type instances. This allows all uses of the same array
// to be updated at once. E.g., all nodes can be explicitly sized
...
...
glslang/Include/revision.h
View file @
3cd0024e
...
...
@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "3.0.77
5
"
#define GLSLANG_DATE "
21
-Sep-2015"
#define GLSLANG_REVISION "3.0.77
6
"
#define GLSLANG_DATE "
30
-Sep-2015"
glslang/MachineIndependent/ParseHelper.cpp
View file @
3cd0024e
...
...
@@ -4981,9 +4981,8 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
profileRequires
(
memberLoc
,
~
EEsProfile
,
440
,
E_GL_ARB_enhanced_layouts
,
"offset on block member"
);
}
TBasicType
basicType
=
memberType
.
getBasicType
();
if
(
basicType
==
EbtSampler
)
error
(
memberLoc
,
"member of block cannot be a sampler type"
,
typeList
[
member
].
type
->
getFieldName
().
c_str
(),
""
);
if
(
memberType
.
containsOpaque
())
error
(
memberLoc
,
"member of block cannot be or contain a sampler, image, or atomic_uint type"
,
typeList
[
member
].
type
->
getFieldName
().
c_str
(),
""
);
}
// This might be a redeclaration of a built-in block. If so, redeclareBuiltinBlock() will
...
...
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