mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 15:58:05 +02:00
lavapipe/llvmpipe: make mesh draw params consistent
neither pipe_grid_info::block nor pipe_grid_info::grid_base are used by the GL frontend, and using them in lavapipe prevents the GL side from working Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37408>
This commit is contained in:
parent
3dbb7e896d
commit
ad04df6168
2 changed files with 6 additions and 25 deletions
|
|
@ -2150,6 +2150,8 @@ llvmpipe_draw_mesh_tasks(struct pipe_context *pipe,
|
|||
}
|
||||
|
||||
struct nir_shader *mhs_shader = lp->mhs->base.ir.nir;
|
||||
struct nir_shader *tsk_shader = lp->tss ? lp->tss->base.ir.nir : NULL;
|
||||
uint16_t *workgroup_size = tsk_shader ? tsk_shader->info.workgroup_size : mhs_shader->info.workgroup_size;
|
||||
int prim_out_idx = -1;
|
||||
int first_per_prim_idx = -1;
|
||||
int cull_prim_idx = -1;
|
||||
|
|
@ -2182,19 +2184,15 @@ llvmpipe_draw_mesh_tasks(struct pipe_context *pipe,
|
|||
for (unsigned dr = 0; dr < draw_count; dr++) {
|
||||
fill_grid_size(pipe, dr, info, job_info.grid_size);
|
||||
|
||||
job_info.grid_base[0] = info->grid_base[0];
|
||||
job_info.grid_base[1] = info->grid_base[1];
|
||||
job_info.grid_base[2] = info->grid_base[2];
|
||||
job_info.block_size[0] = info->block[0];
|
||||
job_info.block_size[1] = info->block[1];
|
||||
job_info.block_size[2] = info->block[2];
|
||||
job_info.block_size[0] = workgroup_size[0];
|
||||
job_info.block_size[1] = workgroup_size[1];
|
||||
job_info.block_size[2] = workgroup_size[2];
|
||||
|
||||
void *payload = NULL;
|
||||
size_t payload_stride = 0;
|
||||
int num_tasks = job_info.grid_size[2] * job_info.grid_size[1] * job_info.grid_size[0];
|
||||
int num_mesh_invocs = 1;
|
||||
if (lp->tss) {
|
||||
struct nir_shader *tsk_shader = lp->tss->base.ir.nir;
|
||||
payload_stride = tsk_shader->info.task_payload_size + 3 * sizeof(uint32_t);
|
||||
|
||||
payload = calloc(num_tasks, payload_stride);
|
||||
|
|
@ -2217,7 +2215,7 @@ llvmpipe_draw_mesh_tasks(struct pipe_context *pipe,
|
|||
lp_cs_tpool_wait_for_task(screen->cs_tpool, &task);
|
||||
}
|
||||
if (!lp->queries_disabled)
|
||||
lp->pipeline_statistics.ts_invocations += num_tasks * info->block[0] * info->block[1] * info->block[2];
|
||||
lp->pipeline_statistics.ts_invocations += num_tasks * job_info.block_size[0] * job_info.block_size[1] * job_info.block_size[2];
|
||||
num_mesh_invocs = num_tasks;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4012,24 +4012,9 @@ handle_shaders(struct vk_cmd_queue_entry *cmd, struct rendering_state *state)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
update_mesh_state(struct rendering_state *state)
|
||||
{
|
||||
if (state->shaders[MESA_SHADER_TASK]) {
|
||||
state->dispatch_info.block[0] = state->shaders[MESA_SHADER_TASK]->pipeline_nir->nir->info.workgroup_size[0];
|
||||
state->dispatch_info.block[1] = state->shaders[MESA_SHADER_TASK]->pipeline_nir->nir->info.workgroup_size[1];
|
||||
state->dispatch_info.block[2] = state->shaders[MESA_SHADER_TASK]->pipeline_nir->nir->info.workgroup_size[2];
|
||||
} else {
|
||||
state->dispatch_info.block[0] = state->shaders[MESA_SHADER_MESH]->pipeline_nir->nir->info.workgroup_size[0];
|
||||
state->dispatch_info.block[1] = state->shaders[MESA_SHADER_MESH]->pipeline_nir->nir->info.workgroup_size[1];
|
||||
state->dispatch_info.block[2] = state->shaders[MESA_SHADER_MESH]->pipeline_nir->nir->info.workgroup_size[2];
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_draw_mesh_tasks(struct vk_cmd_queue_entry *cmd,
|
||||
struct rendering_state *state)
|
||||
{
|
||||
update_mesh_state(state);
|
||||
state->dispatch_info.grid[0] = cmd->u.draw_mesh_tasks_ext.group_count_x;
|
||||
state->dispatch_info.grid[1] = cmd->u.draw_mesh_tasks_ext.group_count_y;
|
||||
state->dispatch_info.grid[2] = cmd->u.draw_mesh_tasks_ext.group_count_z;
|
||||
|
|
@ -4044,7 +4029,6 @@ static void handle_draw_mesh_tasks(struct vk_cmd_queue_entry *cmd,
|
|||
static void handle_draw_mesh_tasks_indirect(struct vk_cmd_queue_entry *cmd,
|
||||
struct rendering_state *state)
|
||||
{
|
||||
update_mesh_state(state);
|
||||
state->dispatch_info.indirect = lvp_buffer_from_handle(cmd->u.draw_mesh_tasks_indirect_ext.buffer)->bo;
|
||||
state->dispatch_info.indirect_offset = cmd->u.draw_mesh_tasks_indirect_ext.offset;
|
||||
state->dispatch_info.indirect_stride = cmd->u.draw_mesh_tasks_indirect_ext.stride;
|
||||
|
|
@ -4055,7 +4039,6 @@ static void handle_draw_mesh_tasks_indirect(struct vk_cmd_queue_entry *cmd,
|
|||
static void handle_draw_mesh_tasks_indirect_count(struct vk_cmd_queue_entry *cmd,
|
||||
struct rendering_state *state)
|
||||
{
|
||||
update_mesh_state(state);
|
||||
state->dispatch_info.indirect = lvp_buffer_from_handle(cmd->u.draw_mesh_tasks_indirect_count_ext.buffer)->bo;
|
||||
state->dispatch_info.indirect_offset = cmd->u.draw_mesh_tasks_indirect_count_ext.offset;
|
||||
state->dispatch_info.indirect_stride = cmd->u.draw_mesh_tasks_indirect_count_ext.stride;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue