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
016ddee8
Commit
016ddee8
authored
Oct 17, 2019
by
Jeff Bolz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only apply volatile semantics to atomics when using Vulkan Memory Model
parent
a959deb0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
1 deletion
+50
-1
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+1
-1
spv.volatileAtomic.comp.out
Test/baseResults/spv.volatileAtomic.comp.out
+40
-0
spv.volatileAtomic.comp
Test/spv.volatileAtomic.comp
+8
-0
Spv.FromFile.cpp
gtests/Spv.FromFile.cpp
+1
-0
No files found.
SPIRV/GlslangToSpv.cpp
View file @
016ddee8
...
...
@@ -6401,7 +6401,7 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
scopeId
=
builder
.
makeUintConstant
(
spv
::
ScopeDevice
);
}
// semantics default to relaxed
spv
::
Id
semanticsId
=
builder
.
makeUintConstant
(
lvalueCoherentFlags
.
isVolatile
()
?
spv
::
Id
semanticsId
=
builder
.
makeUintConstant
(
lvalueCoherentFlags
.
isVolatile
()
&&
glslangIntermediate
->
usingVulkanMemoryModel
()
?
spv
::
MemorySemanticsVolatileMask
:
spv
::
MemorySemanticsMaskNone
);
spv
::
Id
semanticsId2
=
semanticsId
;
...
...
Test/baseResults/spv.volatileAtomic.comp.out
0 → 100644
View file @
016ddee8
spv.volatileAtomic.comp
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 18
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main"
ExecutionMode 4 LocalSize 1 1 1
Source GLSL 450
Name 4 "main"
Name 8 "D"
MemberName 8(D) 0 "d"
Name 10 "d"
Decorate 7 ArrayStride 4
MemberDecorate 8(D) 0 Volatile
MemberDecorate 8(D) 0 Coherent
MemberDecorate 8(D) 0 Offset 0
Decorate 8(D) BufferBlock
Decorate 10(d) DescriptorSet 0
Decorate 10(d) Binding 3
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypeRuntimeArray 6(int)
8(D): TypeStruct 7
9: TypePointer Uniform 8(D)
10(d): 9(ptr) Variable Uniform
11: TypeInt 32 1
12: 11(int) Constant 0
13: TypePointer Uniform 6(int)
15: 6(int) Constant 0
16: 6(int) Constant 1
4(main): 2 Function None 3
5: Label
14: 13(ptr) AccessChain 10(d) 12 12
17: 6(int) AtomicExchange 14 16 15 15
Return
FunctionEnd
Test/spv.volatileAtomic.comp
0 → 100644
View file @
016ddee8
#version 450 core
layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
void main()
{
atomicExchange(d.d[0], 0);
}
gtests/Spv.FromFile.cpp
View file @
016ddee8
...
...
@@ -404,6 +404,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.storageBuffer.vert"
,
"spv.precise.tese"
,
"spv.precise.tesc"
,
"spv.volatileAtomic.comp"
,
"spv.vulkan100.subgroupArithmetic.comp"
,
"spv.vulkan100.subgroupPartitioned.comp"
,
"spv.xfb.vert"
,
...
...
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