spv.memoryScopeSemantics.comp
// Module Version 10300
// Generated by (magic number): 80008
-// Id's are bound by 163
+// Id's are bound by 167
Capability Shader
Capability Int64
Capability Int64Atomics
+ Capability StorageImageMultisample
Capability VulkanMemoryModelKHR
Capability VulkanMemoryModelDeviceScopeKHR
Extension "SPV_KHR_vulkan_memory_model"
Name 151 "BufferM"
MemberName 151(BufferM) 0 "x"
Name 153 "bufferm"
+ Name 165 "imageMS"
Decorate 36(imagei) DescriptorSet 0
Decorate 36(imagei) Binding 1
Decorate 46(imageu) DescriptorSet 0
Decorate 151(BufferM) Block
Decorate 153(bufferm) DescriptorSet 0
Decorate 153(bufferm) Binding 9
+ Decorate 165(imageMS) DescriptorSet 0
+ Decorate 165(imageMS) Binding 10
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
152: TypePointer StorageBuffer 151(BufferM)
153(bufferm): 152(ptr) Variable StorageBuffer
161: 6(int) Constant 32768
+ 163: TypeImage 6(int) 2D multi-sampled nonsampled format:R32i
+ 164: TypePointer UniformConstant 163
+ 165(imageMS): 164(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
8(origi): 7(ptr) Variable Function
159: 15(int) AtomicIAdd 158 12 17 51
160: 69(ptr) AccessChain 68(bufferu) 38
162: 15(int) AtomicIAdd 160 12 42 16
+ 166: 40(ptr) ImageTexelPointer 165(imageMS) 39 12
+ AtomicStore 166 12 33 14
Return
FunctionEnd
shared int64_t atomi64;\r
layout (binding = 8) volatile buffer BufferL { uint x; } bufferl;\r
layout (binding = 9) buffer BufferM { volatile uint x; } bufferm;\r
+layout(binding = 10, r32i) volatile coherent uniform iimage2DMS imageMS;\r
\r
\r
void main()\r
imageAtomicAdd(imagei, ivec2(0,0), 3);\r
atomicAdd(bufferu.x, 4u, gl_ScopeDevice, 0, 0);\r
atomicAdd(bufferu.x, 5u, gl_ScopeDevice, 0, gl_SemanticsVolatile);\r
+\r
+ imageAtomicStore(imageMS, ivec2(0,0), 1, 4, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease);\r
}\r
\r
unsigned int semantics = 0, storageClassSemantics = 0;
unsigned int semantics2 = 0, storageClassSemantics2 = 0;
+ const TIntermTyped* arg0 = (*argp)[0]->getAsTyped();
+ const bool isMS = arg0->getBasicType() == EbtSampler && arg0->getType().getSampler().isMultiSample();
+
// Grab the semantics and storage class semantics from the operands, based on opcode
switch (callNode.getOp()) {
case EOpAtomicAdd:
case EOpImageAtomicXor:
case EOpImageAtomicExchange:
case EOpImageAtomicStore:
- storageClassSemantics = (*argp)[4]->getAsConstantUnion()->getConstArray()[0].getIConst();
- semantics = (*argp)[5]->getAsConstantUnion()->getConstArray()[0].getIConst();
+ storageClassSemantics = (*argp)[isMS ? 5 : 4]->getAsConstantUnion()->getConstArray()[0].getIConst();
+ semantics = (*argp)[isMS ? 6 : 5]->getAsConstantUnion()->getConstArray()[0].getIConst();
break;
case EOpImageAtomicLoad:
- storageClassSemantics = (*argp)[3]->getAsConstantUnion()->getConstArray()[0].getIConst();
- semantics = (*argp)[4]->getAsConstantUnion()->getConstArray()[0].getIConst();
+ storageClassSemantics = (*argp)[isMS ? 4 : 3]->getAsConstantUnion()->getConstArray()[0].getIConst();
+ semantics = (*argp)[isMS ? 5 : 4]->getAsConstantUnion()->getConstArray()[0].getIConst();
break;
case EOpImageAtomicCompSwap:
- storageClassSemantics = (*argp)[5]->getAsConstantUnion()->getConstArray()[0].getIConst();
- semantics = (*argp)[6]->getAsConstantUnion()->getConstArray()[0].getIConst();
- storageClassSemantics2 = (*argp)[7]->getAsConstantUnion()->getConstArray()[0].getIConst();
- semantics2 = (*argp)[8]->getAsConstantUnion()->getConstArray()[0].getIConst();
+ storageClassSemantics = (*argp)[isMS ? 6 : 5]->getAsConstantUnion()->getConstArray()[0].getIConst();
+ semantics = (*argp)[isMS ? 7 : 6]->getAsConstantUnion()->getConstArray()[0].getIConst();
+ storageClassSemantics2 = (*argp)[isMS ? 8 : 7]->getAsConstantUnion()->getConstArray()[0].getIConst();
+ semantics2 = (*argp)[isMS ? 9 : 8]->getAsConstantUnion()->getConstArray()[0].getIConst();
break;
case EOpBarrier: