libagx: extend indirect tess to handle indexed

this was missed, vk cts hits it

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31908>
This commit is contained in:
Alyssa Rosenzweig
2024-10-16 16:57:07 -04:00
parent 5e464521fb
commit e68aed3a13
2 changed files with 28 additions and 1 deletions
+19
View File
@@ -187,6 +187,25 @@ libagx_tess_setup_indirect(global struct libagx_tess_args *p, bool with_counts,
/* TODO */
}
global struct agx_ia_state *ia = p->ia;
ia->verts_per_instance = count;
/* If indexing is enabled, the third word is the offset into the index buffer
* in elements. Apply that offset now that we have it. For a hardware
* indirect draw, the hardware would do this for us, but for software input
* assembly we need to do it ourselves.
*
* XXX: Deduplicate?
*/
if (p->in_index_size_B) {
ia->index_buffer =
libagx_index_buffer(p->in_index_buffer, p->in_index_buffer_range_el,
p->indirect[2], p->in_index_size_B, 0);
ia->index_buffer_range_el = libagx_index_buffer_range_el(
p->in_index_buffer_range_el, p->indirect[2]);
}
/* VS grid size */
p->grids[0] = count;
p->grids[1] = instance_count;
+9 -1
View File
@@ -81,6 +81,9 @@ struct libagx_tess_args {
*/
GLOBAL(uint32_t) grids;
/* For indirect draws, the output input assembly descriptor */
GLOBAL(struct agx_ia_state) ia;
/* For indirect draws, the indirect draw descriptor. */
GLOBAL(uint32_t) indirect;
@@ -91,6 +94,11 @@ struct libagx_tess_args {
*/
GLOBAL(uint64_t) vertex_output_buffer_ptr;
/* Yet more indirect draw garbage. I need a refactor. */
uint64_t in_index_buffer;
uint32_t in_index_buffer_range_el;
uint32_t in_index_size_B;
/* When geom+tess used together, the buffer containing TES outputs (executed
* as a hardware compute shader).
*/
@@ -126,4 +134,4 @@ struct libagx_tess_args {
/* Number of patches being tessellated */
uint32_t nr_patches;
} PACKED;
AGX_STATIC_ASSERT(sizeof(struct libagx_tess_args) == 42 * 4);
AGX_STATIC_ASSERT(sizeof(struct libagx_tess_args) == 48 * 4);