SPV: Fix an issue related with imageStore() for 2DMS.
diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp
index e1babc1..284bfee 100755
--- a/SPIRV/GlslangToSpv.cpp
+++ b/SPIRV/GlslangToSpv.cpp
@@ -1889,15 +1889,19 @@
auto opIt = arguments.begin();
operands.push_back(*(opIt++));
operands.push_back(*(opIt++));
- if (node->getOp() == glslang::EOpImageStore)
- operands.push_back(*(opIt++));
if (node->getOp() == glslang::EOpImageLoad) {
if (sampler.ms) {
operands.push_back(spv::ImageOperandsSampleMask);
- operands.push_back(*(opIt++));
+ operands.push_back(*opIt);
}
return builder.createOp(spv::OpImageRead, convertGlslangToSpvType(node->getType()), operands);
} else if (node->getOp() == glslang::EOpImageStore) {
+ if (sampler.ms) {
+ operands.push_back(*(opIt + 1));
+ operands.push_back(spv::ImageOperandsSampleMask);
+ operands.push_back(*opIt);
+ } else
+ operands.push_back(*opIt);
builder.createNoResultOp(spv::OpImageWrite, operands);
return spv::NoResult;
} else {