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
88e88e59
Commit
88e88e59
authored
Mar 08, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Non-functional: Remove dead .length() code.
parent
516d92d3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
47 deletions
+6
-47
revision.h
glslang/Include/revision.h
+1
-1
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+5
-45
hlslParseHelper.h
hlsl/hlslParseHelper.h
+0
-1
No files found.
glslang/Include/revision.h
View file @
88e88e59
...
...
@@ -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.188
6
"
#define GLSLANG_REVISION "Overload400-PrecQual.188
7
"
#define GLSLANG_DATE "08-Mar-2017"
hlsl/hlslParseHelper.cpp
View file @
88e88e59
...
...
@@ -984,7 +984,7 @@ TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TInt
//
// Handle seeing a base.field dereference in the grammar, where 'field' is a
// built-in method.
// built-in method
name
.
//
// Return nullptr if 'field' is not a built-in method.
//
...
...
@@ -993,13 +993,10 @@ TIntermTyped* HlslParseContext::handleBuiltInMethod(const TSourceLoc& loc, TInte
variableCheck
(
base
);
//
// methods can't be resolved until we later see the function-calling syntax.
// Save away the name in the AST for now. Processing is completed in
// handleLengthMethod(), etc.
// Methods can't be resolved until we finish seeing the function-calling syntax.
// Save away the name in the AST for now.
//
if
(
field
==
"length"
)
{
return
intermediate
.
addMethod
(
base
,
TType
(
EbtInt
),
&
field
,
loc
);
}
else
if
(
isSamplerMethod
(
field
)
&&
base
->
getType
().
getBasicType
()
==
EbtSampler
)
{
if
(
isSamplerMethod
(
field
)
&&
base
->
getType
().
getBasicType
()
==
EbtSampler
)
{
// If it's not a method on a sampler object, we fall through to let other objects have a go.
const
TSampler
&
sampler
=
base
->
getType
().
getSampler
();
if
(
!
sampler
.
isPureSampler
())
{
...
...
@@ -3758,9 +3755,7 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct
TIntermTyped
*
result
=
nullptr
;
TOperator
op
=
function
->
getBuiltInOp
();
if
(
op
==
EOpArrayLength
)
result
=
handleLengthMethod
(
loc
,
function
,
arguments
);
else
if
(
op
!=
EOpNull
)
{
if
(
op
!=
EOpNull
)
{
//
// Then this should be a constructor.
// Don't go through the symbol table for constructors.
...
...
@@ -3874,41 +3869,6 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct
return
result
;
}
// Finish processing object.length(). This started earlier in handleDotDereference(), where
// the ".length" part was recognized and semantically checked, and finished here where the
// function syntax "()" is recognized.
//
// Return resulting tree node.
TIntermTyped
*
HlslParseContext
::
handleLengthMethod
(
const
TSourceLoc
&
loc
,
TFunction
*
function
,
TIntermNode
*
intermNode
)
{
int
length
=
0
;
if
(
function
->
getParamCount
()
>
0
)
error
(
loc
,
"method does not accept any arguments"
,
function
->
getName
().
c_str
(),
""
);
else
{
const
TType
&
type
=
intermNode
->
getAsTyped
()
->
getType
();
if
(
type
.
isArray
())
{
if
(
type
.
isRuntimeSizedArray
())
{
// Create a unary op and let the back end handle it
return
intermediate
.
addBuiltInFunctionCall
(
loc
,
EOpArrayLength
,
true
,
intermNode
,
TType
(
EbtInt
));
}
else
length
=
type
.
getOuterArraySize
();
}
else
if
(
type
.
isMatrix
())
length
=
type
.
getMatrixCols
();
else
if
(
type
.
isVector
())
length
=
type
.
getVectorSize
();
else
{
// we should not get here, because earlier semantic checking should have prevented this path
error
(
loc
,
".length()"
,
"unexpected use of .length()"
,
""
);
}
}
if
(
length
==
0
)
length
=
1
;
return
intermediate
.
addConstantUnion
(
length
,
loc
);
}
//
// Add any needed implicit conversions for function-call arguments to input parameters.
//
...
...
hlsl/hlslParseHelper.h
View file @
88e88e59
...
...
@@ -87,7 +87,6 @@ public:
void
decomposeSampleMethods
(
const
TSourceLoc
&
,
TIntermTyped
*&
node
,
TIntermNode
*
arguments
);
void
decomposeStructBufferMethods
(
const
TSourceLoc
&
,
TIntermTyped
*&
node
,
TIntermNode
*
arguments
);
void
decomposeGeometryMethods
(
const
TSourceLoc
&
,
TIntermTyped
*&
node
,
TIntermNode
*
arguments
);
TIntermTyped
*
handleLengthMethod
(
const
TSourceLoc
&
,
TFunction
*
,
TIntermNode
*
);
void
addInputArgumentConversions
(
const
TFunction
&
,
TIntermTyped
*&
);
TIntermTyped
*
addOutputArgumentConversions
(
const
TFunction
&
,
TIntermOperator
&
);
void
builtInOpCheck
(
const
TSourceLoc
&
,
const
TFunction
&
,
TIntermOperator
&
);
...
...
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