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
c64a9dd6
Commit
c64a9dd6
authored
Sep 15, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test: Make another test legal HLSL, and rationalize GLSL vs HLSL addConstructor().
parent
bdbbc68e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
hlsl.array.frag.out
Test/baseResults/hlsl.array.frag.out
+0
-0
hlsl.array.frag
Test/hlsl.array.frag
+5
-4
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+4
-4
No files found.
Test/baseResults/hlsl.array.frag.out
View file @
c64a9dd6
This diff is collapsed.
Click to expand it.
Test/hlsl.array.frag
View file @
c64a9dd6
...
...
@@ -4,8 +4,10 @@ struct {
float4
m
[
7
];
}
s
[
11
];
float4
PixelShaderFunction
(
int
i
,
float4
input
[
3
])
:
COLOR0
static
float4
C
=
float4
(
1
,
2
,
3
,
4
);
float4
PixelShaderFunction
(
int
i
:
sem1
,
float4
input
[
3
]
:
sem2
)
:
SV_TARGET0
{
float4
b
[
10
];
float4
b
[
10
]
=
{
C
,
C
,
C
,
C
,
C
,
C
,
C
,
C
,
C
,
C
}
;
return
a
[
1
]
+
a
[
i
]
+
input
[
2
]
+
input
[
i
]
+
b
[
5
]
+
b
[
i
]
+
s
[
i
].
m
[
i
];
}
\ No newline at end of file
}
hlsl/hlslParseHelper.cpp
View file @
c64a9dd6
...
...
@@ -7807,12 +7807,13 @@ TIntermTyped* HlslParseContext::handleConstructor(const TSourceLoc& loc, TInterm
//
TIntermTyped
*
HlslParseContext
::
addConstructor
(
const
TSourceLoc
&
loc
,
TIntermTyped
*
node
,
const
TType
&
type
)
{
TIntermAggregate
*
aggrNode
=
node
->
getAsAggregate
();
TOperator
op
=
intermediate
.
mapTypeToConstructorOp
(
type
);
// Combined texture-sampler constructors are completely semantic checked
// in constructorTextureSamplerError()
if
(
op
==
EOpConstructTextureSampler
)
return
intermediate
.
setAggregateOperator
(
node
->
getAsAggregate
()
,
op
,
type
,
loc
);
return
intermediate
.
setAggregateOperator
(
aggrNode
,
op
,
type
,
loc
);
TTypeList
::
const_iterator
memberTypes
;
if
(
op
==
EOpConstructStruct
)
...
...
@@ -7826,7 +7827,6 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp
elementType
.
shallowCopy
(
type
);
bool
singleArg
;
TIntermAggregate
*
aggrNode
=
node
->
getAsAggregate
();
if
(
aggrNode
!=
nullptr
)
{
if
(
aggrNode
->
getOp
()
!=
EOpNull
||
aggrNode
->
getSequence
().
size
()
==
1
)
singleArg
=
true
;
...
...
@@ -7844,7 +7844,7 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp
newNode
=
convertArray
(
node
,
type
);
// If structure constructor or array constructor is being called
// for only one parameter inside the
structur
e, we need to call constructAggregate function once.
// for only one parameter inside the
aggregat
e, we need to call constructAggregate function once.
else
if
(
type
.
isArray
())
newNode
=
constructAggregate
(
node
,
elementType
,
1
,
node
->
getLoc
());
else
if
(
op
==
EOpConstructStruct
)
...
...
@@ -7868,7 +7868,7 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp
//
// Handle list of arguments.
//
TIntermSequence
&
sequenceVector
=
aggrNode
->
getSequence
();
// Stores the information about the parameter to the constructor
TIntermSequence
&
sequenceVector
=
aggrNode
->
getSequence
();
// Stores the information about the parameter to the constructor
// if the structure constructor contains more than one parameter, then construct
// each parameter
...
...
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