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>
This commit is contained in:
Alyssa Rosenzweig
2021-12-13 15:18:56 -05:00
committed by Marge Bot
parent e9b509755b
commit d696183d4d
+3 -3
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;
}