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
3e60a6ff
Commit
3e60a6ff
authored
Sep 14, 2015
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV OpAtomicCompareSwap: Generate correct operand order and number of operands.
parent
7355eebb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+9
-2
spv.atomic.comp.out
Test/baseResults/spv.atomic.comp.out
+1
-1
revision.h
glslang/Include/revision.h
+1
-1
No files found.
SPIRV/GlslangToSpv.cpp
View file @
3e60a6ff
...
@@ -2526,14 +2526,21 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
...
@@ -2526,14 +2526,21 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
// Sort out the operands
// Sort out the operands
// - mapping from glslang -> SPV
// - mapping from glslang -> SPV
// - there are extra SPV operands with no glslang source
// - there are extra SPV operands with no glslang source
// - compare-exchange swaps the value and comparator
// - compare-exchange has an extra memory semantics
std
::
vector
<
spv
::
Id
>
spvAtomicOperands
;
// hold the spv operands
std
::
vector
<
spv
::
Id
>
spvAtomicOperands
;
// hold the spv operands
auto
opIt
=
operands
.
begin
();
// walk the glslang operands
auto
opIt
=
operands
.
begin
();
// walk the glslang operands
spvAtomicOperands
.
push_back
(
*
(
opIt
++
));
spvAtomicOperands
.
push_back
(
*
(
opIt
++
));
spvAtomicOperands
.
push_back
(
builder
.
makeUintConstant
(
spv
::
ScopeDevice
));
// TBD: what is the correct scope?
spvAtomicOperands
.
push_back
(
builder
.
makeUintConstant
(
spv
::
ScopeDevice
));
// TBD: what is the correct scope?
spvAtomicOperands
.
push_back
(
builder
.
makeUintConstant
(
spv
::
MemorySemanticsMaskNone
));
// TBD: what are the correct memory semantics?
spvAtomicOperands
.
push_back
(
builder
.
makeUintConstant
(
spv
::
MemorySemanticsMaskNone
));
// TBD: what are the correct memory semantics?
if
(
opCode
==
spv
::
OpAtomicCompareExchange
)
{
spvAtomicOperands
.
push_back
(
builder
.
makeUintConstant
(
spv
::
MemorySemanticsMaskNone
));
// TBD: what are the correct memory semantics?
spvAtomicOperands
.
push_back
(
*
(
opIt
+
1
));
spvAtomicOperands
.
push_back
(
*
opIt
);
opIt
+=
2
;
}
// Add the rest of the operands, skipping the first one, which was dealt with above.
// Add the rest of the operands, skipping any that were dealt with above.
// For some ops, there are none, for some 1, for compare-exchange, 2.
for
(;
opIt
!=
operands
.
end
();
++
opIt
)
for
(;
opIt
!=
operands
.
end
();
++
opIt
)
spvAtomicOperands
.
push_back
(
*
opIt
);
spvAtomicOperands
.
push_back
(
*
opIt
);
...
...
Test/baseResults/spv.atomic.comp.out
View file @
3e60a6ff
...
@@ -120,7 +120,7 @@ TBD functionality: Is atomic_uint an opaque handle in the uniform storage class,
...
@@ -120,7 +120,7 @@ TBD functionality: Is atomic_uint an opaque handle in the uniform storage class,
Store 38(origi) 64
Store 38(origi) 64
65: 6(int) Load 46(atomu)
65: 6(int) Load 46(atomu)
67: 6(int) Load 48(value)
67: 6(int) Load 48(value)
68: 6(int) AtomicCompareExchange 65 15 16
66 67
68: 6(int) AtomicCompareExchange 65 15 16
16 67 66
Store 44(origu) 68
Store 44(origu) 68
Return
Return
FunctionEnd
FunctionEnd
glslang/Include/revision.h
View file @
3e60a6ff
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "3.0.75
3
"
#define GLSLANG_REVISION "3.0.75
4
"
#define GLSLANG_DATE "14-Sep-2015"
#define GLSLANG_DATE "14-Sep-2015"
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