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
73e3ce78
Commit
73e3ce78
authored
Apr 27, 2016
by
Rex Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV: Handle matrix's OpFConvert vector by vector.
parent
9db3117e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+5
-3
spv.matrix.frag.out
Test/baseResults/spv.matrix.frag.out
+0
-0
spv.matrix.frag
Test/spv.matrix.frag
+6
-5
No files found.
SPIRV/GlslangToSpv.cpp
View file @
73e3ce78
...
...
@@ -137,7 +137,7 @@ protected:
spv
::
Id
createBinaryMatrixOperation
(
spv
::
Op
,
spv
::
Decoration
precision
,
spv
::
Decoration
noContraction
,
spv
::
Id
typeId
,
spv
::
Id
left
,
spv
::
Id
right
);
spv
::
Id
createUnaryOperation
(
glslang
::
TOperator
op
,
spv
::
Decoration
precision
,
spv
::
Decoration
noContraction
,
spv
::
Id
typeId
,
spv
::
Id
operand
,
glslang
::
TBasicType
typeProxy
);
spv
::
Id
createUnaryMatrixOperation
(
spv
::
Op
,
spv
::
Decoration
precision
,
spv
::
Decoration
noContraction
,
spv
::
Id
typeId
,
spv
::
Id
operand
,
glslang
::
TBasicType
typeProxy
);
spv
::
Id
createConversion
(
glslang
::
TOperator
op
,
spv
::
Decoration
precision
,
spv
::
Id
destTypeId
,
spv
::
Id
operand
);
spv
::
Id
createConversion
(
glslang
::
TOperator
op
,
spv
::
Decoration
precision
,
spv
::
Decoration
noContraction
,
spv
::
Id
destTypeId
,
spv
::
Id
operand
,
glslang
::
TBasicType
typeProxy
);
spv
::
Id
makeSmearedConstant
(
spv
::
Id
constant
,
int
vectorSize
);
spv
::
Id
createAtomicOperation
(
glslang
::
TOperator
op
,
spv
::
Decoration
precision
,
spv
::
Id
typeId
,
std
::
vector
<
spv
::
Id
>&
operands
,
glslang
::
TBasicType
typeProxy
);
spv
::
Id
createInvocationsOperation
(
glslang
::
TOperator
,
spv
::
Id
typeId
,
spv
::
Id
operand
);
...
...
@@ -1071,7 +1071,7 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
// it could be a conversion
if
(
!
result
)
result
=
createConversion
(
node
->
getOp
(),
precision
,
convertGlslangToSpvType
(
node
->
getType
()),
operand
);
result
=
createConversion
(
node
->
getOp
(),
precision
,
noContraction
,
convertGlslangToSpvType
(
node
->
getType
()),
operand
,
node
->
getOperand
()
->
getBasicType
()
);
// if not, then possibly an operation
if
(
!
result
)
...
...
@@ -3331,7 +3331,7 @@ spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, spv::Deco
return
builder
.
setPrecision
(
builder
.
createCompositeConstruct
(
typeId
,
results
),
precision
);
}
spv
::
Id
TGlslangToSpvTraverser
::
createConversion
(
glslang
::
TOperator
op
,
spv
::
Decoration
precision
,
spv
::
Id
destType
,
spv
::
Id
operand
)
spv
::
Id
TGlslangToSpvTraverser
::
createConversion
(
glslang
::
TOperator
op
,
spv
::
Decoration
precision
,
spv
::
Decoration
noContraction
,
spv
::
Id
destType
,
spv
::
Id
operand
,
glslang
::
TBasicType
typeProxy
)
{
spv
::
Op
convOp
=
spv
::
OpNop
;
spv
::
Id
zero
=
0
;
...
...
@@ -3400,6 +3400,8 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
case
glslang
:
:
EOpConvDoubleToFloat
:
case
glslang
:
:
EOpConvFloatToDouble
:
convOp
=
spv
::
OpFConvert
;
if
(
builder
.
isMatrixType
(
destType
))
return
createUnaryMatrixOperation
(
convOp
,
precision
,
noContraction
,
destType
,
operand
,
typeProxy
);
break
;
case
glslang
:
:
EOpConvFloatToInt
:
...
...
Test/baseResults/spv.matrix.frag.out
View file @
73e3ce78
This diff is collapsed.
Click to expand it.
Test/spv.matrix.frag
View file @
73e3ce78
#version
14
0
#version
42
0
in
mat3x4
m1
;
in
mat3x4
m2
;
...
...
@@ -11,6 +11,7 @@ out vec4 color;
void
main
()
{
mat3x4
sum34
;
dmat3x4
dm
;
vec3
sum3
;
vec4
sum4
;
...
...
@@ -22,6 +23,8 @@ void main()
sum34
+=
f
/
m1
;
sum34
+=
f
;
sum34
-=
f
;
dm
=
dmat3x4
(
sum34
);
sum34
=
mat3x4
(
dm
);
sum3
=
v4
*
m2
;
sum4
=
m2
*
v3
;
...
...
@@ -33,10 +36,8 @@ void main()
color
=
sum4
;
//spv if (m1 != sum34)
++
sum34
;
// else
--
sum34
;
++
sum34
;
--
sum34
;
sum34
+=
mat3x4
(
f
);
sum34
+=
mat3x4
(
v3
,
f
,
v3
,
f
,
v3
,
f
);
...
...
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