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
189b2033
Commit
189b2033
authored
Apr 12, 2016
by
qining
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refine the code and address comments
parent
e24aa5ed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
16 deletions
+7
-16
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+2
-13
SpvBuilder.cpp
SPIRV/SpvBuilder.cpp
+3
-1
spv.specConstantOperations.vert.out
Test/baseResults/spv.specConstantOperations.vert.out
+2
-2
No files found.
SPIRV/GlslangToSpv.cpp
View file @
189b2033
...
...
@@ -3306,22 +3306,11 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
break
;
case
glslang
:
:
EOpConvUintToInt
:
if
(
builder
.
isInSpecConstCodeGenMode
())
{
// Build zero scalar or vector for OpIAdd to do the conversion when
// generating for OpSpecConstantOp instruction.
zero
=
builder
.
makeIntConstant
(
0
);
zero
=
makeSmearedConstant
(
zero
,
vectorSize
);
}
// Don't 'break' here as this case should be grouped together with
// EOpConvIntToUint when generating normal run-time conversion
// instruction.
case
glslang
:
:
EOpConvIntToUint
:
if
(
builder
.
isInSpecConstCodeGenMode
())
{
// Build zero scalar or vector for OpIAdd.
if
(
zero
==
0
)
{
zero
=
builder
.
makeUintConstant
(
0
);
zero
=
makeSmearedConstant
(
zero
,
vectorSize
);
}
zero
=
builder
.
makeUintConstant
(
0
);
zero
=
makeSmearedConstant
(
zero
,
vectorSize
);
// Use OpIAdd, instead of OpBitcast to do the conversion when
// generating for OpSpecConstantOp instruction.
return
builder
.
createBinOp
(
spv
::
OpIAdd
,
destType
,
operand
,
zero
);
...
...
SPIRV/SpvBuilder.cpp
View file @
189b2033
...
...
@@ -1216,7 +1216,9 @@ Id Builder::createTriOp(Op opCode, Id typeId, Id op1, Id op2, Id op3)
// generation mode.
if
(
generatingOpCodeForSpecConst
)
{
std
::
vector
<
Id
>
operands
(
3
);
operands
[
0
]
=
op1
;
operands
[
1
]
=
op2
;
operands
[
2
]
=
op3
;
operands
[
0
]
=
op1
;
operands
[
1
]
=
op2
;
operands
[
2
]
=
op3
;
return
createSpecConstantOp
(
opCode
,
typeId
,
operands
,
std
::
vector
<
Id
>
());
}
...
...
Test/baseResults/spv.specConstantOperations.vert.out
View file @
189b2033
...
...
@@ -50,7 +50,7 @@ Linked vertex stage:
48: 41(int) Constant 1
49: 41(int) SpecConstantOp 169 45 48 44
50: 41(int) SpecConstantOp 128 43 44
51: 6(int) SpecConstantOp 128 42
12
51: 6(int) SpecConstantOp 128 42
44
52: 6(int) SpecConstantOp 126 19
53: 6(int) SpecConstantOp 200 19
54: 6(int) SpecConstantOp 128 19 20
...
...
@@ -104,7 +104,7 @@ Linked vertex stage:
102: 88(ivec4) ConstantComposite 48 48 48 48
103: 88(ivec4) SpecConstantOp 169 97 102 96
104: 88(ivec4) SpecConstantOp 128 87 96
105: 85(ivec4) SpecConstantOp 128 91 9
9
105: 85(ivec4) SpecConstantOp 128 91 9
6
106: 85(ivec4) SpecConstantOp 200 87
107: 85(ivec4) SpecConstantOp 126 87
108: 85(ivec4) ConstantComposite 20 20 20 20
...
...
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