radeonsi: add task/mesh shader info to si_shader_info

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37505>
This commit is contained in:
Qiang Yu 2025-05-15 17:24:05 +08:00 committed by Marge Bot
parent 8659666089
commit 977a3f45bf
2 changed files with 22 additions and 0 deletions

View file

@ -412,6 +412,7 @@ void si_nir_scan_shader(struct si_screen *sscreen, struct nir_shader *nir,
info->base.msaa_images = nir->info.msaa_images[0]; info->base.msaa_images = nir->info.msaa_images[0];
info->base.shared_size = nir->info.shared_size; info->base.shared_size = nir->info.shared_size;
info->base.task_payload_size = nir->info.task_payload_size;
memcpy(info->base.workgroup_size, nir->info.workgroup_size, sizeof(nir->info.workgroup_size)); memcpy(info->base.workgroup_size, nir->info.workgroup_size, sizeof(nir->info.workgroup_size));
info->base.workgroup_size_variable = nir->info.workgroup_size_variable; info->base.workgroup_size_variable = nir->info.workgroup_size_variable;
info->base.derivative_group = nir->info.derivative_group; info->base.derivative_group = nir->info.derivative_group;
@ -457,6 +458,17 @@ void si_nir_scan_shader(struct si_screen *sscreen, struct nir_shader *nir,
info->base.cs.user_data_components_amd = nir->info.cs.user_data_components_amd; info->base.cs.user_data_components_amd = nir->info.cs.user_data_components_amd;
break; break;
case MESA_SHADER_MESH:
info->base.mesh.max_vertices_out = nir->info.mesh.max_vertices_out;
info->base.mesh.max_primitives_out = nir->info.mesh.max_primitives_out;
break;
case MESA_SHADER_TASK:
info->base.task.linear_taskmesh_dispatch =
nir->info.mesh.ts_mesh_dispatch_dimensions[1] == 1 &&
nir->info.mesh.ts_mesh_dispatch_dimensions[2] == 1;
break;
default: default:
UNREACHABLE("unexpected shader stage"); UNREACHABLE("unexpected shader stage");
} }

View file

@ -33,6 +33,7 @@ struct si_shader_info {
uint32_t msaa_images; uint32_t msaa_images;
unsigned shared_size; unsigned shared_size;
unsigned task_payload_size;
uint16_t workgroup_size[3]; uint16_t workgroup_size[3];
bool workgroup_size_variable:1; bool workgroup_size_variable:1;
enum gl_derivative_group derivative_group:2; enum gl_derivative_group derivative_group:2;
@ -75,6 +76,15 @@ struct si_shader_info {
struct { struct {
uint8_t user_data_components_amd:4; uint8_t user_data_components_amd:4;
} cs; } cs;
struct {
uint16_t max_vertices_out;
uint16_t max_primitives_out;
} mesh;
struct {
bool linear_taskmesh_dispatch : 1;
} task;
}; };
} base; } base;