From 7e0c0ba08c5a6810deb7a06405efa51c555f9b5e Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Thu, 4 Sep 2025 16:16:26 +0200 Subject: [PATCH] lavapipe: implement VK_EXT_sample_locations Seems to pass all relevant lavapipe vk cts tests zink-lavapipe fails, but it's broken in zink, update ci expectation Part-of: --- docs/features.txt | 2 +- .../drivers/zink/ci/zink-lavapipe-fails.txt | 225 ++++++++++++++++++ src/gallium/frontends/lavapipe/lvp_device.c | 59 ++++- src/gallium/frontends/lavapipe/lvp_execute.c | 59 +++++ 4 files changed, 331 insertions(+), 14 deletions(-) diff --git a/docs/features.txt b/docs/features.txt index 56211d6a099..e5b24fe9cf8 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -655,7 +655,7 @@ Khronos extensions that are not part of any Vulkan version: VK_EXT_queue_family_foreign DONE (anv, hasvk, hk, nvk, lvp, panvk, pvr, radv, tu, v3dv, vn) VK_EXT_rasterization_order_attachment_access DONE (lvp, tu, vn) VK_EXT_robustness2 DONE (anv, hasvk, hk, lvp, nvk, panvk/v10+, radv, tu, vn) - VK_EXT_sample_locations DONE (anv, hasvk, hk, nvk, radv, tu/a650+, vn) + VK_EXT_sample_locations DONE (anv, hasvk, hk, nvk, radv, tu/a650+, vn, lavapipe) VK_EXT_shader_atomic_float DONE (anv, hasvk, lvp, radv, tu, vn) VK_EXT_shader_atomic_float2 DONE (anv, lvp, radv, vn) VK_EXT_shader_float8 DONE (radv/gfx12+) diff --git a/src/gallium/drivers/zink/ci/zink-lavapipe-fails.txt b/src/gallium/drivers/zink/ci/zink-lavapipe-fails.txt index 355b62d4c54..5109eed9baf 100644 --- a/src/gallium/drivers/zink/ci/zink-lavapipe-fails.txt +++ b/src/gallium/drivers/zink/ci/zink-lavapipe-fails.txt @@ -45,6 +45,231 @@ spec@arb_framebuffer_object@execution@msaa-alpha-to-coverage_alpha-to-one_write- spec@arb_gpu_shader_fp64@execution@arb_gpu_shader_fp64-tf-separate,Fail spec@arb_program_interface_query@arb_program_interface_query-getprogramresourceindex,Fail spec@arb_program_interface_query@arb_program_interface_query-getprogramresourceindex@'vs_input2[1][0]' on GL_PROGRAM_INPUT,Fail +spec@arb_sample_locations@test,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 0- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 0- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 0- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 0- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 0- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 0- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 0- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 0- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 0- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 0- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 0- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 0- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 0- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 0- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 1- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 1- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 1- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 1- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 1- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 1- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 1- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 1- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 1- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 1- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 1- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 1- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 1- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 1- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 2- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 2- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 2- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 2- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 2- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 2- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 2- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 2- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 2- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 2- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 2- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 2- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 2- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 2- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 3- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 3- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 3- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 3- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 3- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 3- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 3- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 3- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 3- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 3- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 3- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 3- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 3- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 1- X: 3- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 0- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 0- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 0- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 0- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 0- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 0- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 0- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 0- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 0- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 0- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 0- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 0- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 0- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 0- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 1- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 1- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 1- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 1- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 1- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 1- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 1- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 1- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 1- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 1- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 1- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 1- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 1- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 1- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 2- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 2- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 2- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 2- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 2- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 2- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 2- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 2- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 2- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 2- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 2- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 2- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 2- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 2- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 3- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 3- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 3- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 3- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 3- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 3- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 3- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 3- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 3- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 3- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 3- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 3- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 3- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 2- X: 3- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 0- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 0- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 0- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 0- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 0- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 0- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 0- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 0- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 0- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 0- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 0- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 0- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 0- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 0- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 1- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 1- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 1- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 1- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 1- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 1- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 1- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 1- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 1- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 1- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 1- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 1- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 1- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 1- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 2- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 2- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 2- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 2- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 2- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 2- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 2- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 2- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 2- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 2- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 2- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 2- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 2- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 2- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 3- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 3- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 3- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 3- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 3- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 3- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 3- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 3- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 3- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 3- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 3- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 3- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 3- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 4- X: 3- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 0- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 0- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 0- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 0- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 0- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 0- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 0- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 0- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 0- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 0- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 0- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 0- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 0- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 0- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 1- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 1- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 1- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 1- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 1- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 1- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 1- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 1- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 1- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 1- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 1- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 1- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 1- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 1- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 2- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 2- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 2- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 2- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 2- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 2- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 2- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 2- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 2- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 2- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 2- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 2- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 2- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 2- Y: 6- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 3- Y: 0- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 3- Y: 0- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 3- Y: 1- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 3- Y: 1- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 3- Y: 2- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 3- Y: 2- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 3- Y: 3- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 3- Y: 3- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 3- Y: 4- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 3- Y: 4- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 3- Y: 5- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 3- Y: 5- Grid: true,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 3- Y: 6- Grid: false,Fail +spec@arb_sample_locations@test@MSAA: 8- X: 3- Y: 6- Grid: true,Fail spec@arb_sample_shading@samplemask 2,Fail spec@arb_sample_shading@samplemask 2@0.250000 mask_in_one,Fail spec@arb_sample_shading@samplemask 2@0.500000 mask_in_one,Fail diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c index 38b90f1ee35..7789236646f 100644 --- a/src/gallium/frontends/lavapipe/lvp_device.c +++ b/src/gallium/frontends/lavapipe/lvp_device.c @@ -71,6 +71,9 @@ #define LVP_API_VERSION VK_MAKE_VERSION(1, 3, VK_HEADER_VERSION) #endif +#define LVP_SAMPLE_COUNTS (VK_SAMPLE_COUNT_1_BIT | VK_SAMPLE_COUNT_4_BIT | \ + VK_SAMPLE_COUNT_8_BIT) + VKAPI_ATTR VkResult VKAPI_CALL lvp_EnumerateInstanceVersion(uint32_t* pApiVersion) { *pApiVersion = LVP_API_VERSION; @@ -255,6 +258,7 @@ static const struct vk_device_extension_table lvp_device_extensions_supported = .EXT_primitive_topology_list_restart = true, .EXT_rasterization_order_attachment_access = true, .EXT_queue_family_foreign = true, + .EXT_sample_locations = true, .EXT_sampler_filter_minmax = true, .EXT_scalar_block_layout = true, .EXT_separate_stencil_usage = true, @@ -879,9 +883,6 @@ static VkImageLayout lvp_host_copy_image_layouts[] = { static void lvp_get_properties(const struct lvp_physical_device *device, struct vk_properties *p) { - VkSampleCountFlags sample_counts = VK_SAMPLE_COUNT_1_BIT | VK_SAMPLE_COUNT_4_BIT | - VK_SAMPLE_COUNT_8_BIT; - const unsigned *grid_size = device->pscreen->compute_caps.max_grid_size; const unsigned *block_size = device->pscreen->compute_caps.max_block_size; @@ -979,16 +980,16 @@ lvp_get_properties(const struct lvp_physical_device *device, struct vk_propertie .maxFramebufferWidth = device->pscreen->caps.max_texture_2d_size, .maxFramebufferHeight = device->pscreen->caps.max_texture_2d_size, .maxFramebufferLayers = device->pscreen->caps.max_texture_array_layers, - .framebufferColorSampleCounts = sample_counts, - .framebufferDepthSampleCounts = sample_counts, - .framebufferStencilSampleCounts = sample_counts, - .framebufferNoAttachmentsSampleCounts = sample_counts, + .framebufferColorSampleCounts = LVP_SAMPLE_COUNTS, + .framebufferDepthSampleCounts = LVP_SAMPLE_COUNTS, + .framebufferStencilSampleCounts = LVP_SAMPLE_COUNTS, + .framebufferNoAttachmentsSampleCounts = LVP_SAMPLE_COUNTS, .maxColorAttachments = max_render_targets, - .sampledImageColorSampleCounts = sample_counts, - .sampledImageIntegerSampleCounts = sample_counts, - .sampledImageDepthSampleCounts = sample_counts, - .sampledImageStencilSampleCounts = sample_counts, - .storageImageSampleCounts = sample_counts, + .sampledImageColorSampleCounts = LVP_SAMPLE_COUNTS, + .sampledImageIntegerSampleCounts = LVP_SAMPLE_COUNTS, + .sampledImageDepthSampleCounts = LVP_SAMPLE_COUNTS, + .sampledImageStencilSampleCounts = LVP_SAMPLE_COUNTS, + .storageImageSampleCounts = LVP_SAMPLE_COUNTS, .maxSampleMaskWords = 1, .timestampComputeAndGraphics = true, .timestampPeriod = 1, @@ -1089,7 +1090,7 @@ lvp_get_properties(const struct lvp_physical_device *device, struct vk_propertie .filterMinmaxSingleComponentFormats = true, .maxTimelineSemaphoreValueDifference = UINT64_MAX, - .framebufferIntegerColorSampleCounts = VK_SAMPLE_COUNT_1_BIT, + .framebufferIntegerColorSampleCounts = VK_SAMPLE_COUNT_1_BIT, /* LVP_SAMPLE_COUNTS? */ /* Vulkan 1.3 */ .minSubgroupSize = lp_native_vector_width / 32, @@ -1250,6 +1251,15 @@ lvp_get_properties(const struct lvp_physical_device *device, struct vk_propertie .prefersCompactVertexOutput = true, .prefersCompactPrimitiveOutput = false, + /* VK_EXT_sample_locations */ + .sampleLocationSampleCounts = ~VK_SAMPLE_COUNT_1_BIT & LVP_SAMPLE_COUNTS, + .maxSampleLocationGridSize.width = 1, + .maxSampleLocationGridSize.height = 1, + .sampleLocationCoordinateRange[0] = 0.0f, + .sampleLocationCoordinateRange[1] = 0.9375f, + .sampleLocationSubPixelBits = 4, + .variableSampleLocations = true, + /* VK_AMDX_shader_enqueue */ #ifdef VK_ENABLE_BETA_EXTENSIONS .maxExecutionGraphDepth = 32, @@ -2763,6 +2773,29 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_GetPhysicalDeviceCalibrateableTimeDomainsEXT( return vk_outarray_status(&out); } +VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceMultisamplePropertiesEXT( + VkPhysicalDevice physicalDevice, + VkSampleCountFlagBits samples, + VkMultisamplePropertiesEXT* pMultisampleProperties) +{ + assert(pMultisampleProperties->sType == + VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT); + + VkSampleCountFlags sample_counts = + ~VK_SAMPLE_COUNT_1_BIT & LVP_SAMPLE_COUNTS; + + VkExtent2D grid_size; + if (samples & sample_counts) { + grid_size.width = 1; + grid_size.height = 1; + } else { + grid_size.width = 0; + grid_size.height = 0; + } + pMultisampleProperties->maxSampleLocationGridSize = grid_size; +} + + VKAPI_ATTR VkResult VKAPI_CALL lvp_GetCalibratedTimestampsEXT( VkDevice device, uint32_t timestampCount, diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index e7b2bf9404d..10d60a7b61c 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -111,6 +111,7 @@ struct rendering_state { bool ib_dirty; bool sample_mask_dirty; bool min_samples_dirty; + bool sample_locations_dirty; bool poison_mem; bool noop_fs_bound; struct pipe_draw_indirect_info indirect_info; @@ -198,6 +199,9 @@ struct rendering_state { bool sample_shading; bool depth_clamp_sets_clip; + bool sample_locations_enable; + uint8_t sample_locations[8]; + uint32_t num_so_targets; struct pipe_stream_output_target *so_targets[PIPE_MAX_SO_BUFFERS]; uint32_t so_offsets[PIPE_MAX_SO_BUFFERS]; @@ -524,6 +528,13 @@ static void emit_state(struct rendering_state *state) state->pctx->set_scissor_states(state->pctx, 0, state->num_scissors, state->scissors); state->scissor_dirty = false; } + + if (state->sample_locations_dirty) { + state->pctx->set_sample_locations(state->pctx, + state->sample_locations_enable ? sizeof(state->sample_locations) : 0, + state->sample_locations); + state->sample_locations_dirty = false; + } } static void @@ -611,6 +622,17 @@ update_samples(struct rendering_state *state, VkSampleCountFlags samples) state->min_samples_dirty = true; } +static void +update_samplelocs(struct rendering_state *state, + unsigned num_samples, + const struct VkSampleLocationEXT *locations) +{ + for (unsigned i = 0; i < MIN2(num_samples, 8); i++) { + state->sample_locations[i] = util_iround(CLAMP(locations[i].x, 0.0f, 0.9375f) * 16.0f); + state->sample_locations[i] |= util_iround(CLAMP(locations[i].y, 0.0f, 0.9375f) * 16.0f) << 4; + } +} + static void handle_graphics_stages(struct rendering_state *state, VkShaderStageFlagBits shader_stages, bool dynamic_tess_origin) { @@ -910,6 +932,13 @@ static void handle_graphics_pipeline(struct lvp_pipeline *pipeline, state->sample_mask = ps->ms->sample_mask; state->sample_mask_dirty = true; } + if (!BITSET_TEST(ps->dynamic, MESA_VK_DYNAMIC_MS_SAMPLE_LOCATIONS_ENABLE)) + state->sample_locations_enable = ps->ms->sample_locations_enable; + if (!BITSET_TEST(ps->dynamic, MESA_VK_DYNAMIC_MS_SAMPLE_LOCATIONS)) + if (ps->ms->sample_locations != NULL) + update_samplelocs(state, ps->ms->sample_locations->per_pixel, + ps->ms->sample_locations->locations); + state->sample_locations_dirty = true; if (!BITSET_TEST(ps->dynamic, MESA_VK_DYNAMIC_MS_ALPHA_TO_COVERAGE_ENABLE)) { state->blend_state.alpha_to_coverage = ps->ms->alpha_to_coverage_enable; state->blend_state.alpha_to_coverage_dither = state->blend_state.alpha_to_coverage; @@ -927,6 +956,8 @@ static void handle_graphics_pipeline(struct lvp_pipeline *pipeline, if (!BITSET_TEST(ps->dynamic, MESA_VK_DYNAMIC_MS_SAMPLE_MASK) && !BITSET_TEST(ps->dynamic, MESA_VK_DYNAMIC_MS_ALPHA_TO_ONE_ENABLE)) state->rs_state.multisample = false; + state->sample_locations_enable = false; + state->sample_locations_dirty = true; state->sample_shading = false; state->force_min_sample = false; if (!BITSET_TEST(ps->dynamic, MESA_VK_DYNAMIC_MS_SAMPLE_MASK)) { @@ -3667,6 +3698,24 @@ static void handle_set_alpha_to_one(struct vk_cmd_queue_entry *cmd, state->rs_state.multisample = true; } +static void +handle_set_sample_locations_enable(struct vk_cmd_queue_entry *cmd, + struct rendering_state *state) +{ + state->sample_locations_dirty |= + state->sample_locations_enable != !!cmd->u.set_sample_locations_enable_ext.sample_locations_enable; + state->sample_locations_enable = !!cmd->u.set_sample_locations_enable_ext.sample_locations_enable; +} + +static void +handle_set_sample_locations(struct vk_cmd_queue_entry *cmd, + struct rendering_state *state) +{ + const struct VkSampleLocationsInfoEXT *sl_info = cmd->u.set_sample_locations_ext.sample_locations_info; + update_samplelocs(state, MIN2(sl_info->sampleLocationsCount, 8), sl_info->pSampleLocations); + state->sample_locations_dirty = true; +} + static void handle_set_halfz(struct vk_cmd_queue_entry *cmd, struct rendering_state *state) { @@ -4885,6 +4934,9 @@ void lvp_add_enqueue_cmd_entrypoints(struct vk_device_dispatch_table *disp) ENQUEUE_CMD(CmdSetDepthBias2EXT) + ENQUEUE_CMD(CmdSetSampleLocationsEnableEXT) + ENQUEUE_CMD(CmdSetSampleLocationsEXT) + #undef ENQUEUE_CMD } @@ -5301,6 +5353,12 @@ static void lvp_execute_cmd_buffer(struct list_head *cmds, case VK_CMD_SET_DEPTH_BIAS2_EXT: handle_set_depth_bias2(cmd, state); break; + case VK_CMD_SET_SAMPLE_LOCATIONS_ENABLE_EXT: + handle_set_sample_locations_enable(cmd, state); + break; + case VK_CMD_SET_SAMPLE_LOCATIONS_EXT: + handle_set_sample_locations(cmd, state); + break; default: fprintf(stderr, "Unsupported command %s\n", vk_cmd_queue_type_names[cmd->type]); UNREACHABLE("Unsupported command"); @@ -5326,6 +5384,7 @@ VkResult lvp_execute_cmds(struct lvp_device *device, state->dsa_dirty = true; state->rs_dirty = true; state->vp_dirty = true; + state->sample_locations_dirty = true; state->rs_state.point_line_tri_clip = true; state->rs_state.unclamped_fragment_depth_values = device->vk.enabled_extensions.EXT_depth_range_unrestricted; state->sample_mask_dirty = true;