radv: add a per-stage key field for mesh shaders with a task shader

This is to match VK_SHADER_CREATE_NO_TASK_SHADER_BIT_EXT.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27176>
This commit is contained in:
Samuel Pitoiset
2024-01-19 16:47:48 +01:00
committed by Marge Bot
parent 1e1a6d8e26
commit db4673ee72
3 changed files with 10 additions and 7 deletions

View File

@@ -1977,6 +1977,9 @@ radv_generate_graphics_pipeline_key(const struct radv_device *device, const stru
gl_shader_stage s = vk_to_mesa_shader_stage(stage->stage);
key.stage_info[s] = radv_pipeline_get_shader_key(device, stage, pipeline->base.create_flags, pCreateInfo->pNext);
if (s == MESA_SHADER_MESH && (pipeline->active_stages & VK_SHADER_STAGE_TASK_BIT_EXT))
key.stage_info[s].has_task_shader = true;
}
return key;

View File

@@ -98,6 +98,9 @@ struct radv_shader_stage_key {
/* Shader version (up to 8) to force re-compilation when RADV_BUILD_ID_OVERRIDE is enabled. */
uint8_t version : 3;
/* Whether the mesh shader is used with a task shader. */
uint8_t has_task_shader : 1;
};
struct radv_ps_epilog_key {

View File

@@ -681,7 +681,8 @@ gather_shader_info_gs(struct radv_device *device, const nir_shader *nir, struct
}
static void
gather_shader_info_mesh(struct radv_device *device, const nir_shader *nir, struct radv_shader_info *info)
gather_shader_info_mesh(struct radv_device *device, const nir_shader *nir,
const struct radv_shader_stage_key *stage_key, struct radv_shader_info *info)
{
struct gfx10_ngg_info *ngg_info = &info->ngg_info;
@@ -722,6 +723,7 @@ gather_shader_info_mesh(struct radv_device *device, const nir_shader *nir, struc
ngg_info->vgt_esgs_ring_itemsize = 1;
info->ms.has_query = device->cache_key.mesh_shader_queries;
info->ms.has_task = stage_key->has_task_shader;
}
static void
@@ -1213,7 +1215,7 @@ radv_nir_shader_info_pass(struct radv_device *device, const struct nir_shader *n
gather_shader_info_vs(device, nir, gfx_state, stage_key, info);
break;
case MESA_SHADER_MESH:
gather_shader_info_mesh(device, nir, info);
gather_shader_info_mesh(device, nir, stage_key, info);
break;
default:
if (gl_shader_stage_is_rt(nir->info.stage))
@@ -1671,11 +1673,6 @@ radv_link_shaders_info(struct radv_device *device, struct radv_shader_stage *pro
if (!gfx_state->dynamic_patch_control_points)
tes_stage->info.num_tess_patches = tcs_stage->info.num_tess_patches;
}
/* Task/mesh I/O uses the task ring buffers. */
if (producer->stage == MESA_SHADER_TASK) {
consumer->info.ms.has_task = true;
}
}
static void