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
af7f1c8f
Commit
af7f1c8f
authored
Jun 01, 2016
by
iostrows
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix double matrix creation
parent
548c3ade
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
SpvBuilder.cpp
SPIRV/SpvBuilder.cpp
+5
-2
No files found.
SPIRV/SpvBuilder.cpp
View file @
af7f1c8f
...
@@ -1830,6 +1830,9 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector<Id>&
...
@@ -1830,6 +1830,9 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector<Id>&
int
numCols
=
getTypeNumColumns
(
resultTypeId
);
int
numCols
=
getTypeNumColumns
(
resultTypeId
);
int
numRows
=
getTypeNumRows
(
resultTypeId
);
int
numRows
=
getTypeNumRows
(
resultTypeId
);
Instruction
*
instr
=
module
.
getInstruction
(
componentTypeId
);
Id
bitCount
=
instr
->
getIdOperand
(
0
);
// Will use a two step process
// Will use a two step process
// 1. make a compile-time 2D array of values
// 1. make a compile-time 2D array of values
// 2. construct a matrix from that array
// 2. construct a matrix from that array
...
@@ -1838,8 +1841,8 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector<Id>&
...
@@ -1838,8 +1841,8 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector<Id>&
// initialize the array to the identity matrix
// initialize the array to the identity matrix
Id
ids
[
maxMatrixSize
][
maxMatrixSize
];
Id
ids
[
maxMatrixSize
][
maxMatrixSize
];
Id
one
=
makeFloatConstant
(
1.0
);
Id
one
=
(
bitCount
==
64
?
makeDoubleConstant
(
1.0
)
:
makeFloatConstant
(
1.0
)
);
Id
zero
=
makeFloatConstant
(
0.0
);
Id
zero
=
(
bitCount
==
64
?
makeDoubleConstant
(
0.0
)
:
makeFloatConstant
(
0.0
)
);
for
(
int
col
=
0
;
col
<
4
;
++
col
)
{
for
(
int
col
=
0
;
col
<
4
;
++
col
)
{
for
(
int
row
=
0
;
row
<
4
;
++
row
)
{
for
(
int
row
=
0
;
row
<
4
;
++
row
)
{
if
(
col
==
row
)
if
(
col
==
row
)
...
...
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