diff --git a/src/asahi/lib/agx_nir_lower_gs.c b/src/asahi/lib/agx_nir_lower_gs.c index 047ffc2961f..632e4f7ab46 100644 --- a/src/asahi/lib/agx_nir_lower_gs.c +++ b/src/asahi/lib/agx_nir_lower_gs.c @@ -893,7 +893,7 @@ agx_nir_create_pre_gs(struct lower_gs_state *state, const nir_shader *libagx, /* Setup the draw from the rasterization stream (0). */ if (!state->rasterizer_discard) { libagx_build_gs_draw( - b, nir_load_geometry_param_buffer_agx(b), nir_imm_bool(b, indexed), + b, nir_load_geometry_param_buffer_agx(b), previous_vertices(b, state, 0, unrolled_in_prims), restart ? previous_primitives(b, state, 0, unrolled_in_prims) : nir_imm_int(b, 0)); diff --git a/src/asahi/lib/shaders/geometry.cl b/src/asahi/lib/shaders/geometry.cl index 52ad42db2eb..e5bb5afaed9 100644 --- a/src/asahi/lib/shaders/geometry.cl +++ b/src/asahi/lib/shaders/geometry.cl @@ -419,33 +419,26 @@ libagx_end_primitive(global int *index_buffer, uint total_verts, } void -libagx_build_gs_draw(global struct agx_geometry_params *p, bool indexed, - uint vertices, uint primitives) +libagx_build_gs_draw(global struct agx_geometry_params *p, uint vertices, + uint primitives) { global uint *descriptor = p->indirect_desc; global struct agx_geometry_state *state = p->state; /* Setup the indirect draw descriptor */ - if (indexed) { - uint indices = vertices + primitives; /* includes restart indices */ + uint indices = vertices + primitives; /* includes restart indices */ - /* Allocate the index buffer */ - uint index_buffer_offset_B = state->heap_bottom; - p->output_index_buffer = - (global uint *)(state->heap + index_buffer_offset_B); - state->heap_bottom += (indices * 4); + /* Allocate the index buffer */ + uint index_buffer_offset_B = state->heap_bottom; + p->output_index_buffer = + (global uint *)(state->heap + index_buffer_offset_B); + state->heap_bottom += (indices * 4); - descriptor[0] = indices; /* count */ - descriptor[1] = 1; /* instance count */ - descriptor[2] = index_buffer_offset_B / 4; /* start */ - descriptor[3] = 0; /* index bias */ - descriptor[4] = 0; /* start instance */ - } else { - descriptor[0] = vertices; /* count */ - descriptor[1] = 1; /* instance count */ - descriptor[2] = 0; /* start */ - descriptor[3] = 0; /* start instance */ - } + descriptor[0] = indices; /* count */ + descriptor[1] = 1; /* instance count */ + descriptor[2] = index_buffer_offset_B / 4; /* start */ + descriptor[3] = 0; /* index bias */ + descriptor[4] = 0; /* start instance */ if (state->heap_bottom > 1024 * 1024 * 128) { global uint *foo = (global uint *)(uintptr_t)0xdeadbeef;