Add test for depth comparison with texel replacement
authorAri Suonpaa <ari.suonpaa@siru.fi>
Thu, 21 Apr 2022 10:52:25 +0000 (13:52 +0300)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Fri, 6 May 2022 16:10:23 +0000 (16:10 +0000)
Amber version is also updated to get support for comparison
settings in a sampler object.

VK-GL-CTS Issue: 3604

New tests:

dEQP-VK.texture.shadow.texel_replacement.d32_sfloat

Components: Vulkan
Change-Id: I09d0b6af85195377e1b0903c3a8538f62034c1a1

android/cts/main/vk-master-2022-03-01/texture.txt
android/cts/main/vk-master/texture.txt
external/fetch_sources.py
external/vulkancts/data/vulkan/amber/texture/shadow/texel_replacement/d32_sfloat.amber [new file with mode: 0644]
external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp
external/vulkancts/mustpass/main/vk-default/texture.txt

index 779c456..af2fb4a 100644 (file)
@@ -2948,6 +2948,7 @@ dEQP-VK.texture.shadow.cube_array.linear_mipmap_linear.never_r16_unorm
 dEQP-VK.texture.shadow.cube_array.linear_mipmap_linear.sparse_never_r16_unorm
 dEQP-VK.texture.shadow.cube_array.linear_mipmap_linear.never_r32_sfloat
 dEQP-VK.texture.shadow.cube_array.linear_mipmap_linear.sparse_never_r32_sfloat
+dEQP-VK.texture.shadow.texel_replacement.d32_sfloat
 dEQP-VK.texture.filtering_anisotropy.single_level.anisotropy_2.mag_nearest_min_nearest
 dEQP-VK.texture.filtering_anisotropy.single_level.anisotropy_2.mag_linear_min_nearest
 dEQP-VK.texture.filtering_anisotropy.single_level.anisotropy_2.mag_nearest_min_linear
index afe8bce..7a346f6 100644 (file)
@@ -8226,6 +8226,7 @@ dEQP-VK.texture.shadow.cube_array.linear_mipmap_linear.never_r16_unorm
 dEQP-VK.texture.shadow.cube_array.linear_mipmap_linear.sparse_never_r16_unorm
 dEQP-VK.texture.shadow.cube_array.linear_mipmap_linear.never_r32_sfloat
 dEQP-VK.texture.shadow.cube_array.linear_mipmap_linear.sparse_never_r32_sfloat
+dEQP-VK.texture.shadow.texel_replacement.d32_sfloat
 dEQP-VK.texture.filtering_anisotropy.basic.anisotropy_2.mag_nearest_min_nearest
 dEQP-VK.texture.filtering_anisotropy.basic.anisotropy_2.mag_linear_min_nearest
 dEQP-VK.texture.filtering_anisotropy.basic.anisotropy_2.mag_nearest_min_linear
index 81fd02c..73c731b 100644 (file)
@@ -314,7 +314,7 @@ PACKAGES = [
        GitRepo(
                "https://github.com/google/amber.git",
                "git@github.com:google/amber.git",
-               "615ab4863f7d2e31d3037d0c6a0f641fd6fc0d07",
+               "8b145a6c89dcdb4ec28173339dd176fb7b6f43ed",
                "amber"),
 ]
 
diff --git a/external/vulkancts/data/vulkan/amber/texture/shadow/texel_replacement/d32_sfloat.amber b/external/vulkancts/data/vulkan/amber/texture/shadow/texel_replacement/d32_sfloat.amber
new file mode 100644 (file)
index 0000000..ac23211
--- /dev/null
@@ -0,0 +1,51 @@
+#!amber
+
+# Copyright 2022 Google LLC.
+# Copyright 2022 The Khronos Group Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+SHADER vertex vert_shader PASSTHROUGH
+
+SHADER fragment frag_shader GLSL
+#version 430
+layout(location = 0) out vec4 color_out;
+uniform layout(set=0, binding=0) sampler2DShadow tex;
+void main()
+{
+    // Sample border color of opaque white which makes the depth comparison 0.5 > 1.0 false.
+    color_out = vec4(texture(tex, vec3(2.0, 2.0, 0.5)), 0.0, 0.0, 1.0);
+}
+END
+
+IMAGE texture FORMAT D32_SFLOAT DIM_2D WIDTH 32 HEIGHT 32 FILL 0.0
+IMAGE framebuffer FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 32 HEIGHT 32
+
+SAMPLER sampler_float_opaque_white \
+  ADDRESS_MODE_U clamp_to_border \
+  ADDRESS_MODE_V clamp_to_border \
+  BORDER_COLOR float_opaque_white \
+  COMPARE on \
+  COMPARE_OP greater
+
+PIPELINE graphics pipeline_float_opaque_white
+  ATTACH vert_shader
+  ATTACH frag_shader
+  BIND BUFFER texture AS combined_image_sampler SAMPLER sampler_float_opaque_white DESCRIPTOR_SET 0 BINDING 0
+  FRAMEBUFFER_SIZE 32 32
+  BIND BUFFER framebuffer AS color LOCATION 0
+END
+
+RUN pipeline_float_opaque_white DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 0 0 0 255
index 225cd1b..8f98427 100644 (file)
@@ -24,6 +24,7 @@
  *//*--------------------------------------------------------------------*/
 
 #include "vktTextureShadowTests.hpp"
+#include "vktAmberTestCase.hpp"
 
 #include "deMath.h"
 #include "deString.h"
@@ -1809,6 +1810,16 @@ void populateTextureShadowTests (tcu::TestCaseGroup* textureShadowTests)
                textureShadowTests->addChild(groupCubeArray.release());
        }
 
+       // Texel replacement tests.
+       {
+               de::MovePtr<tcu::TestCaseGroup> groupTexelReplacement   (new tcu::TestCaseGroup(testCtx, "texel_replacement", "Texel replacement texture shadow lookup tests"));
+
+               cts_amber::AmberTestCase*               testCaseLod                             = cts_amber::createAmberTestCase(testCtx, "d32_sfloat", "", "texture/shadow/texel_replacement", "d32_sfloat.amber");
+
+               groupTexelReplacement->addChild(testCaseLod);
+               textureShadowTests->addChild(groupTexelReplacement.release());
+       }
+
 }
 
 tcu::TestCaseGroup* createTextureShadowTests (tcu::TestContext& testCtx)
index 23bb283..5b86071 100644 (file)
@@ -8416,6 +8416,7 @@ dEQP-VK.texture.shadow.cube_array.linear_mipmap_linear.never_r16_unorm
 dEQP-VK.texture.shadow.cube_array.linear_mipmap_linear.sparse_never_r16_unorm
 dEQP-VK.texture.shadow.cube_array.linear_mipmap_linear.never_r32_sfloat
 dEQP-VK.texture.shadow.cube_array.linear_mipmap_linear.sparse_never_r32_sfloat
+dEQP-VK.texture.shadow.texel_replacement.d32_sfloat
 dEQP-VK.texture.filtering_anisotropy.basic.anisotropy_2.mag_nearest_min_nearest
 dEQP-VK.texture.filtering_anisotropy.basic.anisotropy_2.mag_linear_min_nearest
 dEQP-VK.texture.filtering_anisotropy.basic.anisotropy_2.mag_nearest_min_linear