diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2021-03-24 18:12:03 -0400 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2021-03-25 10:36:42 -0700 |
commit | f0b620307eaaa46272ed35bdc88ea55c2af6bebe (patch) | |
tree | 18325a198e090c1b7b1e64193da97559ffcebec1 /src | |
parent | 8d32c55d9322239dcfab410ec5281b86f87a556f (diff) |
lavapipe: use the passed offset for CmdCopyQueryPoolResults
this avoids overwriting buffer[0] on every copy
Fixes: b38879f8c5f ("vallium: initial import of the vulkan frontend")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9813>
(cherry picked from commit e20aebb83c5af9ddf11167c39f9b76434e1e7083)
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/frontends/lavapipe/lvp_execute.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index f882de5b118..cc6ded77382 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -2096,7 +2096,7 @@ static void handle_copy_query_pool_results(struct lvp_cmd_buffer_entry *cmd, struct lvp_query_pool *pool = copycmd->pool; for (unsigned i = copycmd->first_query; i < copycmd->first_query + copycmd->query_count; i++) { - unsigned offset = copycmd->dst->offset + (copycmd->stride * (i - copycmd->first_query)); + unsigned offset = copycmd->dst_offset + copycmd->dst->offset + (copycmd->stride * (i - copycmd->first_query)); if (pool->queries[i]) { if (copycmd->flags & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) state->pctx->get_query_result_resource(state->pctx, @@ -2119,8 +2119,9 @@ static void handle_copy_query_pool_results(struct lvp_cmd_buffer_entry *cmd, struct pipe_transfer *src_t; uint32_t *map; - struct pipe_box box = {}; - box.width = copycmd->stride * copycmd->query_count; + struct pipe_box box = {0}; + box.x = offset; + box.width = copycmd->stride; box.height = 1; box.depth = 1; map = state->pctx->transfer_map(state->pctx, |