Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
angle
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
angle
Commits
099c0f33
Commit
099c0f33
authored
Jun 20, 2013
by
Jamie Madill
Committed by
Shannon Woods
Jul 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add parsing support for global and interface block scoped matrix packing qualifiers.
TRAC #23271 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Authored-by: Jamie Madill
parent
0bd18dfb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
5 deletions
+30
-5
ParseHelper.cpp
src/compiler/ParseHelper.cpp
+28
-5
ParseHelper.h
src/compiler/ParseHelper.h
+2
-0
No files found.
src/compiler/ParseHelper.cpp
View file @
099c0f33
...
...
@@ -1445,7 +1445,12 @@ void TParseContext::parseGlobalLayoutQualifier(const TPublicType &typeQualifier)
return
;
}
// TODO: global matrix packing and block storage
if
(
layoutQualifier
.
matrixPacking
!=
EmpUnspecified
)
{
defaultMatrixPacking
=
layoutQualifier
.
matrixPacking
;
}
// TODO: block storage
}
TFunction
*
TParseContext
::
addConstructorFunc
(
TPublicType
publicType
)
...
...
@@ -1899,12 +1904,17 @@ TIntermAggregate* TParseContext::addInterfaceBlock(const TPublicType& typeQualif
recover
();
}
const
TLayoutQualifier
l
ayoutQualifier
=
typeQualifier
.
layoutQualifier
;
if
(
layoutLocationErrorCheck
(
typeQualifier
.
line
,
l
ayoutQualifier
))
TLayoutQualifier
blockL
ayoutQualifier
=
typeQualifier
.
layoutQualifier
;
if
(
layoutLocationErrorCheck
(
typeQualifier
.
line
,
blockL
ayoutQualifier
))
{
recover
();
}
if
(
blockLayoutQualifier
.
matrixPacking
==
EmpUnspecified
)
{
blockLayoutQualifier
.
matrixPacking
=
defaultMatrixPacking
;
}
TSymbol
*
blockNameSymbol
=
new
TInterfaceBlockName
(
&
blockName
);
if
(
!
symbolTable
.
declare
(
*
blockNameSymbol
))
{
error
(
nameLine
,
"redefinition"
,
blockName
.
c_str
(),
"interface block name"
);
...
...
@@ -1933,16 +1943,29 @@ TIntermAggregate* TParseContext::addInterfaceBlock(const TPublicType& typeQualif
}
// check layout qualifiers
if
(
layoutLocationErrorCheck
(
memberTypeLine
.
line
,
memberType
->
getLayoutQualifier
()))
TLayoutQualifier
memberLayoutQualifier
=
memberType
->
getLayoutQualifier
();
if
(
layoutLocationErrorCheck
(
memberTypeLine
.
line
,
memberLayoutQualifier
))
{
recover
();
}
if
(
memberLayoutQualifier
.
matrixPacking
==
EmpUnspecified
)
{
memberLayoutQualifier
.
matrixPacking
=
blockLayoutQualifier
.
matrixPacking
;
}
else
if
(
!
memberType
->
isMatrix
())
{
error
(
memberTypeLine
.
line
,
"invalid layout qualifier:"
,
getMatrixPackingString
(
memberLayoutQualifier
.
matrixPacking
),
"can only be used on matrix types"
);
recover
();
}
memberType
->
setLayoutQualifier
(
memberLayoutQualifier
);
}
TType
*
interfaceBlock
=
new
TType
(
typeList
,
blockName
);
interfaceBlock
->
setBasicType
(
EbtInterfaceBlock
);
interfaceBlock
->
setQualifier
(
typeQualifier
.
qualifier
);
interfaceBlock
->
setLayoutQualifier
(
l
ayoutQualifier
);
interfaceBlock
->
setLayoutQualifier
(
blockL
ayoutQualifier
);
TString
symbolName
=
""
;
int
symbolId
=
0
;
...
...
src/compiler/ParseHelper.h
View file @
099c0f33
...
...
@@ -38,6 +38,7 @@ struct TParseContext {
currentFunctionType
(
NULL
),
functionReturnsValue
(
false
),
checksPrecisionErrors
(
checksPrecErrors
),
defaultMatrixPacking
(
EmpColumnMajor
),
diagnostics
(
is
),
shaderVersion
(
100
),
directiveHandler
(
ext
,
diagnostics
,
shaderVersion
),
...
...
@@ -57,6 +58,7 @@ struct TParseContext {
bool
functionReturnsValue
;
// true if a non-void function has a return
bool
checksPrecisionErrors
;
// true if an error will be generated when a variable is declared without precision, explicit or implicit.
bool
fragmentPrecisionHigh
;
// true if highp precision is supported in the fragment language.
TLayoutMatrixPacking
defaultMatrixPacking
;
TString
HashErrMsg
;
TDiagnostics
diagnostics
;
TDirectiveHandler
directiveHandler
;
...
...
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