Fix an issue of SPV generation for imageAtomicStore.
authorRex Xu <rex.xu@amd.com>
Sat, 22 Feb 2020 14:04:31 +0000 (22:04 +0800)
committerRex Xu <rex.xu@amd.com>
Sat, 22 Feb 2020 14:04:31 +0000 (22:04 +0800)
commitfb18b6df287a092cf8d0f26600f000b7d37df8b6
treec9f58039c6a8bccd9788de00c9d7f951cc7cea77
parentc12493ff69e21800fb08b6d6e92eb0b9c5cb5efb
Fix an issue of SPV generation for imageAtomicStore.

For GLSL function imageAtomicStore, it will be translated to
OpImageTexelPointer + OpAtomicStore. The result type of
OpImageTexelPointer must be the same as the sampled type of OpTypeImage.
On translation, the result type is mistakenly fetched from operand list
operands[2] while operands[2] corresponds to sampleNum whose type is
always uint. This leads to an error if the image type is iimageXXX that is
int image.
SPIRV/GlslangToSpv.cpp
Test/baseResults/spv.memoryScopeSemantics.comp.out
Test/spv.memoryScopeSemantics.comp