diff --git a/src/panfrost/ci/panfrost-g52-fails.txt b/src/panfrost/ci/panfrost-g52-fails.txt index e406514810a..8837c09ba3c 100644 --- a/src/panfrost/ci/panfrost-g52-fails.txt +++ b/src/panfrost/ci/panfrost-g52-fails.txt @@ -2643,10 +2643,6 @@ dEQP-VK.compute.pipeline.indirect_dispatch.upload_buffer.multiple_groups_multipl dEQP-VK.compute.pipeline.indirect_dispatch.upload_buffer.single_invocation,Crash dEQP-VK.compute.pipeline.indirect_dispatch.upload_buffer.small_offset,Crash -# Filtering of 3D depth-stencil textures fails unless we set SAMPLER:round_to_nearest_even=false -dEQP-VK.texture.filtering.3d.formats.d24_unorm_s8_uint_stencil.d24_unorm_s8_uint_stencil_nearest,Fail -dEQP-VK.texture.filtering.3d.formats.d32_sfloat_s8_uint_stencil.d32_sfloat_s8_uint_stencil_nearest,Fail - # CTS bug, see https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/5296 dEQP-VK.api.device_init.create_device_unsupported_features.protected_memory_features,Fail diff --git a/src/panfrost/ci/panfrost-g610-fails.txt b/src/panfrost/ci/panfrost-g610-fails.txt index 9f9605f693b..f3ef3c2f4a1 100644 --- a/src/panfrost/ci/panfrost-g610-fails.txt +++ b/src/panfrost/ci/panfrost-g610-fails.txt @@ -258,10 +258,6 @@ spec@ext_image_dma_buf_import@ext_image_dma_buf_import-refcount-multithread,Cras # physical device and device needs more robustness in allocation handling -# Filtering of 3D depth-stencil textures fails unless we set SAMPLER:round_to_nearest_even=false -dEQP-VK.texture.filtering.3d.formats.d24_unorm_s8_uint_stencil.d24_unorm_s8_uint_stencil_nearest,Fail -dEQP-VK.texture.filtering.3d.formats.d32_sfloat_s8_uint_stencil.d32_sfloat_s8_uint_stencil_nearest,Fail - # CTS bug, see https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/5296 dEQP-VK.api.device_init.create_device_unsupported_features.protected_memory_features,Fail diff --git a/src/panfrost/vulkan/panvk_vX_sampler.c b/src/panfrost/vulkan/panvk_vX_sampler.c index 4773963690a..996a8875fce 100644 --- a/src/panfrost/vulkan/panvk_vX_sampler.c +++ b/src/panfrost/vulkan/panvk_vX_sampler.c @@ -113,6 +113,24 @@ panvk_per_arch(CreateSampler)(VkDevice _device, cfg.normalized_coordinates = !pCreateInfo->unnormalizedCoordinates; cfg.clamp_integer_array_indices = false; + /* Normalized float texture coordinates are rounded to fixed-point + * before rounding to integer coordinates. When round_to_nearest_even is + * enabled with VK_FILTER_NEAREST, the upper 2^-9 float coordinates in + * each texel are rounded up to the next texel. + * + * The Vulkan 1.4.304 spec seems to allow both rounding modes for all + * filters, but a CTS bug[1] causes test failures when round-to-nearest + * is used with VK_FILTER_NEAREST. + * + * Regardless, disabling round_to_nearest_even for NEAREST filters + * is a desirable precision improvement. + * + * [1]: https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/5547 + */ + if (pCreateInfo->minFilter == VK_FILTER_NEAREST && + pCreateInfo->magFilter == VK_FILTER_NEAREST) + cfg.round_to_nearest_even = false; + cfg.lod_bias = pCreateInfo->mipLodBias; cfg.minimum_lod = pCreateInfo->minLod; cfg.maximum_lod = pCreateInfo->maxLod;