Extended: texel_view_compatible: image: fix image coord
authorYahan Zhou <yahan@google.com>
Mon, 30 Sep 2019 22:12:45 +0000 (15:12 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 3 Oct 2019 15:26:02 +0000 (11:26 -0400)
Image coords in compute shaders need manual +0.5.

Affects:
dEQP-VK.image.texel_view_compatible.compute.extended.*.texture.*

Components: Vulkan

VK-GL-CTS issue: 1890

Change-Id: Iec93340004807252b0956e3d2fa19bacb899ff7b

external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp

index 6a8f554..ae83408 100644 (file)
@@ -2605,13 +2605,13 @@ void TexelViewCompatibleCase::initPrograms (vk::SourceCollections&      programCollec
                                        {
                                                // IMAGE_TYPE_1D
                                                "    const int     pos = int(gl_GlobalInvocationID.x);\n"
-                                               "    const float coord = float(gl_GlobalInvocationID.x) / pixels_resolution.x;\n",
+                                               "    const float coord = (float(gl_GlobalInvocationID.x) + 0.5) / pixels_resolution.x;\n",
                                                // IMAGE_TYPE_2D
                                                "    const ivec2  pos = ivec2(gl_GlobalInvocationID.xy);\n"
-                                               "    const vec2 coord = vec2(gl_GlobalInvocationID.xy) / vec2(pixels_resolution);\n",
+                                               "    const vec2 coord = (vec2(gl_GlobalInvocationID.xy) + 0.5) / vec2(pixels_resolution);\n",
                                                // IMAGE_TYPE_3D
                                                "    const ivec3  pos = ivec3(gl_GlobalInvocationID.xy, 0);\n"
-                                               "    const vec2    v2 = vec2(gl_GlobalInvocationID.xy) / vec2(pixels_resolution);\n"
+                                               "    const vec2    v2 = (vec2(gl_GlobalInvocationID.xy) + 0.5) / vec2(pixels_resolution);\n"
                                                "    const vec3 coord = vec3(v2, 0.0);\n",
                                        };