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
b0ada803
Commit
b0ada803
authored
Jan 17, 2020
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Fix #1974: ignore input primitives on non-entry-point functions.
parent
3ed344dd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
4 deletions
+28
-4
hlsl.gs-hs-mix.tesc.out
Test/baseResults/hlsl.gs-hs-mix.tesc.out
+0
-2
hlsl.semantic.geom.out
Test/baseResults/hlsl.semantic.geom.out
+0
-0
hlsl.semantic.geom
Test/hlsl.semantic.geom
+8
-0
hlslGrammar.cpp
hlsl/hlslGrammar.cpp
+2
-0
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+11
-2
hlslParseHelper.h
hlsl/hlslParseHelper.h
+7
-0
No files found.
Test/baseResults/hlsl.gs-hs-mix.tesc.out
View file @
b0ada803
hlsl.gs-hs-mix.tesc
Shader version: 500
vertices = 3
input primitive = triangles
vertex spacing = fractional_odd_spacing
triangle order = ccw
0:? Sequence
...
...
@@ -402,7 +401,6 @@ Linked tessellation control stage:
Shader version: 500
vertices = 3
input primitive = triangles
vertex spacing = fractional_odd_spacing
triangle order = ccw
0:? Sequence
...
...
Test/baseResults/hlsl.semantic.geom.out
View file @
b0ada803
This diff is collapsed.
Click to expand it.
Test/hlsl.semantic.geom
View file @
b0ada803
...
...
@@ -14,3 +14,11 @@ void main(triangle in uint VertexID[3] : VertexID,
S
s
;
OutputStream
.
Append
(
s
);
}
[
maxvertexcount
(
4
)]
void
notmain
(
line
in
uint
VertexID
[
2
]
:
VertexID
,
inout
LineStream
<
S
>
OutputStream
)
{
S
s
;
OutputStream
.
Append
(
s
);
}
hlsl/hlslGrammar.cpp
View file @
b0ada803
...
...
@@ -2516,6 +2516,8 @@ bool HlslGrammar::acceptMemberFunctionDefinition(TIntermNode*& nodeList, const T
//
bool
HlslGrammar
::
acceptFunctionParameters
(
TFunction
&
function
)
{
parseContext
.
beginParameterParsing
(
function
);
// LEFT_PAREN
if
(
!
acceptTokenClass
(
EHTokLeftParen
))
return
false
;
...
...
hlsl/hlslParseHelper.cpp
View file @
b0ada803
...
...
@@ -69,7 +69,8 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int
clipDistanceOutput
(
nullptr
),
cullDistanceOutput
(
nullptr
),
clipDistanceInput
(
nullptr
),
cullDistanceInput
(
nullptr
)
cullDistanceInput
(
nullptr
),
parsingEntrypointParameters
(
false
)
{
globalUniformDefaults
.
clear
();
globalUniformDefaults
.
layoutMatrix
=
ElmRowMajor
;
...
...
@@ -2049,7 +2050,7 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct
};
// if we aren't in the entry point, fix the IO as such and exit
if
(
userFunction
.
getName
().
compare
(
intermediate
.
getEntryPointName
().
c_str
())
!=
0
)
{
if
(
!
isEntrypointName
(
userFunction
.
getName
())
)
{
remapNonEntryPointIO
(
userFunction
);
return
nullptr
;
}
...
...
@@ -8884,6 +8885,10 @@ void HlslParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier
//
bool
HlslParseContext
::
handleInputGeometry
(
const
TSourceLoc
&
loc
,
const
TLayoutGeometry
&
geometry
)
{
// these can be declared on non-entry-points, in which case they lose their meaning
if
(
!
parsingEntrypointParameters
)
return
true
;
switch
(
geometry
)
{
case
ElgPoints
:
// fall through
case
ElgLines
:
// ...
...
...
@@ -8914,6 +8919,10 @@ bool HlslParseContext::handleOutputGeometry(const TSourceLoc& loc, const TLayout
if
(
language
!=
EShLangGeometry
)
return
true
;
// these can be declared on non-entry-points, in which case they lose their meaning
if
(
!
parsingEntrypointParameters
)
return
true
;
switch
(
geometry
)
{
case
ElgPoints
:
case
ElgLineStrip
:
...
...
hlsl/hlslParseHelper.h
View file @
b0ada803
...
...
@@ -183,6 +183,11 @@ public:
void
getFullNamespaceName
(
TString
*&
)
const
;
void
addScopeMangler
(
TString
&
);
void
beginParameterParsing
(
TFunction
&
function
)
{
parsingEntrypointParameters
=
isEntrypointName
(
function
.
getName
());
}
void
pushSwitchSequence
(
TIntermSequence
*
sequence
)
{
switchSequenceStack
.
push_back
(
sequence
);
}
void
popSwitchSequence
()
{
switchSequenceStack
.
pop_back
();
}
...
...
@@ -241,6 +246,7 @@ protected:
TIntermTyped
*
convertInitializerList
(
const
TSourceLoc
&
,
const
TType
&
,
TIntermTyped
*
initializer
,
TIntermTyped
*
scalarInit
);
bool
isScalarConstructor
(
const
TIntermNode
*
);
TOperator
mapAtomicOp
(
const
TSourceLoc
&
loc
,
TOperator
op
,
bool
isImage
);
bool
isEntrypointName
(
const
TString
&
name
)
{
return
name
.
compare
(
intermediate
.
getEntryPointName
().
c_str
())
==
0
;
}
// Return true if this node requires L-value conversion (e.g, to an imageStore).
bool
shouldConvertLValue
(
const
TIntermNode
*
)
const
;
...
...
@@ -494,6 +500,7 @@ protected:
};
TMap
<
int
,
tShadowTextureSymbols
*>
textureShadowVariant
;
bool
parsingEntrypointParameters
;
};
// This is the prefix we use for built-in methods to avoid namespace collisions with
...
...
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