radeonsi: add si_mesh_resources_add_all_to_bo_list

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-04-17 14:32:57 +08:00
committed by Marge Bot
parent b533d39b95
commit 8659666089
3 changed files with 27 additions and 0 deletions
@@ -3103,6 +3103,30 @@ void si_compute_resources_add_all_to_bo_list(struct si_context *sctx)
sctx->bo_list_add_all_compute_resources = false;
}
void si_mesh_resources_add_all_to_bo_list(struct si_context *sctx)
{
unsigned stages[] = {
MESA_SHADER_TASK,
MESA_SHADER_MESH,
MESA_SHADER_FRAGMENT,
};
for (unsigned i = 0; i < ARRAY_SIZE(stages); i++) {
unsigned sh = stages[i];
si_buffer_resources_begin_new_cs(sctx, &sctx->const_and_shader_buffers[sh]);
si_sampler_views_begin_new_cs(sctx, &sctx->samplers[sh]);
si_image_views_begin_new_cs(sctx, &sctx->images[sh]);
}
si_buffer_resources_begin_new_cs(sctx, &sctx->internal_bindings);
if (sctx->bo_list_add_all_resident_resources)
si_resident_buffers_add_all_to_bo_list(sctx);
assert(sctx->bo_list_add_all_mesh_resources);
sctx->bo_list_add_all_mesh_resources = false;
}
void si_add_all_descriptors_to_bo_list(struct si_context *sctx)
{
for (unsigned i = 0; i < SI_NUM_DESCS; ++i)
@@ -3112,6 +3136,7 @@ void si_add_all_descriptors_to_bo_list(struct si_context *sctx)
sctx->bo_list_add_all_resident_resources = true;
si_mark_atom_dirty(sctx, &sctx->atoms.s.gfx_add_all_to_bo_list);
sctx->bo_list_add_all_compute_resources = true;
sctx->bo_list_add_all_mesh_resources = true;
}
void si_set_active_descriptors(struct si_context *sctx, unsigned desc_idx, uint64_t new_active_mask)
+1
View File
@@ -1134,6 +1134,7 @@ struct si_context {
struct si_images images[SI_NUM_SHADERS];
bool bo_list_add_all_resident_resources;
bool bo_list_add_all_compute_resources;
bool bo_list_add_all_mesh_resources;
/* tracked buffers for OpenCL */
int max_global_buffers;
+1
View File
@@ -600,6 +600,7 @@ void si_set_ring_buffer(struct si_context *sctx, uint slot, struct pipe_resource
void si_init_all_descriptors(struct si_context *sctx);
void si_release_all_descriptors(struct si_context *sctx);
void si_compute_resources_add_all_to_bo_list(struct si_context *sctx);
void si_mesh_resources_add_all_to_bo_list(struct si_context *sctx);
int si_gfx_resources_check_encrypted(struct si_context *sctx);
bool si_compute_resources_check_encrypted(struct si_context *sctx);
void si_shader_pointers_mark_dirty(struct si_context *sctx);