Mesa (staging/21.2): radv: use pool stride when copying single query results

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 31 16:27:42 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: 29e51b6eb015ced280a496e2b05a92dad04fd595
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=29e51b6eb015ced280a496e2b05a92dad04fd595

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Mon Aug 30 10:31:15 2021 -0400

radv: use pool stride when copying single query results

the specified stride is irrelevant for this case since there's only one
result to write

Cc: mesa-stable

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12619>
(cherry picked from commit 90a0556c27c40e3520d645f2512d4596a109c55c)

---

 .pick_status.json           | 2 +-
 src/amd/vulkan/radv_query.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index c023dfce531..3c43c3f8c4a 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -211,7 +211,7 @@
         "description": "radv: use pool stride when copying single query results",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
index b0b8453cf4c..f5353e8dacb 100644
--- a/src/amd/vulkan/radv_query.c
+++ b/src/amd/vulkan/radv_query.c
@@ -854,7 +854,8 @@ radv_query_shader(struct radv_cmd_buffer *cmd_buffer, VkPipeline *pipeline,
    old_predicating = cmd_buffer->state.predicating;
    cmd_buffer->state.predicating = false;
 
-   struct radv_buffer dst_buffer = {.bo = dst_bo, .offset = dst_offset, .size = dst_stride * count};
+   uint64_t dst_buffer_size = count == 1 ? src_stride : dst_stride * count;
+   struct radv_buffer dst_buffer = {.bo = dst_bo, .offset = dst_offset, .size = dst_buffer_size};
 
    struct radv_buffer src_buffer = {
       .bo = src_bo,



More information about the mesa-commit mailing list