Replace imageAtomicExchange with imageAtomicCompSwap in vertex shader
Recently the test was changed in order to replace a imageAtomicAdd for
a imageAtomicExchange, as the test can't assume that the vertex shader
will be executed exactly one per vertex shader (see VK-GL-CTS issue
1910).
But imageAtomicExchange is also problematic because in some
architecture/driver, specially tile-based, the test can't also assume
that all the vertex shader executions would finish before
rasterization starts (so fragment shader execution). So when using
imageAtomicExchange could happend that a vertex shader execution would
override the value that the fragment shader already started to update.
Due this two restrictions, this patch changes the atomic operation on
the vertex shader to imageAtomicCompSwap, that sets the value of the
image at the vertex shader only if it is the initial value (so
zero). That would prevent any possible execution when the
rasterization already started to override the value of such image.
This patch also adds a comment on the code explaining the situation,
to avoid any possible future change to a simpler atomic operation by
mistake.
Components: OpenGL ES
VK-GL-CTS issue: 1997
Affects:
KHR-GLES31.core.shader_image_load_store.advanced-allStages-oneImage
Change-Id: Icbc34662f33839a1ced9f728cee45a1198e4b495