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
4dc835c3
Commit
4dc835c3
authored
Mar 28, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Non-functional: Round of adding 'const', related to more efficient getFullNamespaceName().
parent
714e58b2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
31 deletions
+32
-31
revision.h
glslang/Include/revision.h
+1
-1
ParseContextBase.cpp
glslang/MachineIndependent/ParseContextBase.cpp
+1
-1
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+2
-2
ParseHelper.h
glslang/MachineIndependent/ParseHelper.h
+3
-3
hlslGrammar.cpp
hlsl/hlslGrammar.cpp
+3
-2
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+14
-14
hlslParseHelper.h
hlsl/hlslParseHelper.h
+8
-8
No files found.
glslang/Include/revision.h
View file @
4dc835c3
...
...
@@ -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 "Overload400-PrecQual.193
7
"
#define GLSLANG_REVISION "Overload400-PrecQual.193
9
"
#define GLSLANG_DATE "28-Mar-2017"
glslang/MachineIndependent/ParseContextBase.cpp
View file @
4dc835c3
...
...
@@ -531,7 +531,7 @@ void TParseContextBase::parseSwizzleSelector(const TSourceLoc& loc, const TStrin
// Make the passed-in variable information become a member of the
// global uniform block. If this doesn't exist yet, make it.
//
void
TParseContextBase
::
growGlobalUniformBlock
(
TSourceLoc
&
loc
,
TType
&
memberType
,
TString
&
memberName
,
TTypeList
*
typeList
)
void
TParseContextBase
::
growGlobalUniformBlock
(
const
TSourceLoc
&
loc
,
TType
&
memberType
,
const
TString
&
memberName
,
TTypeList
*
typeList
)
{
// Make the global block, if not yet made.
if
(
globalUniformBlock
==
nullptr
)
{
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
4dc835c3
...
...
@@ -2990,7 +2990,7 @@ void TParseContext::arrayDimMerge(TType& type, const TArraySizes* sizes)
// Do all the semantic checking for declaring or redeclaring an array, with and
// without a size, and make the right changes to the symbol table.
//
void
TParseContext
::
declareArray
(
const
TSourceLoc
&
loc
,
TString
&
identifier
,
const
TType
&
type
,
TSymbol
*&
symbol
)
void
TParseContext
::
declareArray
(
const
TSourceLoc
&
loc
,
const
TString
&
identifier
,
const
TType
&
type
,
TSymbol
*&
symbol
)
{
if
(
symbol
==
nullptr
)
{
bool
currentScope
;
...
...
@@ -5053,7 +5053,7 @@ TVariable* TParseContext::makeInternalVariable(const char* name, const TType& ty
//
// Return the successfully declared variable.
//
TVariable
*
TParseContext
::
declareNonArray
(
const
TSourceLoc
&
loc
,
TString
&
identifier
,
TType
&
type
)
TVariable
*
TParseContext
::
declareNonArray
(
const
TSourceLoc
&
loc
,
const
TString
&
identifier
,
const
TType
&
type
)
{
// make a new variable
TVariable
*
variable
=
new
TVariable
(
&
identifier
,
type
);
...
...
glslang/MachineIndependent/ParseHelper.h
View file @
4dc835c3
...
...
@@ -136,7 +136,7 @@ public:
TSymbolTable
&
symbolTable
;
// symbol table that goes with the current language, version, and profile
// Manage the global uniform block (default uniforms in GLSL, $Global in HLSL)
virtual
void
growGlobalUniformBlock
(
TSourceLoc
&
,
TType
&
,
TString
&
memberName
,
TTypeList
*
typeList
=
nullptr
);
virtual
void
growGlobalUniformBlock
(
const
TSourceLoc
&
,
TType
&
,
const
TString
&
memberName
,
TTypeList
*
typeList
=
nullptr
);
virtual
bool
lValueErrorCheck
(
const
TSourceLoc
&
,
const
char
*
op
,
TIntermTyped
*
);
virtual
void
rValueErrorCheck
(
const
TSourceLoc
&
,
const
char
*
op
,
TIntermTyped
*
);
...
...
@@ -371,8 +371,8 @@ protected:
void
nonInitConstCheck
(
const
TSourceLoc
&
,
TString
&
identifier
,
TType
&
type
);
void
inheritGlobalDefaults
(
TQualifier
&
dst
)
const
;
TVariable
*
makeInternalVariable
(
const
char
*
name
,
const
TType
&
)
const
;
TVariable
*
declareNonArray
(
const
TSourceLoc
&
,
TString
&
identifier
,
TType
&
);
void
declareArray
(
const
TSourceLoc
&
,
TString
&
identifier
,
const
TType
&
,
TSymbol
*&
);
TVariable
*
declareNonArray
(
const
TSourceLoc
&
,
const
TString
&
identifier
,
const
TType
&
);
void
declareArray
(
const
TSourceLoc
&
,
const
TString
&
identifier
,
const
TType
&
,
TSymbol
*&
);
TIntermNode
*
executeInitializer
(
const
TSourceLoc
&
,
TIntermTyped
*
initializer
,
TVariable
*
variable
);
TIntermTyped
*
convertInitializerList
(
const
TSourceLoc
&
,
const
TType
&
,
TIntermTyped
*
initializer
);
void
finish
()
override
;
...
...
hlsl/hlslGrammar.cpp
View file @
4dc835c3
...
...
@@ -344,7 +344,7 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList)
while
(
acceptIdentifier
(
idToken
))
{
if
(
peekTokenClass
(
EHTokLeftParen
))
{
// looks like function parameters
TString
*
fnName
=
idToken
.
string
;
const
TString
*
fnName
=
idToken
.
string
;
// Potentially rename shader entry point function. No-op most of the time.
parseContext
.
renameShaderFunction
(
fnName
);
...
...
@@ -2090,7 +2090,8 @@ bool HlslGrammar::acceptMemberFunctionDefinition(TIntermNode*& nodeList, const T
{
bool
accepted
=
false
;
TString
*
functionName
=
parseContext
.
getFullNamespaceName
(
memberName
);
const
TString
*
functionName
=
&
memberName
;
parseContext
.
getFullNamespaceName
(
functionName
);
declarator
.
function
=
new
TFunction
(
functionName
,
type
);
if
(
type
.
getQualifier
().
storage
==
EvqTemporary
)
declarator
.
function
->
setImplicitThis
();
...
...
hlsl/hlslParseHelper.cpp
View file @
4dc835c3
...
...
@@ -162,7 +162,7 @@ bool HlslParseContext::shouldConvertLValue(const TIntermNode* node) const
return
false
;
}
void
HlslParseContext
::
growGlobalUniformBlock
(
TSourceLoc
&
loc
,
TType
&
memberType
,
TString
&
memberName
,
TTypeList
*
newTypeList
)
void
HlslParseContext
::
growGlobalUniformBlock
(
const
TSourceLoc
&
loc
,
TType
&
memberType
,
const
TString
&
memberName
,
TTypeList
*
newTypeList
)
{
newTypeList
=
nullptr
;
correctUniform
(
memberType
.
getQualifier
());
...
...
@@ -4759,7 +4759,7 @@ void HlslParseContext::arrayDimMerge(TType& type, const TArraySizes* sizes)
// Do all the semantic checking for declaring or redeclaring an array, with and
// without a size, and make the right changes to the symbol table.
//
void
HlslParseContext
::
declareArray
(
const
TSourceLoc
&
loc
,
TString
&
identifier
,
const
TType
&
type
,
TSymbol
*&
symbol
,
bool
track
)
void
HlslParseContext
::
declareArray
(
const
TSourceLoc
&
loc
,
const
TString
&
identifier
,
const
TType
&
type
,
TSymbol
*&
symbol
,
bool
track
)
{
if
(
!
symbol
)
{
bool
currentScope
;
...
...
@@ -4857,7 +4857,7 @@ void HlslParseContext::updateImplicitArraySize(const TSourceLoc& loc, TIntermNod
//
// Enforce non-initializer type/qualifier rules.
//
void
HlslParseContext
::
fixConstInit
(
const
TSourceLoc
&
loc
,
TString
&
identifier
,
TType
&
type
,
TIntermTyped
*&
initializer
)
void
HlslParseContext
::
fixConstInit
(
const
TSourceLoc
&
loc
,
const
TString
&
identifier
,
TType
&
type
,
TIntermTyped
*&
initializer
)
{
//
// Make the qualifier make sense, given that there is an initializer.
...
...
@@ -5846,7 +5846,7 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction
// 'parseType' is the type part of the declaration (to the left)
// 'arraySizes' is the arrayness tagged on the identifier (to the right)
//
void
HlslParseContext
::
declareTypedef
(
const
TSourceLoc
&
loc
,
TString
&
identifier
,
const
TType
&
parseType
)
void
HlslParseContext
::
declareTypedef
(
const
TSourceLoc
&
loc
,
const
TString
&
identifier
,
const
TType
&
parseType
)
{
TVariable
*
typeSymbol
=
new
TVariable
(
&
identifier
,
parseType
,
true
);
if
(
!
symbolTable
.
insert
(
*
typeSymbol
))
...
...
@@ -5977,7 +5977,7 @@ TSymbol* HlslParseContext::lookupUserType(const TString& typeName, TType& type)
// 'parseType' is the type part of the declaration (to the left)
// 'arraySizes' is the arrayness tagged on the identifier (to the right)
//
TIntermNode
*
HlslParseContext
::
declareVariable
(
const
TSourceLoc
&
loc
,
TString
&
identifier
,
TType
&
type
,
TIntermTyped
*
initializer
)
TIntermNode
*
HlslParseContext
::
declareVariable
(
const
TSourceLoc
&
loc
,
const
TString
&
identifier
,
TType
&
type
,
TIntermTyped
*
initializer
)
{
if
(
voidErrorCheck
(
loc
,
identifier
,
type
.
getBasicType
()))
return
nullptr
;
...
...
@@ -6079,7 +6079,7 @@ TVariable* HlslParseContext::makeInternalVariable(const char* name, const TType&
//
// Return the successfully declared variable.
//
TVariable
*
HlslParseContext
::
declareNonArray
(
const
TSourceLoc
&
loc
,
TString
&
identifier
,
TType
&
type
,
bool
track
)
TVariable
*
HlslParseContext
::
declareNonArray
(
const
TSourceLoc
&
loc
,
const
TString
&
identifier
,
const
TType
&
type
,
bool
track
)
{
// make a new variable
TVariable
*
variable
=
new
TVariable
(
&
identifier
,
type
);
...
...
@@ -7132,15 +7132,15 @@ void HlslParseContext::popNamespace()
// Use the class/struct nesting string to create a global name for
// a member of a class/struct.
TString
*
HlslParseContext
::
getFullNamespaceName
(
const
TString
&
localN
ame
)
const
void
HlslParseContext
::
getFullNamespaceName
(
const
TString
*&
n
ame
)
const
{
TString
*
name
=
NewPoolTString
(
""
);
if
(
currentTypePrefix
.
size
()
>
0
)
name
->
append
(
currentTypePrefix
.
back
());
name
->
append
(
scopeMangler
);
name
->
append
(
localName
);
if
(
currentTypePrefix
.
size
()
==
0
)
return
;
return
name
;
TString
*
fullName
=
NewPoolTString
(
currentTypePrefix
.
back
().
c_str
());
fullName
->
append
(
scopeMangler
);
fullName
->
append
(
*
name
);
name
=
fullName
;
}
// Helper function to add the namespace scope mangling syntax to a string.
...
...
@@ -7150,7 +7150,7 @@ void HlslParseContext::addScopeMangler(TString& name)
}
// Potentially rename shader entry point function
void
HlslParseContext
::
renameShaderFunction
(
TString
*&
name
)
const
void
HlslParseContext
::
renameShaderFunction
(
const
TString
*&
name
)
const
{
// Replace the entry point name given in the shader with the real entry point name,
// if there is a substitution.
...
...
hlsl/hlslParseHelper.h
View file @
4dc835c3
...
...
@@ -136,10 +136,10 @@ public:
void
checkNoShaderLayouts
(
const
TSourceLoc
&
,
const
TShaderQualifiers
&
);
const
TFunction
*
findFunction
(
const
TSourceLoc
&
loc
,
TFunction
&
call
,
bool
&
builtIn
,
TIntermTyped
*&
args
);
void
declareTypedef
(
const
TSourceLoc
&
,
TString
&
identifier
,
const
TType
&
);
void
declareTypedef
(
const
TSourceLoc
&
,
const
TString
&
identifier
,
const
TType
&
);
void
declareStruct
(
const
TSourceLoc
&
,
TString
&
structName
,
TType
&
);
TSymbol
*
lookupUserType
(
const
TString
&
,
TType
&
);
TIntermNode
*
declareVariable
(
const
TSourceLoc
&
,
TString
&
identifier
,
TType
&
,
TIntermTyped
*
initializer
=
0
);
TIntermNode
*
declareVariable
(
const
TSourceLoc
&
,
const
TString
&
identifier
,
TType
&
,
TIntermTyped
*
initializer
=
0
);
void
lengthenList
(
const
TSourceLoc
&
,
TIntermSequence
&
list
,
int
size
);
TIntermTyped
*
addConstructor
(
const
TSourceLoc
&
,
TIntermNode
*
,
const
TType
&
);
TIntermTyped
*
constructAggregate
(
TIntermNode
*
,
const
TType
&
,
int
,
const
TSourceLoc
&
);
...
...
@@ -173,13 +173,13 @@ public:
void
pushNamespace
(
const
TString
&
name
);
void
popNamespace
();
TString
*
getFullNamespaceName
(
const
TString
&
localName
)
const
;
void
getFullNamespaceName
(
const
TString
*&
)
const
;
void
addScopeMangler
(
TString
&
);
void
pushSwitchSequence
(
TIntermSequence
*
sequence
)
{
switchSequenceStack
.
push_back
(
sequence
);
}
void
popSwitchSequence
()
{
switchSequenceStack
.
pop_back
();
}
virtual
void
growGlobalUniformBlock
(
TSourceLoc
&
,
TType
&
,
TString
&
memberName
,
TTypeList
*
typeList
=
nullptr
)
override
;
virtual
void
growGlobalUniformBlock
(
const
TSourceLoc
&
,
TType
&
,
const
TString
&
memberName
,
TTypeList
*
typeList
=
nullptr
)
override
;
// Apply L-value conversions. E.g, turning a write to a RWTexture into an ImageStore.
TIntermTyped
*
handleLvalue
(
const
TSourceLoc
&
,
const
char
*
op
,
TIntermTyped
*
node
);
...
...
@@ -191,7 +191,7 @@ public:
bool
handleInputGeometry
(
const
TSourceLoc
&
,
const
TLayoutGeometry
&
geometry
);
// Potentially rename shader entry point function
void
renameShaderFunction
(
TString
*&
name
)
const
;
void
renameShaderFunction
(
const
TString
*&
name
)
const
;
// Reset data for incrementally built referencing of flattened composite structures
void
initFlattening
()
{
flattenLevel
.
push_back
(
0
);
flattenOffset
.
push_back
(
0
);
}
...
...
@@ -210,14 +210,14 @@ protected:
int
nextBinding
;
// next binding to use.
};
void
fixConstInit
(
const
TSourceLoc
&
,
TString
&
identifier
,
TType
&
type
,
TIntermTyped
*&
initializer
);
void
fixConstInit
(
const
TSourceLoc
&
,
const
TString
&
identifier
,
TType
&
type
,
TIntermTyped
*&
initializer
);
void
inheritGlobalDefaults
(
TQualifier
&
dst
)
const
;
TVariable
*
makeInternalVariable
(
const
char
*
name
,
const
TType
&
)
const
;
TVariable
*
makeInternalVariable
(
const
TString
&
name
,
const
TType
&
type
)
const
{
return
makeInternalVariable
(
name
.
c_str
(),
type
);
}
TVariable
*
declareNonArray
(
const
TSourceLoc
&
,
TString
&
identifier
,
TType
&
,
bool
track
);
void
declareArray
(
const
TSourceLoc
&
,
TString
&
identifier
,
const
TType
&
,
TSymbol
*&
,
bool
track
);
TVariable
*
declareNonArray
(
const
TSourceLoc
&
,
const
TString
&
identifier
,
const
TType
&
,
bool
track
);
void
declareArray
(
const
TSourceLoc
&
,
const
TString
&
identifier
,
const
TType
&
,
TSymbol
*&
,
bool
track
);
TIntermNode
*
executeInitializer
(
const
TSourceLoc
&
,
TIntermTyped
*
initializer
,
TVariable
*
variable
);
TIntermTyped
*
convertInitializerList
(
const
TSourceLoc
&
,
const
TType
&
,
TIntermTyped
*
initializer
);
bool
isZeroConstructor
(
const
TIntermNode
*
);
...
...
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