Merge vk-gl-cts/opengl-cts-4.6.0 into vk-gl-cts/master

Change-Id: Ia707d071b963951d00f6836be3f24fd1a0877cca
diff --git a/external/openglcts/modules/glesext/texture_cube_map_array/esextcTextureCubeMapArrayImageOperations.cpp b/external/openglcts/modules/glesext/texture_cube_map_array/esextcTextureCubeMapArrayImageOperations.cpp
index 1fdcb3e..3079e4f 100644
--- a/external/openglcts/modules/glesext/texture_cube_map_array/esextcTextureCubeMapArrayImageOperations.cpp
+++ b/external/openglcts/modules/glesext/texture_cube_map_array/esextcTextureCubeMapArrayImageOperations.cpp
@@ -181,6 +181,14 @@
 		GLU_EXPECT_NO_ERROR(gl.getError(), "Error querying old program!");
 		gl.useProgram(copy_po_id);
 		GLU_EXPECT_NO_ERROR(gl.getError(), "Error setting active program object!");
+
+		gl.memoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
+		GLU_EXPECT_NO_ERROR(gl.getError(), "Error setting memory barrier!");
+	}
+	else
+	{
+		gl.memoryBarrier(GL_FRAMEBUFFER_BARRIER_BIT);
+		GLU_EXPECT_NO_ERROR(gl.getError(), "Error setting memory barrier!");
 	}
 
 	bool result = true;
@@ -196,6 +204,9 @@
 			gl.dispatchCompute(width, height, 1);
 			GLU_EXPECT_NO_ERROR(gl.getError(), "Error dispatching float-to-integer compute shader");
 
+			gl.memoryBarrier(GL_FRAMEBUFFER_BARRIER_BIT);
+			GLU_EXPECT_NO_ERROR(gl.getError(), "Error setting memory barrier!");
+
 			/* Read data as unsigned ints */
 			gl.readPixels(0, 0, width, height, GL_RGBA_INTEGER, GL_UNSIGNED_INT, &resultData[0]);
 			GLU_EXPECT_NO_ERROR(gl.getError(), "Error reading pixels from frame buffer!");
@@ -723,8 +734,6 @@
 	{
 		gl.dispatchCompute(width, height, depth);
 		GLU_EXPECT_NO_ERROR(gl.getError(), "Error running compute shader!");
-		gl.memoryBarrier(GL_FRAMEBUFFER_BARRIER_BIT);
-		GLU_EXPECT_NO_ERROR(gl.getError(), "Error setting memory barrier!");
 
 		break;
 	}
@@ -746,8 +755,6 @@
 
 		gl.drawArrays(GL_POINTS, 0, 1);
 		GLU_EXPECT_NO_ERROR(gl.getError(), "Rendering failed!");
-		gl.memoryBarrier(GL_FRAMEBUFFER_BARRIER_BIT);
-		GLU_EXPECT_NO_ERROR(gl.getError(), "Error setting memory barrier!");
 
 		break;
 	}
@@ -770,8 +777,6 @@
 
 		gl.drawArrays(m_glExtTokens.PATCHES, 0, 1);
 		GLU_EXPECT_NO_ERROR(gl.getError(), "Rendering failed!");
-		gl.memoryBarrier(GL_FRAMEBUFFER_BARRIER_BIT);
-		GLU_EXPECT_NO_ERROR(gl.getError(), "Error setting memory barrier!");
 
 		gl.patchParameteri(m_glExtTokens.PATCH_VERTICES, 3);
 		GLU_EXPECT_NO_ERROR(gl.getError(), "Error setting patch parameter!");