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
7d01bd6f
Commit
7d01bd6f
authored
Sep 02, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Handle swizzles on vectors of size 1. Addresses issue #453.
parent
841db35b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
9 deletions
+34
-9
hlsl.shapeConv.frag.out
Test/baseResults/hlsl.shapeConv.frag.out
+20
-7
hlsl.shapeConv.frag
Test/hlsl.shapeConv.frag
+2
-0
revision.h
glslang/Include/revision.h
+1
-1
Intermediate.cpp
glslang/MachineIndependent/Intermediate.cpp
+2
-1
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+9
-0
No files found.
Test/baseResults/hlsl.shapeConv.frag.out
View file @
7d01bd6f
...
...
@@ -101,8 +101,13 @@ gl_FragCoord origin is upper left
0:27 Construct float (temp 1-component vector of float)
0:27 'v' (temp 4-component vector of float)
0:27 'f1' (temp 1-component vector of float)
0:29 Branch: Return with expression
0:29 'input' (in 4-component vector of float)
0:28 Construct float (temp float)
0:28 'f1' (temp 1-component vector of float)
0:29 Construct vec3 (temp 3-component vector of float)
0:29 Construct float (temp float)
0:29 'f1' (temp 1-component vector of float)
0:31 Branch: Return with expression
0:31 'input' (in 4-component vector of float)
0:? Linker Objects
...
...
@@ -211,13 +216,18 @@ gl_FragCoord origin is upper left
0:27 Construct float (temp 1-component vector of float)
0:27 'v' (temp 4-component vector of float)
0:27 'f1' (temp 1-component vector of float)
0:29 Branch: Return with expression
0:29 'input' (in 4-component vector of float)
0:28 Construct float (temp float)
0:28 'f1' (temp 1-component vector of float)
0:29 Construct vec3 (temp 3-component vector of float)
0:29 Construct float (temp float)
0:29 'f1' (temp 1-component vector of float)
0:31 Branch: Return with expression
0:31 'input' (in 4-component vector of float)
0:? Linker Objects
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 8
1
// Id's are bound by 8
4
Capability Shader
1: ExtInstImport "GLSL.std.450"
...
...
@@ -321,6 +331,9 @@ gl_FragCoord origin is upper left
75: 6(float) CompositeExtract 74 0
76: 6(float) Load 69(f1)
77: 41(bool) FOrdLessThan 75 76
78: 7(fvec4) Load 11(input)
ReturnValue 78
78: 6(float) Load 69(f1)
79: 6(float) Load 69(f1)
80: 22(fvec3) CompositeConstruct 79 79 79
81: 7(fvec4) Load 11(input)
ReturnValue 81
FunctionEnd
Test/hlsl.shapeConv.frag
View file @
7d01bd6f
...
...
@@ -25,6 +25,8 @@ float4 PixelShaderFunction(float4 input, float f) : COLOR0
f1
==
v
;
v
<
f1
;
f1
.
x
;
f1
.
xxx
;
return
input
;
}
glslang/Include/revision.h
View file @
7d01bd6f
...
...
@@ -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.146
4
"
#define GLSLANG_REVISION "Overload400-PrecQual.146
5
"
#define GLSLANG_DATE "02-Sep-2016"
glslang/MachineIndependent/Intermediate.cpp
View file @
7d01bd6f
...
...
@@ -274,7 +274,8 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
if
(
newType
!=
EbtVoid
)
{
child
=
addConversion
(
op
,
TType
(
newType
,
EvqTemporary
,
child
->
getVectorSize
(),
child
->
getMatrixCols
(),
child
->
getMatrixRows
()),
child
->
getMatrixRows
(),
child
->
isVector
()),
child
);
if
(
child
==
0
)
return
0
;
...
...
hlsl/hlslParseHelper.cpp
View file @
7d01bd6f
...
...
@@ -641,6 +641,15 @@ TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TInt
return
addConstructor
(
loc
,
base
,
type
);
}
}
if
(
base
->
getVectorSize
()
==
1
)
{
TType
scalarType
(
base
->
getBasicType
(),
EvqTemporary
,
1
);
if
(
fields
.
num
==
1
)
return
addConstructor
(
loc
,
base
,
scalarType
);
else
{
TType
vectorType
(
base
->
getBasicType
(),
EvqTemporary
,
fields
.
num
);
return
addConstructor
(
loc
,
addConstructor
(
loc
,
base
,
scalarType
),
vectorType
);
}
}
if
(
base
->
getType
().
getQualifier
().
isFrontEndConstant
())
result
=
intermediate
.
foldSwizzle
(
base
,
fields
,
loc
);
...
...
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