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
396de16c
Unverified
Commit
396de16c
authored
Dec 14, 2017
by
John Kessenich
Committed by
GitHub
Dec 14, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1183 from LoopDawg/builtin-output-array-indirect
HLSL: for split output structs, propagate indirection to builtins.
parents
69feabc9
0cff5100
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
13 deletions
+21
-13
hlsl.hull.4.tesc.out
Test/baseResults/hlsl.hull.4.tesc.out
+0
-0
hlsl.hull.5.tesc.out
Test/baseResults/hlsl.hull.5.tesc.out
+4
-6
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+17
-7
No files found.
Test/baseResults/hlsl.hull.4.tesc.out
View file @
396de16c
This diff is collapsed.
Click to expand it.
Test/baseResults/hlsl.hull.5.tesc.out
View file @
396de16c
...
@@ -80,10 +80,9 @@ ERROR: node is still EOpNull!
...
@@ -80,10 +80,9 @@ ERROR: node is still EOpNull!
0:? 'cpid' ( in uint InvocationID)
0:? 'cpid' ( in uint InvocationID)
0:39 Sequence
0:39 Sequence
0:39 move second child to first child ( temp 4-component vector of float)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 direct index ( out 4-component vector of float Position)
0:39
in
direct index ( out 4-component vector of float Position)
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:39 Constant:
0:? 'cpid' ( in uint InvocationID)
0:39 0 (const int)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 Function Call: @main(u1; ( temp structure{ temp 4-component vector of float m_Position})
0:39 Function Call: @main(u1; ( temp structure{ temp 4-component vector of float m_Position})
0:? 'cpid' ( temp uint)
0:? 'cpid' ( temp uint)
...
@@ -174,10 +173,9 @@ ERROR: node is still EOpNull!
...
@@ -174,10 +173,9 @@ ERROR: node is still EOpNull!
0:? 'cpid' ( in uint InvocationID)
0:? 'cpid' ( in uint InvocationID)
0:39 Sequence
0:39 Sequence
0:39 move second child to first child ( temp 4-component vector of float)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 direct index ( out 4-component vector of float Position)
0:39
in
direct index ( out 4-component vector of float Position)
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:39 Constant:
0:? 'cpid' ( in uint InvocationID)
0:39 0 (const int)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 Function Call: @main(u1; ( temp structure{ temp 4-component vector of float m_Position})
0:39 Function Call: @main(u1; ( temp structure{ temp 4-component vector of float m_Position})
0:? 'cpid' ( temp uint)
0:? 'cpid' ( temp uint)
...
...
hlsl/hlslParseHelper.cpp
View file @
396de16c
...
@@ -2731,13 +2731,23 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
...
@@ -2731,13 +2731,23 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
// copy from interstage IO built-in if needed
// copy from interstage IO built-in if needed
subTree
=
intermediate
.
addSymbol
(
*
builtInVar
);
subTree
=
intermediate
.
addSymbol
(
*
builtInVar
);
// Arrayness of builtIn symbols isn't handled by the normal recursion:
if
(
subTree
->
getType
().
isArray
())
{
// it's been extracted and moved to the built-in.
// Arrayness of builtIn symbols isn't handled by the normal recursion:
if
(
subTree
->
getType
().
isArray
()
&&
!
arrayElement
.
empty
())
{
// it's been extracted and moved to the built-in.
const
TType
splitDerefType
(
subTree
->
getType
(),
arrayElement
.
back
());
if
(
!
arrayElement
.
empty
())
{
subTree
=
intermediate
.
addIndex
(
EOpIndexDirect
,
subTree
,
const
TType
splitDerefType
(
subTree
->
getType
(),
arrayElement
.
back
());
intermediate
.
addConstantUnion
(
arrayElement
.
back
(),
loc
),
loc
);
subTree
=
intermediate
.
addIndex
(
EOpIndexDirect
,
subTree
,
subTree
->
setType
(
splitDerefType
);
intermediate
.
addConstantUnion
(
arrayElement
.
back
(),
loc
),
loc
);
subTree
->
setType
(
splitDerefType
);
}
else
if
(
splitNode
->
getAsOperator
()
!=
nullptr
&&
(
splitNode
->
getAsOperator
()
->
getOp
()
==
EOpIndexIndirect
))
{
// This might also be a stage with arrayed outputs, in which case there's an index
// operation we should transfer to the output builtin.
const
TType
splitDerefType
(
subTree
->
getType
(),
0
);
subTree
=
intermediate
.
addIndex
(
splitNode
->
getAsOperator
()
->
getOp
(),
subTree
,
splitNode
->
getAsBinaryNode
()
->
getRight
(),
loc
);
subTree
->
setType
(
splitDerefType
);
}
}
}
}
else
if
(
flattened
&&
!
shouldFlatten
(
derefType
,
isLeft
?
leftStorage
:
rightStorage
,
false
))
{
}
else
if
(
flattened
&&
!
shouldFlatten
(
derefType
,
isLeft
?
leftStorage
:
rightStorage
,
false
))
{
if
(
isLeft
)
if
(
isLeft
)
...
...
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