pan/indirect_draw: Don't upload garbage UBO

There should never be a CPU pointer in GPU memory, let's say that...

Fixes: 2e6d94c198 ("panfrost: Add helpers to support indirect draws")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14154>
(cherry picked from commit d696183d4d)
This commit is contained in:
Alyssa Rosenzweig 2021-12-13 15:18:56 -05:00 committed by Eric Engestrom
parent d8715ff19b
commit 7342fa5ed9
2 changed files with 4 additions and 4 deletions

View file

@ -1363,7 +1363,7 @@
"description": "pan/indirect_draw: Don't upload garbage UBO",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "2e6d94c198e4d10c82ed3ffd59e85f460bd58950"
},

View file

@ -1171,15 +1171,15 @@ get_ubos(struct pan_pool *pool,
const struct indirect_draw_inputs *inputs)
{
struct panfrost_ptr inputs_buf =
pan_pool_alloc_aligned(pool, sizeof(inputs), 16);
pan_pool_alloc_aligned(pool, sizeof(*inputs), 16);
memcpy(inputs_buf.cpu, &inputs, sizeof(inputs));
memcpy(inputs_buf.cpu, inputs, sizeof(*inputs));
struct panfrost_ptr ubos_buf =
pan_pool_alloc_desc(pool, UNIFORM_BUFFER);
pan_pack(ubos_buf.cpu, UNIFORM_BUFFER, cfg) {
cfg.entries = DIV_ROUND_UP(sizeof(inputs), 16);
cfg.entries = DIV_ROUND_UP(sizeof(*inputs), 16);
cfg.pointer = inputs_buf.gpu;
}