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
ba00f67d
Commit
ba00f67d
authored
Apr 27, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #251 from amdrexu/bugfix
SPV: Use OpLogicalEqual/OpLogicalNotEqual for boolean type comparison.
parents
d6abcee1
c7d3656d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+5
-0
spv.Operations.frag.out
Test/baseResults/spv.Operations.frag.out
+2
-2
spv.bool.vert.out
Test/baseResults/spv.bool.vert.out
+1
-1
No files found.
SPIRV/GlslangToSpv.cpp
View file @
ba00f67d
...
...
@@ -2633,6 +2633,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv
{
bool
isUnsigned
=
typeProxy
==
glslang
::
EbtUint
;
bool
isFloat
=
typeProxy
==
glslang
::
EbtFloat
||
typeProxy
==
glslang
::
EbtDouble
;
bool
isBool
=
typeProxy
==
glslang
::
EbtBool
;
spv
::
Op
binOp
=
spv
::
OpNop
;
bool
needMatchingVectors
=
true
;
// for non-matrix ops, would a scalar need to smear to match a vector?
...
...
@@ -2820,6 +2821,8 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv
case
glslang
:
:
EOpVectorEqual
:
if
(
isFloat
)
binOp
=
spv
::
OpFOrdEqual
;
else
if
(
isBool
)
binOp
=
spv
::
OpLogicalEqual
;
else
binOp
=
spv
::
OpIEqual
;
break
;
...
...
@@ -2827,6 +2830,8 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv
case
glslang
:
:
EOpVectorNotEqual
:
if
(
isFloat
)
binOp
=
spv
::
OpFOrdNotEqual
;
else
if
(
isBool
)
binOp
=
spv
::
OpLogicalNotEqual
;
else
binOp
=
spv
::
OpINotEqual
;
break
;
...
...
Test/baseResults/spv.Operations.frag.out
View file @
ba00f67d
...
...
@@ -470,7 +470,7 @@ Linked fragment stage:
339: Label
341: 179(bvec4) Load 181(ub41)
343: 179(bvec4) Load 342(ub42)
344: 179(bvec4)
I
Equal 341 343
344: 179(bvec4)
Logical
Equal 341 343
345: 178(bool) Any 344
Branch 340
340: Label
...
...
@@ -482,7 +482,7 @@ Linked fragment stage:
348: Label
350: 179(bvec4) Load 181(ub41)
351: 179(bvec4) Load 342(ub42)
352: 179(bvec4)
I
NotEqual 350 351
352: 179(bvec4)
Logical
NotEqual 350 351
353: 178(bool) Any 352
Branch 349
349: Label
...
...
Test/baseResults/spv.bool.vert.out
View file @
ba00f67d
...
...
@@ -91,6 +91,6 @@ Linked vertex stage:
9(b): 7(ptr) FunctionParameter
11: Label
12: 6(bool) Load 9(b)
14: 6(bool)
I
NotEqual 12 13
14: 6(bool)
Logical
NotEqual 12 13
ReturnValue 14
FunctionEnd
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