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
44b30cb1
Commit
44b30cb1
authored
May 17, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #286 from amdrexu/bugfix
SPV: Correct an issue in createUnaryMatrixOperation().
parents
bedde872
c1992e5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+6
-6
spv.matrix.frag.out
Test/baseResults/spv.matrix.frag.out
+6
-6
No files found.
SPIRV/GlslangToSpv.cpp
View file @
44b30cb1
...
@@ -3334,18 +3334,18 @@ spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, spv::Deco
...
@@ -3334,18 +3334,18 @@ spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, spv::Deco
// get the types sorted out
// get the types sorted out
int
numCols
=
builder
.
getNumColumns
(
operand
);
int
numCols
=
builder
.
getNumColumns
(
operand
);
int
numRows
=
builder
.
getNumRows
(
operand
);
int
numRows
=
builder
.
getNumRows
(
operand
);
spv
::
Id
s
calarType
=
builder
.
getScalarTypeId
(
typeId
);
spv
::
Id
s
rcVecType
=
builder
.
makeVectorType
(
builder
.
getScalarTypeId
(
builder
.
getTypeId
(
operand
)),
numRows
);
spv
::
Id
vecType
=
builder
.
makeVectorType
(
scalarType
,
numRows
);
spv
::
Id
destVecType
=
builder
.
makeVectorType
(
builder
.
getScalarTypeId
(
typeId
)
,
numRows
);
std
::
vector
<
spv
::
Id
>
results
;
std
::
vector
<
spv
::
Id
>
results
;
// do each vector op
// do each vector op
for
(
int
c
=
0
;
c
<
numCols
;
++
c
)
{
for
(
int
c
=
0
;
c
<
numCols
;
++
c
)
{
std
::
vector
<
unsigned
int
>
indexes
;
std
::
vector
<
unsigned
int
>
indexes
;
indexes
.
push_back
(
c
);
indexes
.
push_back
(
c
);
spv
::
Id
vec
=
builder
.
createCompositeExtract
(
operand
,
v
ecType
,
indexes
);
spv
::
Id
srcVec
=
builder
.
createCompositeExtract
(
operand
,
srcV
ecType
,
indexes
);
spv
::
Id
vec_result
=
builder
.
createUnaryOp
(
op
,
vecType
,
v
ec
);
spv
::
Id
destVec
=
builder
.
createUnaryOp
(
op
,
destVecType
,
srcV
ec
);
addDecoration
(
vec_result
,
noContraction
);
addDecoration
(
destVec
,
noContraction
);
results
.
push_back
(
builder
.
setPrecision
(
vec_result
,
precision
));
results
.
push_back
(
builder
.
setPrecision
(
destVec
,
precision
));
}
}
// put the pieces together
// put the pieces together
...
...
Test/baseResults/spv.matrix.frag.out
View file @
44b30cb1
...
@@ -195,20 +195,20 @@ Linked fragment stage:
...
@@ -195,20 +195,20 @@ Linked fragment stage:
135: 8 CompositeConstruct 130 132 134
135: 8 CompositeConstruct 130 132 134
Store 10(sum34) 135
Store 10(sum34) 135
141: 8 Load 10(sum34)
141: 8 Load 10(sum34)
142:
13
7(fvec4) CompositeExtract 141 0
142:
7(fvec4) CompositeExtract 141 0
143: 137(fvec4) FConvert 142
143: 137(fvec4) FConvert 142
144:
13
7(fvec4) CompositeExtract 141 1
144:
7(fvec4) CompositeExtract 141 1
145: 137(fvec4) FConvert 144
145: 137(fvec4) FConvert 144
146:
13
7(fvec4) CompositeExtract 141 2
146:
7(fvec4) CompositeExtract 141 2
147: 137(fvec4) FConvert 146
147: 137(fvec4) FConvert 146
148: 138 CompositeConstruct 143 145 147
148: 138 CompositeConstruct 143 145 147
Store 140(dm) 148
Store 140(dm) 148
149: 138 Load 140(dm)
149: 138 Load 140(dm)
150:
7(fvec4) CompositeExtract 149 0
150:
13
7(fvec4) CompositeExtract 149 0
151: 7(fvec4) FConvert 150
151: 7(fvec4) FConvert 150
152:
7(fvec4) CompositeExtract 149 1
152:
13
7(fvec4) CompositeExtract 149 1
153: 7(fvec4) FConvert 152
153: 7(fvec4) FConvert 152
154:
7(fvec4) CompositeExtract 149 2
154:
13
7(fvec4) CompositeExtract 149 2
155: 7(fvec4) FConvert 154
155: 7(fvec4) FConvert 154
156: 8 CompositeConstruct 151 153 155
156: 8 CompositeConstruct 151 153 155
Store 10(sum34) 156
Store 10(sum34) 156
...
...
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