| From 09c75f3e4defc2fa79694eaa185d87f0c49719d4 Mon Sep 17 00:00:00 2001 |
| From: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> |
| Date: Tue, 7 Apr 2020 22:23:09 +0200 |
| Subject: [PATCH] radv: Consider maximum sample distances for entire grid. |
| |
| The other pixels in the grid might have samples with a larger |
| distance than the (0,0) pixel. |
| |
| Fixes dEQP-VK.pipeline.multisample.sample_locations_ext.verify_location.samples_8_packed |
| when CTS is compiled with clang. |
| |
| CC: <mesa-stable@lists.freedesktop.org> |
| --- |
| src/amd/vulkan/radv_cmd_buffer.c | 10 ++++++---- |
| 1 file changed, 6 insertions(+), 4 deletions(-) |
| |
| diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c |
| index ce9d45e7f75..6e424823e8c 100644 |
| --- a/src/amd/vulkan/radv_cmd_buffer.c |
| +++ b/src/amd/vulkan/radv_cmd_buffer.c |
| @@ -792,10 +792,12 @@ radv_emit_sample_locations(struct radv_cmd_buffer *cmd_buffer) |
| num_samples); |
| |
| /* Compute the maximum sample distance from the specified locations. */ |
| - for (uint32_t i = 0; i < num_samples; i++) { |
| - VkOffset2D offset = sample_locs[0][i]; |
| - max_sample_dist = MAX2(max_sample_dist, |
| - MAX2(abs(offset.x), abs(offset.y))); |
| + for (unsigned i = 0; i < 4; ++i) { |
| + for (uint32_t j = 0; j < num_samples; j++) { |
| + VkOffset2D offset = sample_locs[i][j]; |
| + max_sample_dist = MAX2(max_sample_dist, |
| + MAX2(abs(offset.x), abs(offset.y))); |
| + } |
| } |
| |
| /* Emit the specified user sample locations. */ |
| -- |
| 2.24.1 |
| |