mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 02:20:11 +01:00
lavapipe: refactor base draw dispatch to handle multidraws
each direct draw cmd now contains n draws (though right now n=1) Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9843>
This commit is contained in:
parent
a42b2f11cb
commit
e92931f6c4
3 changed files with 8 additions and 9 deletions
|
|
@ -493,14 +493,16 @@ VKAPI_ATTR void VKAPI_CALL lvp_CmdDraw(
|
|||
LVP_FROM_HANDLE(lvp_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct lvp_cmd_buffer_entry *cmd;
|
||||
|
||||
cmd = cmd_buf_entry_alloc(cmd_buffer, LVP_CMD_DRAW);
|
||||
uint32_t cmd_size = sizeof(struct pipe_draw_start_count);
|
||||
cmd = cmd_buf_entry_alloc_size(cmd_buffer, cmd_size, LVP_CMD_DRAW);
|
||||
if (!cmd)
|
||||
return;
|
||||
|
||||
cmd->u.draw.vertex_count = vertexCount;
|
||||
cmd->u.draw.instance_count = instanceCount;
|
||||
cmd->u.draw.first_vertex = firstVertex;
|
||||
cmd->u.draw.first_instance = firstInstance;
|
||||
cmd->u.draw.draw_count = 1;
|
||||
cmd->u.draw.draws[0].start = firstVertex;
|
||||
cmd->u.draw.draws[0].count = vertexCount;
|
||||
|
||||
cmd_buf_queue(cmd_buffer, cmd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1549,16 +1549,13 @@ static void handle_draw(struct lvp_cmd_buffer_entry *cmd,
|
|||
struct rendering_state *state)
|
||||
{
|
||||
const struct lvp_subpass *subpass = &state->pass->subpasses[state->subpass];
|
||||
struct pipe_draw_start_count draw = {0};
|
||||
state->info.index_size = 0;
|
||||
state->info.index.resource = NULL;
|
||||
draw.start = cmd->u.draw.first_vertex;
|
||||
draw.count = cmd->u.draw.vertex_count;
|
||||
state->info.start_instance = cmd->u.draw.first_instance;
|
||||
state->info.instance_count = cmd->u.draw.instance_count;
|
||||
state->info.view_mask = subpass->view_mask;
|
||||
|
||||
state->pctx->draw_vbo(state->pctx, &state->info, NULL, &draw, 1);
|
||||
state->pctx->draw_vbo(state->pctx, &state->info, NULL, cmd->u.draw.draws, cmd->u.draw.draw_count);
|
||||
}
|
||||
|
||||
static void handle_set_viewport(struct lvp_cmd_buffer_entry *cmd,
|
||||
|
|
|
|||
|
|
@ -747,10 +747,10 @@ struct lvp_cmd_bind_vertex_buffers {
|
|||
};
|
||||
|
||||
struct lvp_cmd_draw {
|
||||
uint32_t vertex_count;
|
||||
uint32_t instance_count;
|
||||
uint32_t first_vertex;
|
||||
uint32_t first_instance;
|
||||
uint32_t draw_count;
|
||||
struct pipe_draw_start_count draws[0];
|
||||
};
|
||||
|
||||
struct lvp_cmd_draw_indexed {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue