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
c86d38bb
Commit
c86d38bb
authored
Oct 01, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Non-functional: Better use of .isParamOutput() and some other methods.
parent
ba56e23e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
revision.h
glslang/Include/revision.h
+1
-1
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+5
-5
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+4
-3
No files found.
glslang/Include/revision.h
View file @
c86d38bb
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// 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).
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.154
2
"
#define GLSLANG_REVISION "Overload400-PrecQual.154
3
"
#define GLSLANG_DATE "01-Oct-2016"
#define GLSLANG_DATE "01-Oct-2016"
glslang/MachineIndependent/ParseHelper.cpp
View file @
c86d38bb
...
@@ -1168,7 +1168,7 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
...
@@ -1168,7 +1168,7 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
// means take 'arguments' itself as the one argument.
// means take 'arguments' itself as the one argument.
TIntermNode
*
arg
=
fnCandidate
->
getParamCount
()
==
1
?
arguments
:
(
aggregate
?
aggregate
->
getSequence
()[
i
]
:
arguments
);
TIntermNode
*
arg
=
fnCandidate
->
getParamCount
()
==
1
?
arguments
:
(
aggregate
?
aggregate
->
getSequence
()[
i
]
:
arguments
);
TQualifier
&
formalQualifier
=
(
*
fnCandidate
)[
i
].
type
->
getQualifier
();
TQualifier
&
formalQualifier
=
(
*
fnCandidate
)[
i
].
type
->
getQualifier
();
if
(
formalQualifier
.
storage
==
EvqOut
||
formalQualifier
.
storage
==
EvqInOut
)
{
if
(
formalQualifier
.
isParamOutput
()
)
{
if
(
lValueErrorCheck
(
arguments
->
getLoc
(),
"assign"
,
arg
->
getAsTyped
()))
if
(
lValueErrorCheck
(
arguments
->
getLoc
(),
"assign"
,
arg
->
getAsTyped
()))
error
(
arguments
->
getLoc
(),
"Non-L-value cannot be passed for 'out' or 'inout' parameters."
,
"out"
,
""
);
error
(
arguments
->
getLoc
(),
"Non-L-value cannot be passed for 'out' or 'inout' parameters."
,
"out"
,
""
);
}
}
...
@@ -1499,7 +1499,7 @@ TIntermTyped* TParseContext::addOutputArgumentConversions(const TFunction& funct
...
@@ -1499,7 +1499,7 @@ TIntermTyped* TParseContext::addOutputArgumentConversions(const TFunction& funct
// Will there be any output conversions?
// Will there be any output conversions?
bool
outputConversions
=
false
;
bool
outputConversions
=
false
;
for
(
int
i
=
0
;
i
<
function
.
getParamCount
();
++
i
)
{
for
(
int
i
=
0
;
i
<
function
.
getParamCount
();
++
i
)
{
if
(
*
function
[
i
].
type
!=
arguments
[
i
]
->
getAsTyped
()
->
getType
()
&&
function
[
i
].
type
->
getQualifier
().
storage
==
EvqOut
)
{
if
(
*
function
[
i
].
type
!=
arguments
[
i
]
->
getAsTyped
()
->
getType
()
&&
function
[
i
].
type
->
getQualifier
().
isParamOutput
()
)
{
outputConversions
=
true
;
outputConversions
=
true
;
break
;
break
;
}
}
...
@@ -3003,7 +3003,7 @@ void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType ba
...
@@ -3003,7 +3003,7 @@ void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType ba
void
TParseContext
::
parameterTypeCheck
(
const
TSourceLoc
&
loc
,
TStorageQualifier
qualifier
,
const
TType
&
type
)
void
TParseContext
::
parameterTypeCheck
(
const
TSourceLoc
&
loc
,
TStorageQualifier
qualifier
,
const
TType
&
type
)
{
{
if
((
qualifier
==
EvqOut
||
qualifier
==
EvqInOut
)
&&
(
type
.
getBasicType
()
==
EbtSampler
||
type
.
getBasicType
()
==
EbtAtomicUint
))
if
((
qualifier
==
EvqOut
||
qualifier
==
EvqInOut
)
&&
type
.
isOpaque
(
))
error
(
loc
,
"samplers and atomic_uints cannot be output parameters"
,
type
.
getBasicTypeString
().
c_str
(),
""
);
error
(
loc
,
"samplers and atomic_uints cannot be output parameters"
,
type
.
getBasicTypeString
().
c_str
(),
""
);
}
}
...
@@ -3716,7 +3716,7 @@ void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& quali
...
@@ -3716,7 +3716,7 @@ void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& quali
if
(
qualifier
.
invariant
)
if
(
qualifier
.
invariant
)
error
(
loc
,
"cannot use invariant qualifier on a function parameter"
,
""
,
""
);
error
(
loc
,
"cannot use invariant qualifier on a function parameter"
,
""
,
""
);
if
(
qualifier
.
noContraction
)
{
if
(
qualifier
.
noContraction
)
{
if
(
qualifier
.
storage
==
EvqOut
||
qualifier
.
storage
==
EvqInOut
)
if
(
qualifier
.
isParamOutput
()
)
type
.
getQualifier
().
noContraction
=
true
;
type
.
getQualifier
().
noContraction
=
true
;
else
else
warn
(
loc
,
"qualifier has no effect on non-output parameters"
,
"precise"
,
""
);
warn
(
loc
,
"qualifier has no effect on non-output parameters"
,
"precise"
,
""
);
...
@@ -4582,7 +4582,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
...
@@ -4582,7 +4582,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
// an array of size N, all elements of the array from binding through binding + N - 1 must be within this
// an array of size N, all elements of the array from binding through binding + N - 1 must be within this
// range."
// range."
//
//
if
(
type
.
getBasicType
()
!=
EbtSampler
&&
type
.
getBasicType
()
!=
EbtBlock
&&
type
.
getBasicType
()
!=
EbtAtomicUint
)
if
(
!
type
.
isOpaque
()
&&
type
.
getBasicType
()
!=
EbtBlock
)
error
(
loc
,
"requires block, or sampler/image, or atomic-counter type"
,
"binding"
,
""
);
error
(
loc
,
"requires block, or sampler/image, or atomic-counter type"
,
"binding"
,
""
);
if
(
type
.
getBasicType
()
==
EbtSampler
)
{
if
(
type
.
getBasicType
()
==
EbtSampler
)
{
int
lastBinding
=
qualifier
.
layoutBinding
;
int
lastBinding
=
qualifier
.
layoutBinding
;
...
...
hlsl/hlslParseHelper.cpp
View file @
c86d38bb
...
@@ -2384,18 +2384,19 @@ void HlslParseContext::addInputArgumentConversions(const TFunction& function, TI
...
@@ -2384,18 +2384,19 @@ void HlslParseContext::addInputArgumentConversions(const TFunction& function, TI
// Process each argument's conversion
// Process each argument's conversion
for
(
int
i
=
0
;
i
<
function
.
getParamCount
();
++
i
)
{
for
(
int
i
=
0
;
i
<
function
.
getParamCount
();
++
i
)
{
if
(
!
function
[
i
].
type
->
getQualifier
().
isParamInput
())
continue
;
// At this early point there is a slight ambiguity between whether an aggregate 'arguments'
// At this early point there is a slight ambiguity between whether an aggregate 'arguments'
// is the single argument itself or its children are the arguments. Only one argument
// is the single argument itself or its children are the arguments. Only one argument
// means take 'arguments' itself as the one argument.
// means take 'arguments' itself as the one argument.
TIntermTyped
*
arg
=
function
.
getParamCount
()
==
1
?
arguments
->
getAsTyped
()
:
(
aggregate
?
aggregate
->
getSequence
()[
i
]
->
getAsTyped
()
:
arguments
->
getAsTyped
());
TIntermTyped
*
arg
=
function
.
getParamCount
()
==
1
?
arguments
->
getAsTyped
()
:
(
aggregate
?
aggregate
->
getSequence
()[
i
]
->
getAsTyped
()
:
arguments
->
getAsTyped
());
if
(
*
function
[
i
].
type
!=
arg
->
getType
())
{
if
(
*
function
[
i
].
type
!=
arg
->
getType
())
{
if
(
function
[
i
].
type
->
getQualifier
().
isParamInput
())
{
// In-qualified arguments just need an extra node added above the argument to
// In-qualified arguments just need an extra node added above the argument to
// convert to the correct type.
// convert to the correct type.
arg
=
intermediate
.
addConversion
(
EOpFunctionCall
,
*
function
[
i
].
type
,
arg
);
arg
=
intermediate
.
addConversion
(
EOpFunctionCall
,
*
function
[
i
].
type
,
arg
);
arg
=
intermediate
.
addShapeConversion
(
EOpFunctionCall
,
*
function
[
i
].
type
,
arg
);
arg
=
intermediate
.
addShapeConversion
(
EOpFunctionCall
,
*
function
[
i
].
type
,
arg
);
setArg
(
i
,
arg
);
setArg
(
i
,
arg
);
}
}
else
{
}
else
{
if
(
shouldFlatten
(
arg
->
getType
()))
{
if
(
shouldFlatten
(
arg
->
getType
()))
{
// Will make a two-level subtree.
// Will make a two-level subtree.
...
@@ -2436,7 +2437,7 @@ TIntermTyped* HlslParseContext::addOutputArgumentConversions(const TFunction& fu
...
@@ -2436,7 +2437,7 @@ TIntermTyped* HlslParseContext::addOutputArgumentConversions(const TFunction& fu
// Will there be any output conversions?
// Will there be any output conversions?
bool
outputConversions
=
false
;
bool
outputConversions
=
false
;
for
(
int
i
=
0
;
i
<
function
.
getParamCount
();
++
i
)
{
for
(
int
i
=
0
;
i
<
function
.
getParamCount
();
++
i
)
{
if
(
*
function
[
i
].
type
!=
arguments
[
i
]
->
getAsTyped
()
->
getType
()
&&
function
[
i
].
type
->
getQualifier
().
storage
==
EvqOut
)
{
if
(
*
function
[
i
].
type
!=
arguments
[
i
]
->
getAsTyped
()
->
getType
()
&&
function
[
i
].
type
->
getQualifier
().
isParamOutput
()
)
{
outputConversions
=
true
;
outputConversions
=
true
;
break
;
break
;
}
}
...
...
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