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
5a042c06
Commit
5a042c06
authored
Feb 28, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GLSL: Fix #741: rationalize per-block vs. per-member offset checking.
parent
69a2c696
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
15 deletions
+20
-15
420.vert.out
Test/baseResults/420.vert.out
+2
-1
430.vert.out
Test/baseResults/430.vert.out
+4
-3
440.frag.out
Test/baseResults/440.frag.out
+7
-6
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+7
-5
No files found.
Test/baseResults/420.vert.out
View file @
5a042c06
...
...
@@ -47,12 +47,13 @@ ERROR: 0:142: 'r8_snorm' : does not apply to signed integer images
ERROR: 0:143: 'rgba32ui' : does not apply to signed integer images
ERROR: 0:144: 'r8ui' : does not apply to signed integer images
ERROR: 0:147: 'offset on block member' : not supported for this version or the enabled extensions
ERROR: 0:147: 'offset/align' : can only be used with std140 or std430 layout packing
ERROR: 0:157: 'textureQueryLevels' : no matching overloaded function found
ERROR: 0:157: 'assign' : cannot convert from 'const float' to 'temp int'
ERROR: 0:158: 'textureQueryLevels' : no matching overloaded function found
ERROR: 0:158: 'assign' : cannot convert from 'const float' to 'temp int'
WARNING: 0:161: '[]' : assuming array size of one for compile-time checking of binding numbers for implicitly-sized array
ERROR: 5
0
compilation errors. No code generated.
ERROR: 5
1
compilation errors. No code generated.
Shader version: 420
...
...
Test/baseResults/430.vert.out
View file @
5a042c06
...
...
@@ -28,8 +28,9 @@ ERROR: 0:64: 'uniform buffer-member align' : not supported for this version or t
ERROR: 0:65: 'uniform buffer-member align' : not supported for this version or the enabled extensions
ERROR: 0:65: 'offset on block member' : not supported for this version or the enabled extensions
ERROR: 0:66: 'offset on block member' : not supported for this version or the enabled extensions
ERROR: 0:64: 'offset/align' : can only be used with std140 or std430 layout packing
ERROR: 0:65: 'align' : can only be used with std140 or std430 layout packing
ERROR: 0:64: 'align' : can only be used with std140 or std430 layout packing
ERROR: 0:65: 'offset/align' : can only be used with std140 or std430 layout packing
ERROR: 0:66: 'offset/align' : can only be used with std140 or std430 layout packing
ERROR: 0:71: 'offset on block member' : not supported for this version or the enabled extensions
ERROR: 0:74: 'gl_MaxTransformFeedbackBuffers' : required extension not requested: GL_ARB_enhanced_layouts
ERROR: 0:75: 'gl_MaxTransformFeedbackInterleavedComponents' : required extension not requested: GL_ARB_enhanced_layouts
...
...
@@ -63,7 +64,7 @@ ERROR: 0:221: 'textureQueryLevels' : no matching overloaded function found
ERROR: 0:221: 'assign' : cannot convert from 'const float' to 'temp int'
ERROR: 0:222: 'textureQueryLevels' : no matching overloaded function found
ERROR: 0:222: 'assign' : cannot convert from 'const float' to 'temp int'
ERROR: 6
3
compilation errors. No code generated.
ERROR: 6
4
compilation errors. No code generated.
Shader version: 430
...
...
Test/baseResults/440.frag.out
View file @
5a042c06
...
...
@@ -22,11 +22,11 @@ ERROR: 0:38: 'offset' : only applies to block members, not blocks
ERROR: 0:39: 'output block' : not supported in this stage: fragment
ERROR: 0:39: 'layout' : offset/align can only be used on a uniform or buffer
ERROR: 0:39: 'offset' : only applies to block members, not blocks
ERROR: 0:42: '
offset/
align' : can only be used with std140 or std430 layout packing
ERROR: 0:43: '
offset/
align' : can only be used with std140 or std430 layout packing
ERROR: 0:42: 'align' : can only be used with std140 or std430 layout packing
ERROR: 0:43: 'align' : can only be used with std140 or std430 layout packing
ERROR: 0:43: 'layout' : offset/align can only be used on a uniform or buffer
ERROR: 0:44: 'output block' : not supported in this stage: fragment
ERROR: 0:44: '
offset/
align' : can only be used with std140 or std430 layout packing
ERROR: 0:44: 'align' : can only be used with std140 or std430 layout packing
ERROR: 0:44: 'layout' : offset/align can only be used on a uniform or buffer
ERROR: 0:46: 'offset' : cannot specify on a variable declaration
ERROR: 0:47: 'layout' : offset/align can only be used on a uniform or buffer
...
...
@@ -37,8 +37,9 @@ ERROR: 0:52: 'layout' : offset/align can only be used on a uniform or buffer
ERROR: 0:54: 'layout' : matrix or packing qualifiers can only be used on a uniform or buffer
ERROR: 0:55: 'layout' : cannot specify packing on a variable declaration
ERROR: 0:57: 'align' : must be a power of 2
ERROR: 0:58: 'align' : can only be used with std140 or std430 layout packing
ERROR: 0:63: 'align' : can only be used with std140 or std430 layout packing
ERROR: 0:58: 'offset/align' : can only be used with std140 or std430 layout packing
ERROR: 0:62: 'offset/align' : can only be used with std140 or std430 layout packing
ERROR: 0:63: 'offset/align' : can only be used with std140 or std430 layout packing
ERROR: 0:62: 'layout' : offset/align can only be used on a uniform or buffer
ERROR: 0:63: 'layout' : offset/align can only be used on a uniform or buffer
ERROR: 0:84: 'align' : must be a power of 2
...
...
@@ -48,7 +49,7 @@ ERROR: 0:103: 'align' : must be a power of 2
ERROR: 0:105: 'align' : must be a power of 2
ERROR: 0:102: 'offset' : cannot lie in previous members
ERROR: 0:104: 'offset' : must be a multiple of the member's alignment
ERROR: 4
8
compilation errors. No code generated.
ERROR: 4
9
compilation errors. No code generated.
Shader version: 440
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
5a042c06
...
...
@@ -5597,11 +5597,10 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
mergeObjectLayoutQualifiers
(
defaultQualification
,
currentBlockQualifier
,
true
);
// "The offset qualifier can only be used on block members of blocks declared with std140 or std430 layouts."
// "The align qualifier can only be used on blocks or block members, and only for blocks declared with std140 or std430 layouts."
if
(
currentBlockQualifier
.
hasAlign
()
||
currentBlockQualifier
.
hasAlign
()
)
{
if
(
currentBlockQualifier
.
hasAlign
())
{
if
(
defaultQualification
.
layoutPacking
!=
ElpStd140
&&
defaultQualification
.
layoutPacking
!=
ElpStd430
)
{
error
(
loc
,
"can only be used with std140 or std430 layout packing"
,
"
offset/
align"
,
""
);
error
(
loc
,
"can only be used with std140 or std430 layout packing"
,
"align"
,
""
);
defaultQualification
.
layoutAlign
=
-
1
;
}
}
...
...
@@ -5643,9 +5642,12 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
}
}
else
memberWithoutLocation
=
true
;
if
(
memberQualifier
.
hasAlign
())
{
// "The offset qualifier can only be used on block members of blocks declared with std140 or std430 layouts."
// "The align qualifier can only be used on blocks or block members, and only for blocks declared with std140 or std430 layouts."
if
(
memberQualifier
.
hasAlign
()
||
memberQualifier
.
hasOffset
())
{
if
(
defaultQualification
.
layoutPacking
!=
ElpStd140
&&
defaultQualification
.
layoutPacking
!=
ElpStd430
)
error
(
memberLoc
,
"can only be used with std140 or std430 layout packing"
,
"align"
,
""
);
error
(
memberLoc
,
"can only be used with std140 or std430 layout packing"
,
"
offset/
align"
,
""
);
}
TQualifier
newMemberQualification
=
defaultQualification
;
...
...
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