anv/xehp+: Enable TBIMR in generated draw calls.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
This commit is contained in:
Francisco Jerez 2023-10-20 14:22:36 -07:00
parent 65bbe58b25
commit 08fd259b5b
4 changed files with 10 additions and 1 deletions

View file

@ -64,6 +64,7 @@ genX(cmd_buffer_emit_generate_draws)(struct anv_cmd_buffer *cmd_buffer,
struct anv_graphics_pipeline *pipeline = cmd_buffer->state.gfx.pipeline;
const struct brw_vs_prog_data *vs_prog_data = get_vs_prog_data(pipeline);
const bool use_tbimr = cmd_buffer->state.gfx.dyn_state.use_tbimr;
struct anv_address draw_count_addr;
if (anv_address_is_null(count_addr)) {
@ -80,7 +81,8 @@ genX(cmd_buffer_emit_generate_draws)(struct anv_cmd_buffer *cmd_buffer,
.draw_id_addr = anv_address_physical(draw_id_addr),
.indirect_data_addr = anv_address_physical(indirect_data_addr),
.indirect_data_stride = indirect_data_stride,
.flags = (indexed ? ANV_GENERATED_FLAG_INDEXED : 0) |
.flags = (use_tbimr ? ANV_GENERATED_FLAG_TBIMR : 0) |
(indexed ? ANV_GENERATED_FLAG_INDEXED : 0) |
(cmd_buffer->state.conditional_render_enabled ?
ANV_GENERATED_FLAG_PREDICATED : 0) |
((vs_prog_data->uses_firstvertex ||

View file

@ -95,6 +95,7 @@ void write_3DPRIMITIVE(uint write_offset,
void write_3DPRIMITIVE_EXTENDED(uint write_offset,
bool is_predicated,
bool is_indexed,
bool use_tbimr,
uint vertex_count_per_instance,
uint start_vertex_location,
uint instance_count,
@ -107,6 +108,7 @@ void write_3DPRIMITIVE_EXTENDED(uint write_offset,
commands[write_offset + 0] = (3 << 29 | /* Command Type */
3 << 27 | /* Command SubType */
3 << 24 | /* 3D Command Opcode */
uint(use_tbimr) << 13 |
1 << 11 | /* Extended Parameter Enable */
uint(is_predicated) << 8 |
8 << 0); /* DWord Length */

View file

@ -31,6 +31,7 @@ void gfx11_write_draw(uint item_idx, uint cmd_idx, uint draw_id)
{
bool is_indexed = (params.flags & ANV_GENERATED_FLAG_INDEXED) != 0;
bool is_predicated = (params.flags & ANV_GENERATED_FLAG_PREDICATED) != 0;
bool use_tbimr = (params.flags & ANV_GENERATED_FLAG_TBIMR) != 0;
uint indirect_data_offset = draw_id * params.indirect_data_stride / 4;
if (is_indexed) {
@ -44,6 +45,7 @@ void gfx11_write_draw(uint item_idx, uint cmd_idx, uint draw_id)
write_3DPRIMITIVE_EXTENDED(cmd_idx,
is_predicated,
is_indexed,
use_tbimr,
index_count,
first_index,
instance_count,
@ -62,6 +64,7 @@ void gfx11_write_draw(uint item_idx, uint cmd_idx, uint draw_id)
write_3DPRIMITIVE_EXTENDED(cmd_idx,
is_predicated,
is_indexed,
use_tbimr,
vertex_count,
first_vertex,
instance_count,

View file

@ -47,6 +47,8 @@
#define ANV_GENERATED_FLAG_COUNT BITFIELD_BIT(4)
/* Whether the generation shader writes to the ring buffer */
#define ANV_GENERATED_FLAG_RING_MODE BITFIELD_BIT(5)
/* Whether TBIMR tile-based rendering shall be enabled. */
#define ANV_GENERATED_FLAG_TBIMR BITFIELD_BIT(6)
struct PACKED anv_generated_indirect_draw_params {
/* Draw ID buffer address (only used on Gfx9) */