From 11dee755b053027cac32fcaf80c8f69247faf883 Mon Sep 17 00:00:00 2001 From: Ari Suonpaa Date: Thu, 21 Apr 2022 13:52:25 +0300 Subject: [PATCH] Add test for depth comparison with texel replacement 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 | 1 + android/cts/main/vk-master/texture.txt | 1 + external/fetch_sources.py | 2 +- .../shadow/texel_replacement/d32_sfloat.amber | 51 ++++++++++++++++++++++ .../vulkan/texture/vktTextureShadowTests.cpp | 11 +++++ .../vulkancts/mustpass/main/vk-default/texture.txt | 1 + 6 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 external/vulkancts/data/vulkan/amber/texture/shadow/texel_replacement/d32_sfloat.amber diff --git a/android/cts/main/vk-master-2022-03-01/texture.txt b/android/cts/main/vk-master-2022-03-01/texture.txt index 779c456..af2fb4a 100644 --- a/android/cts/main/vk-master-2022-03-01/texture.txt +++ b/android/cts/main/vk-master-2022-03-01/texture.txt @@ -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 diff --git a/android/cts/main/vk-master/texture.txt b/android/cts/main/vk-master/texture.txt index afe8bce..7a346f6 100644 --- a/android/cts/main/vk-master/texture.txt +++ b/android/cts/main/vk-master/texture.txt @@ -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 diff --git a/external/fetch_sources.py b/external/fetch_sources.py index 81fd02c..73c731b 100644 --- a/external/fetch_sources.py +++ b/external/fetch_sources.py @@ -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 index 0000000..ac23211 --- /dev/null +++ b/external/vulkancts/data/vulkan/amber/texture/shadow/texel_replacement/d32_sfloat.amber @@ -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 diff --git a/external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp b/external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp index 225cd1b..8f98427 100644 --- a/external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp +++ b/external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp @@ -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 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) diff --git a/external/vulkancts/mustpass/main/vk-default/texture.txt b/external/vulkancts/mustpass/main/vk-default/texture.txt index 23bb283..5b86071 100644 --- a/external/vulkancts/mustpass/main/vk-default/texture.txt +++ b/external/vulkancts/mustpass/main/vk-default/texture.txt @@ -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 -- 2.7.4