+ /* Store the declared LDS size into tgsi_shader_info for the shader
+ * cache to include it.
+ */
+ sel.info.properties[TGSI_PROPERTY_CS_LOCAL_SIZE] = program->local_size;
+
+ sel.type = PIPE_SHADER_COMPUTE;
+ si_get_active_slot_masks(&sel.info,
+ &program->active_const_and_shader_buffers,
+ &program->active_samplers_and_images);
+
+ program->shader.selector = &sel;
+ program->shader.is_monolithic = true;
+ program->uses_grid_size = sel.info.uses_grid_size;
+ program->uses_bindless_samplers = sel.info.uses_bindless_samplers;
+ program->uses_bindless_images = sel.info.uses_bindless_images;
+ program->reads_variable_block_size =
+ sel.info.uses_block_size &&
+ sel.info.properties[TGSI_PROPERTY_CS_FIXED_BLOCK_WIDTH] == 0;
+ program->num_cs_user_data_dwords =
+ sel.info.properties[TGSI_PROPERTY_CS_USER_DATA_DWORDS];
+
+ void *ir_binary = si_get_ir_binary(&sel);
+
+ /* Try to load the shader from the shader cache. */
+ mtx_lock(&sscreen->shader_cache_mutex);
+
+ if (ir_binary &&
+ si_shader_cache_load_shader(sscreen, ir_binary, shader)) {
+ mtx_unlock(&sscreen->shader_cache_mutex);
+
+ si_shader_dump_stats_for_shader_db(shader, debug);
+ si_shader_dump(sscreen, shader, debug, PIPE_SHADER_COMPUTE,
+ stderr, true);
+
+ if (si_shader_binary_upload(sscreen, shader))
+ program->shader.compilation_failed = true;
+ } else {
+ mtx_unlock(&sscreen->shader_cache_mutex);