sctx->bo_list_add_all_resident_resources = false;
}
+static void si_emit_gfx_resources_add_all_to_bo_list(struct si_context *sctx, unsigned index);
+
/* INIT/DEINIT/UPLOAD */
void si_init_all_descriptors(struct si_context *sctx)
sctx->b.set_polygon_stipple = si_set_polygon_stipple;
- /* Shader user data. */
+ sctx->atoms.s.gfx_add_all_to_bo_list.emit = si_emit_gfx_resources_add_all_to_bo_list;
sctx->atoms.s.gfx_shader_pointers.emit = si_emit_graphics_shader_pointers;
/* Set default and immutable mappings. */
return use_encrypted_bo;
}
-void si_gfx_resources_add_all_to_bo_list(struct si_context *sctx)
+static void si_emit_gfx_resources_add_all_to_bo_list(struct si_context *sctx, unsigned index)
{
for (unsigned i = 0; i < SI_NUM_GRAPHICS_SHADERS; i++) {
si_buffer_resources_begin_new_cs(sctx, &sctx->const_and_shader_buffers[i]);
if (sctx->bo_list_add_all_resident_resources)
si_resident_buffers_add_all_to_bo_list(sctx);
-
- assert(sctx->bo_list_add_all_gfx_resources);
- sctx->bo_list_add_all_gfx_resources = false;
}
bool si_compute_resources_check_encrypted(struct si_context *sctx)
si_add_descriptors_to_bo_list(sctx, &sctx->bindless_descriptors);
sctx->bo_list_add_all_resident_resources = true;
- sctx->bo_list_add_all_gfx_resources = true;
+ si_mark_atom_dirty(sctx, &sctx->atoms.s.gfx_add_all_to_bo_list);
sctx->bo_list_add_all_compute_resources = true;
}
struct si_samplers samplers[SI_NUM_SHADERS];
struct si_images images[SI_NUM_SHADERS];
bool bo_list_add_all_resident_resources;
- bool bo_list_add_all_gfx_resources;
bool bo_list_add_all_compute_resources;
/* other shader resources */
struct si_atoms_s {
/* This must be first. */
struct si_atom pm4_states[SI_NUM_STATES];
+ struct si_atom gfx_add_all_to_bo_list;
struct si_atom streamout_begin;
struct si_atom streamout_enable; /* must be after streamout_begin */
struct si_atom framebuffer;
unsigned element_size, unsigned index_stride, uint64_t offset);
void si_init_all_descriptors(struct si_context *sctx);
void si_release_all_descriptors(struct si_context *sctx);
-void si_gfx_resources_add_all_to_bo_list(struct si_context *sctx);
void si_compute_resources_add_all_to_bo_list(struct si_context *sctx);
bool si_gfx_resources_check_encrypted(struct si_context *sctx);
bool si_compute_resources_check_encrypted(struct si_context *sctx);
}
}
- /* This must be called after si_need_cs_space, because we must let
- * need_cs_space flush before we add buffers to the buffer list.
- *
- * This must be done after si_update_shaders because si_update_shaders can
- * flush the CS when enabling tess and GS rings.
- */
- if (sctx->bo_list_add_all_gfx_resources)
- si_gfx_resources_add_all_to_bo_list(sctx);
-
/* This is the optimal packet order:
* Set all states first, so that all SET packets are processed in parallel with previous
* draw calls. Then flush caches and wait if needed. Then draw and prefetch at the end.