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
c325f436
Commit
c325f436
authored
Apr 19, 2018
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GLSL: Fix #1300: Can redeclare without size a sized built-in block array.
parent
3beac945
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
18 deletions
+24
-18
310.tese
Test/310.tese
+1
-1
320.tese
Test/320.tese
+1
-1
400.tese
Test/400.tese
+1
-1
150.tesc.out
Test/baseResults/150.tesc.out
+1
-2
310.tese.out
Test/baseResults/310.tese.out
+1
-2
320.tese.out
Test/baseResults/320.tese.out
+1
-2
400.tese.out
Test/baseResults/400.tese.out
+1
-2
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+17
-7
No files found.
Test/310.tese
View file @
c325f436
...
...
@@ -55,7 +55,7 @@ patch sample in vec3 badp4; // ERROR
#extension GL_ARB_separate_shader_objects : enable
in gl_PerVertex
// ERROR, no size
in gl_PerVertex
{
vec4 gl_Position;
} gl_in[];
...
...
Test/320.tese
View file @
c325f436
...
...
@@ -51,7 +51,7 @@ patch sample in vec3 badp4; // ERROR
#extension GL_ARB_separate_shader_objects : enable
in gl_PerVertex
// ERROR, no size
in gl_PerVertex
{
vec4 gl_Position;
} gl_in[];
...
...
Test/400.tese
View file @
c325f436
...
...
@@ -51,7 +51,7 @@ patch sample in vec3 badp4; // ERROR
#extension GL_ARB_separate_shader_objects : enable
in gl_PerVertex
// ERROR, no size
in gl_PerVertex
{
float gl_ClipDistance[1];
} gl_in[];
...
...
Test/baseResults/150.tesc.out
View file @
c325f436
...
...
@@ -453,7 +453,6 @@ ERROR: 0:47: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:48: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample)
ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as unsized
ERROR: 0:59: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use
ERROR: 0:64: 'quads' : cannot apply to 'out'
ERROR: 0:64: 'cw' : can only apply to 'in'
...
...
@@ -473,7 +472,7 @@ ERROR: 0:99: 'location' : overlapping use of location 24
ERROR: 0:101: 'gl_TessLevelOuter' : identifiers starting with "gl_" are reserved
ERROR: 0:109: 'gl_DeviceIndex' : required extension not requested: GL_EXT_device_group
ERROR: 0:110: 'gl_ViewIndex' : required extension not requested: GL_EXT_multiview
ERROR: 3
2
compilation errors. No code generated.
ERROR: 3
1
compilation errors. No code generated.
Shader version: 400
...
...
Test/baseResults/310.tese.out
View file @
c325f436
...
...
@@ -25,7 +25,6 @@ ERROR: 0:53: 'noperspective' : not supported for this version or the enabled ext
ERROR: 0:53: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:54: 'sample' : Reserved word.
ERROR: 0:54: '' : can only have one auxiliary qualifier (centroid, patch, and sample)
ERROR: 0:58: 'gl_PerVertex' : block already declared with size, can't redeclare as unsized
ERROR: 0:63: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use
ERROR: 0:68: 'quads' : cannot apply to 'out'
ERROR: 0:68: 'cw' : can only apply to 'in'
...
...
@@ -47,7 +46,7 @@ ERROR: 0:113: 'sample' : Reserved word.
ERROR: 0:119: 'gl_PointSize' : no such field in structure
ERROR: 0:119: '=' : cannot convert from ' temp block{ in highp 4-component vector of float Position gl_Position}' to ' temp highp float'
ERROR: 0:127: 'gl_BoundingBoxOES' : undeclared identifier
ERROR: 4
4
compilation errors. No code generated.
ERROR: 4
3
compilation errors. No code generated.
Shader version: 310
...
...
Test/baseResults/320.tese.out
View file @
c325f436
...
...
@@ -24,7 +24,6 @@ ERROR: 0:49: 'noperspective' : Reserved word.
ERROR: 0:49: 'noperspective' : not supported for this version or the enabled extensions
ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample)
ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as unsized
ERROR: 0:59: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use
ERROR: 0:64: 'quads' : cannot apply to 'out'
ERROR: 0:64: 'cw' : can only apply to 'in'
...
...
@@ -43,7 +42,7 @@ ERROR: 0:96: 'location' : overlapping use of location 24
ERROR: 0:99: 'location' : overlapping use of location 24
ERROR: 0:101: 'gl_TessLevelOuter' : identifiers starting with "gl_" are reserved
ERROR: 0:113: 'gl_BoundingBoxOES' : undeclared identifier
ERROR:
40
compilation errors. No code generated.
ERROR:
39
compilation errors. No code generated.
Shader version: 320
...
...
Test/baseResults/400.tese.out
View file @
c325f436
...
...
@@ -11,7 +11,6 @@ ERROR: 0:47: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:48: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample)
ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as unsized
ERROR: 0:59: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use
ERROR: 0:64: 'quads' : cannot apply to 'out'
ERROR: 0:64: 'cw' : can only apply to 'in'
...
...
@@ -31,7 +30,7 @@ ERROR: 0:99: 'location' : overlapping use of location 24
ERROR: 0:101: 'gl_TessLevelOuter' : identifiers starting with "gl_" are reserved
ERROR: 0:109: 'gl_DeviceIndex' : required extension not requested: GL_EXT_device_group
ERROR: 0:110: 'gl_ViewIndex' : required extension not requested: GL_EXT_multiview
ERROR: 3
2
compilation errors. No code generated.
ERROR: 3
1
compilation errors. No code generated.
Shader version: 400
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
c325f436
...
...
@@ -3508,7 +3508,8 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS
// Either redeclare the requested block, or give an error message why it can't be done.
//
// TODO: functionality: explicitly sizing members of redeclared blocks is not giving them an explicit size
void
TParseContext
::
redeclareBuiltinBlock
(
const
TSourceLoc
&
loc
,
TTypeList
&
newTypeList
,
const
TString
&
blockName
,
const
TString
*
instanceName
,
TArraySizes
*
arraySizes
)
void
TParseContext
::
redeclareBuiltinBlock
(
const
TSourceLoc
&
loc
,
TTypeList
&
newTypeList
,
const
TString
&
blockName
,
const
TString
*
instanceName
,
TArraySizes
*
arraySizes
)
{
const
char
*
feature
=
"built-in block redeclaration"
;
profileRequires
(
loc
,
EEsProfile
,
320
,
Num_AEP_shader_io_blocks
,
AEP_shader_io_blocks
,
feature
);
...
...
@@ -3662,15 +3663,24 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT
if
(
numOriginalMembersFound
<
newTypeList
.
size
())
error
(
loc
,
"block redeclaration has extra members"
,
blockName
.
c_str
(),
""
);
if
(
type
.
isArray
()
!=
(
arraySizes
!=
nullptr
))
if
(
type
.
isArray
()
!=
(
arraySizes
!=
nullptr
)
||
(
type
.
isArray
()
&&
arraySizes
!=
nullptr
&&
type
.
getArraySizes
()
->
getNumDims
()
!=
arraySizes
->
getNumDims
()))
error
(
loc
,
"cannot change arrayness of redeclared block"
,
blockName
.
c_str
(),
""
);
else
if
(
type
.
isArray
())
{
if
(
type
.
isSizedArray
()
&&
!
arraySizes
->
isSized
())
error
(
loc
,
"block already declared with size, can't redeclare as unsized"
,
blockName
.
c_str
(),
""
);
else
if
(
type
.
isSizedArray
()
&&
*
type
.
getArraySizes
()
!=
*
arraySizes
)
error
(
loc
,
"cannot change array size of redeclared block"
,
blockName
.
c_str
(),
""
);
else
if
(
!
type
.
isSizedArray
()
&&
arraySizes
->
isSized
())
// At this point, we know both are arrays and both have the same number of dimensions.
// It is okay for a built-in block redeclaration to be unsized, and keep the size of the
// original block declaration.
if
(
!
arraySizes
->
isSized
()
&&
type
.
isSizedArray
())
arraySizes
->
changeOuterSize
(
type
.
getOuterArraySize
());
// And, okay to be giving a size to the array, by the redeclaration
if
(
!
type
.
isSizedArray
()
&&
arraySizes
->
isSized
())
type
.
changeOuterArraySize
(
arraySizes
->
getOuterSize
());
// Now, they must match in all dimensions.
if
(
type
.
isSizedArray
()
&&
*
type
.
getArraySizes
()
!=
*
arraySizes
)
error
(
loc
,
"cannot change array size of redeclared block"
,
blockName
.
c_str
(),
""
);
}
symbolTable
.
insert
(
*
block
);
...
...
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