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
9724ee42
Commit
9724ee42
authored
May 18, 2021
by
John Stiles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mat4x2(scalar) constructor.
parent
202c8aba
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
15 deletions
+79
-15
matrix.frag.out
Test/baseResults/matrix.frag.out
+60
-0
matrix.frag
Test/matrix.frag
+5
-0
parseConst.cpp
glslang/MachineIndependent/parseConst.cpp
+14
-15
No files found.
Test/baseResults/matrix.frag.out
View file @
9724ee42
...
...
@@ -242,6 +242,36 @@ Shader version: 130
0:54 'un34' ( uniform 4X4 matrix of float)
0:54 'um43' ( uniform 4X4 matrix of float)
0:54 'v' ( smooth in 4-component vector of float)
0:56 Sequence
0:56 move second child to first child ( temp 4X2 matrix of float)
0:56 'm42' ( temp 4X2 matrix of float)
0:56 Constant:
0:56 42.000000
0:56 0.000000
0:56 0.000000
0:56 42.000000
0:56 0.000000
0:56 0.000000
0:56 0.000000
0:56 0.000000
0:57 Test condition and select ( temp void)
0:57 Condition
0:57 Compare Equal ( temp bool)
0:57 'm42' ( temp 4X2 matrix of float)
0:57 Constant:
0:57 42.000000
0:57 0.000000
0:57 0.000000
0:57 42.000000
0:57 0.000000
0:57 0.000000
0:57 0.000000
0:57 0.000000
0:57 true case
0:58 Sequence
0:58 add second child into first child ( temp 4-component vector of float)
0:58 'gl_FragColor' ( fragColor 4-component vector of float FragColor)
0:58 'v' ( smooth in 4-component vector of float)
0:? Linker Objects
0:? 'colorTransform' ( uniform 3X3 matrix of float)
0:? 'Color' ( smooth in 3-component vector of float)
...
...
@@ -495,6 +525,36 @@ Shader version: 130
0:54 'un34' ( uniform 4X4 matrix of float)
0:54 'um43' ( uniform 4X4 matrix of float)
0:54 'v' ( smooth in 4-component vector of float)
0:56 Sequence
0:56 move second child to first child ( temp 4X2 matrix of float)
0:56 'm42' ( temp 4X2 matrix of float)
0:56 Constant:
0:56 42.000000
0:56 0.000000
0:56 0.000000
0:56 42.000000
0:56 0.000000
0:56 0.000000
0:56 0.000000
0:56 0.000000
0:57 Test condition and select ( temp void)
0:57 Condition
0:57 Compare Equal ( temp bool)
0:57 'm42' ( temp 4X2 matrix of float)
0:57 Constant:
0:57 42.000000
0:57 0.000000
0:57 0.000000
0:57 42.000000
0:57 0.000000
0:57 0.000000
0:57 0.000000
0:57 0.000000
0:57 true case
0:58 Sequence
0:58 add second child into first child ( temp 4-component vector of float)
0:58 'gl_FragColor' ( fragColor 4-component vector of float FragColor)
0:58 'v' ( smooth in 4-component vector of float)
0:? Linker Objects
0:? 'colorTransform' ( uniform 3X3 matrix of float)
0:? 'Color' ( smooth in 3-component vector of float)
...
...
Test/matrix.frag
View file @
9724ee42
...
...
@@ -52,4 +52,9 @@ void main()
gl_FragColor
+=
m34
*
u
;
else
gl_FragColor
+=
(
un34
*
um43
)
*
v
;
mat4x2
m42
=
mat4x2
(
42
);
if
(
m42
==
mat4x2
(
42
,
0
,
0
,
42
,
0
,
0
,
0
,
0
))
{
gl_FragColor
+=
v
;
}
}
glslang/MachineIndependent/parseConst.cpp
View file @
9724ee42
...
...
@@ -166,35 +166,34 @@ void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node)
}
}
else
{
// matrix from vector or scalar
int
count
=
0
;
const
int
startIndex
=
index
;
int
nodeComps
=
node
->
getType
().
computeNumComponents
();
for
(
int
i
=
startIndex
;
i
<
endIndex
;
i
++
)
{
if
(
i
>=
instanceSize
)
return
;
if
(
nodeComps
==
1
)
{
// If there is a single scalar parameter to a matrix
// constructor, it is used to initialize all the
// components on the matrix's diagonal, with the
// remaining components initialized to 0.0.
if
(
i
==
startIndex
||
(
i
-
startIndex
)
%
(
matrixRows
+
1
)
==
0
)
leftUnionArray
[
i
]
=
rightUnionArray
[
count
];
for
(
int
c
=
0
;
c
<
matrixCols
;
++
c
)
{
for
(
int
r
=
0
;
r
<
matrixRows
;
++
r
)
{
if
(
r
==
c
)
leftUnionArray
[
index
]
=
rightUnionArray
[
0
];
else
leftUnionArray
[
i
].
setDConst
(
0.0
);
leftUnionArray
[
index
].
setDConst
(
0.0
);
index
++
;
}
}
}
else
{
int
count
=
0
;
for
(
int
i
=
index
;
i
<
endIndex
;
i
++
)
{
if
(
i
>=
instanceSize
)
return
;
// construct the matrix in column-major order, from
// the components provided, in order
leftUnionArray
[
i
]
=
rightUnionArray
[
count
];
}
index
++
;
if
(
nodeComps
>
1
)
count
++
;
}
}
}
}
}
}
bool
TIntermediate
::
parseConstTree
(
TIntermNode
*
root
,
TConstUnionArray
unionArray
,
TOperator
constructorType
,
const
TType
&
t
,
bool
singleConstantParam
)
...
...
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