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
5159d4f1
Commit
5159d4f1
authored
Sep 19, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Intercept flatten aggregates passed to a function input, and copy member-by-member.
parent
f911500d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
12 deletions
+33
-12
hlsl.entry-in.frag.out
Test/baseResults/hlsl.entry-in.frag.out
+0
-0
hlsl.entry-in.frag
Test/hlsl.entry-in.frag
+8
-1
revision.h
glslang/Include/revision.h
+1
-1
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+24
-10
No files found.
Test/baseResults/hlsl.entry-in.frag.out
View file @
5159d4f1
This diff is collapsed.
Click to expand it.
Test/hlsl.entry-in.frag
View file @
5159d4f1
...
@@ -4,10 +4,17 @@ struct InParam {
...
@@ -4,10 +4,17 @@ struct InParam {
int2
i2
;
int2
i2
;
};
};
float
fun
(
InParam
p
)
{
return
p
.
v
.
y
+
p
.
fragCoord
.
x
;
}
float4
PixelShaderFunction
(
InParam
i
)
:
COLOR0
float4
PixelShaderFunction
(
InParam
i
)
:
COLOR0
{
{
InParam
local
;
InParam
local
;
local
=
i
;
local
=
i
;
float
ret1
=
fun
(
local
);
float
ret2
=
fun
(
i
);
return
local
.
fragCoord
;
return
local
.
fragCoord
*
ret1
*
ret2
;
}
}
glslang/Include/revision.h
View file @
5159d4f1
...
@@ -3,4 +3,4 @@
...
@@ -3,4 +3,4 @@
// 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.1493"
#define GLSLANG_REVISION "Overload400-PrecQual.1493"
#define GLSLANG_DATE "1
8
-Sep-2016"
#define GLSLANG_DATE "1
9
-Sep-2016"
hlsl/hlslParseHelper.cpp
View file @
5159d4f1
...
@@ -2241,6 +2241,16 @@ TIntermTyped* HlslParseContext::handleLengthMethod(const TSourceLoc& loc, TFunct
...
@@ -2241,6 +2241,16 @@ TIntermTyped* HlslParseContext::handleLengthMethod(const TSourceLoc& loc, TFunct
void
HlslParseContext
::
addInputArgumentConversions
(
const
TFunction
&
function
,
TIntermNode
*&
arguments
)
const
void
HlslParseContext
::
addInputArgumentConversions
(
const
TFunction
&
function
,
TIntermNode
*&
arguments
)
const
{
{
TIntermAggregate
*
aggregate
=
arguments
->
getAsAggregate
();
TIntermAggregate
*
aggregate
=
arguments
->
getAsAggregate
();
const
auto
setArg
=
[
&
](
int
argNum
,
TIntermNode
*
arg
)
{
if
(
function
.
getParamCount
()
==
1
)
arguments
=
arg
;
else
{
if
(
aggregate
)
aggregate
->
getSequence
()[
argNum
]
=
arg
;
else
arguments
=
arg
;
}
};
// 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
)
{
...
@@ -2254,16 +2264,20 @@ void HlslParseContext::addInputArgumentConversions(const TFunction& function, TI
...
@@ -2254,16 +2264,20 @@ void HlslParseContext::addInputArgumentConversions(const TFunction& function, TI
// 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
);
if
(
arg
)
{
setArg
(
i
,
arg
);
if
(
function
.
getParamCount
()
==
1
)
}
arguments
=
arg
;
}
else
{
else
{
if
(
shouldFlatten
(
arg
->
getType
()))
{
if
(
aggregate
)
TSourceLoc
dummyLoc
;
aggregate
->
getSequence
()[
i
]
=
arg
;
dummyLoc
.
init
();
else
TVariable
*
internalAggregate
=
makeInternalVariable
(
"aggShadow"
,
*
function
[
i
].
type
);
arguments
=
arg
;
TIntermSymbol
*
internalSymbolNode
=
new
TIntermSymbol
(
internalAggregate
->
getUniqueId
(),
}
internalAggregate
->
getName
(),
}
internalAggregate
->
getType
());
TIntermAggregate
*
assignAgg
=
handleAssign
(
dummyLoc
,
EOpAssign
,
internalSymbolNode
,
arg
)
->
getAsAggregate
();
assignAgg
=
intermediate
.
growAggregate
(
assignAgg
,
internalSymbolNode
);
assignAgg
->
setOperator
(
EOpComma
);
setArg
(
i
,
assignAgg
);
}
}
}
}
}
}
...
...
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