diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-06-27 08:29:06 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-07-01 07:42:55 -0700 |
commit | c9b164f9b59d5f201b2c50838a03d9d3d8bda1a6 (patch) | |
tree | ef897280f524ced4b42913cdb53399cdc8079967 /src/gallium/drivers/panfrost/pan_context.c | |
parent | 8fd748de3d3faa4845be7abc1987e90b9d668935 (diff) |
panfrost: Implement dispatch helpers
Rather than open-coding workgroups_shift_* type fields, we include a
general routine for packing the vertex/tiler/compute descriptor based on
the provided dispatch parameters.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_context.c')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index bf98d3853f1..871b168040c 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -283,11 +283,6 @@ static void panfrost_emit_vertex_payload(struct panfrost_context *ctx) { struct midgard_payload_vertex_tiler payload = { - .prefix = { - .workgroups_z_shift = 32, - .workgroups_x_shift_2 = 0x2, - .workgroups_x_shift_3 = 0x5, - }, .gl_enables = 0x4 | (ctx->is_t6xx ? 0 : 0x2), }; @@ -299,10 +294,6 @@ panfrost_emit_tiler_payload(struct panfrost_context *ctx) { struct midgard_payload_vertex_tiler payload = { .prefix = { - .workgroups_z_shift = 32, - .workgroups_x_shift_2 = 0x2, - .workgroups_x_shift_3 = 0x6, - .zero1 = 0xffff, /* Why is this only seen on test-quad-textured? */ }, }; @@ -1668,7 +1659,7 @@ panfrost_draw_vbo( ctx->vertex_count = info->count; /* For non-indexed draws, they're the same */ - unsigned invocation_count = ctx->vertex_count; + unsigned vertex_count = ctx->vertex_count; unsigned draw_flags = 0; @@ -1701,7 +1692,7 @@ panfrost_draw_vbo( } /* Use the corresponding values */ - invocation_count = max_index - min_index + 1; + vertex_count = max_index - min_index + 1; ctx->payload_vertex.draw_start = min_index; ctx->payload_tiler.draw_start = min_index; @@ -1724,8 +1715,15 @@ panfrost_draw_vbo( ctx->payload_tiler.prefix.indices = (uintptr_t) NULL; } - ctx->payload_vertex.prefix.invocation_count = MALI_POSITIVE(invocation_count); - ctx->payload_tiler.prefix.invocation_count = MALI_POSITIVE(invocation_count); + /* Dispatch "compute jobs" for the vertex/tiler pair as (1, + * vertex_count, 1) */ + + panfrost_pack_work_groups_fused( + &ctx->payload_vertex.prefix, + &ctx->payload_tiler.prefix, + 1, vertex_count, 1, + 1, 1, 1); + ctx->payload_tiler.prefix.unknown_draw = draw_flags; /* Fire off the draw itself */ |