mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 11:00:11 +01:00
util/primconvert: handle indirect draws
this avoids ping-ponging to the driver, which would have to call back to here anyway with the unwrapped indirect draw Reviewed-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
This commit is contained in:
parent
4673febf91
commit
26e718fb37
1 changed files with 11 additions and 7 deletions
|
|
@ -119,14 +119,18 @@ util_primconvert_draw_vbo(struct primconvert_context *pc,
|
|||
void *dst;
|
||||
unsigned ib_offset;
|
||||
|
||||
/* indirect emulated prims is not possible, as we need to know
|
||||
* draw start/count, so we must emulate. Too bad, so sad, but
|
||||
* we are already off the fast-path here.
|
||||
*/
|
||||
if (indirect && indirect->buffer) {
|
||||
/* num_draws is only applicable for direct draws: */
|
||||
assert(num_draws == 1);
|
||||
util_draw_indirect(pc->pipe, info, indirect);
|
||||
/* this is stupid, but we're already doing a readback,
|
||||
* so this thing may as well get the rest of the job done
|
||||
*/
|
||||
unsigned draw_count = 0;
|
||||
struct u_indirect_params *new_draws = util_draw_indirect_read(pc->pipe, info, indirect, &draw_count);
|
||||
if (!new_draws)
|
||||
return;
|
||||
|
||||
for (unsigned i = 0; i < draw_count; i++)
|
||||
util_primconvert_draw_vbo(pc, &new_draws[i].info, drawid_offset + i, NULL, &new_draws[i].draw, 1);
|
||||
free(new_draws);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue