{
#ifdef ENABLE_SHADER_CACHE
struct iris_screen *screen = (void *) ice->ctx.screen;
+ struct u_upload_mgr *uploader = ice->shaders.uploader;
struct disk_cache *cache = screen->disk_cache;
gl_shader_stage stage = ish->nir->info.stage;
* return it to the caller.
*/
struct iris_compiled_shader *shader =
- iris_upload_shader(ice, ish, cache_id, key_size, prog_key, assembly,
+ iris_upload_shader(screen, ish, NULL, uploader,
+ cache_id, key_size, prog_key, assembly,
prog_data, so_decls, system_values,
num_system_values, kernel_input_size, num_cbufs, &bt);
&vue_prog_data->vue_map);
struct iris_compiled_shader *shader =
- iris_upload_shader(ice, ish, IRIS_CACHE_VS, sizeof(*key), key, program,
+ iris_upload_shader(screen, ish, NULL, ice->shaders.uploader,
+ IRIS_CACHE_VS, sizeof(*key), key, program,
prog_data, so_decls, system_values, num_system_values,
0, num_cbufs, &bt);
iris_debug_recompile(screen, &ice->dbg, ish, &brw_key.base);
struct iris_compiled_shader *shader =
- iris_upload_shader(ice, ish, IRIS_CACHE_TCS, sizeof(*key), key, program,
+ iris_upload_shader(screen, ish, ice->shaders.cache, ice->shaders.uploader,
+ IRIS_CACHE_TCS, sizeof(*key), key, program,
prog_data, NULL, system_values, num_system_values,
0, num_cbufs, &bt);
struct iris_compiled_shader *shader =
- iris_upload_shader(ice, ish, IRIS_CACHE_TES, sizeof(*key), key, program,
+ iris_upload_shader(screen, ish, NULL, ice->shaders.uploader,
+ IRIS_CACHE_TES, sizeof(*key), key, program,
prog_data, so_decls, system_values, num_system_values,
0, num_cbufs, &bt);
&vue_prog_data->vue_map);
struct iris_compiled_shader *shader =
- iris_upload_shader(ice, ish, IRIS_CACHE_GS, sizeof(*key), key, program,
+ iris_upload_shader(screen, ish, NULL, ice->shaders.uploader,
+ IRIS_CACHE_GS, sizeof(*key), key, program,
prog_data, so_decls, system_values, num_system_values,
0, num_cbufs, &bt);
iris_debug_recompile(screen, &ice->dbg, ish, &brw_key.base);
struct iris_compiled_shader *shader =
- iris_upload_shader(ice, ish, IRIS_CACHE_FS, sizeof(*key), key, program,
+ iris_upload_shader(screen, ish, NULL, ice->shaders.uploader,
+ IRIS_CACHE_FS, sizeof(*key), key, program,
prog_data, NULL, system_values, num_system_values,
0, num_cbufs, &bt);
iris_debug_recompile(screen, &ice->dbg, ish, &brw_key.base);
struct iris_compiled_shader *shader =
- iris_upload_shader(ice, ish, IRIS_CACHE_CS, sizeof(*key), key, program,
+ iris_upload_shader(screen, ish, NULL, ice->shaders.uploader,
+ IRIS_CACHE_CS, sizeof(*key), key, program,
prog_data, NULL, system_values, num_system_values,
ish->kernel_input_size, num_cbufs, &bt);
}
struct iris_compiled_shader *
-iris_upload_shader(struct iris_context *ice,
+iris_upload_shader(struct iris_screen *screen,
struct iris_uncompiled_shader *ish,
+ struct hash_table *driver_shaders,
+ struct u_upload_mgr *uploader,
enum iris_program_cache_id cache_id,
uint32_t key_size,
const void *key,
unsigned num_cbufs,
const struct iris_binding_table *bt)
{
- struct hash_table *cache = ice->shaders.cache;
- void *mem_ctx = ish ? NULL : (void *) cache;
- struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
const struct gen_device_info *devinfo = &screen->devinfo;
+
+ void *mem_ctx = ish ? NULL : (void *) driver_shaders;
struct iris_compiled_shader *shader =
rzalloc_size(mem_ctx, sizeof(struct iris_compiled_shader) +
screen->vtbl.derived_program_state_size(cache_id));
pipe_reference_init(&shader->ref, 1);
shader->assembly.res = NULL;
- u_upload_alloc(ice->shaders.uploader, 0, prog_data->program_size, 64,
+ u_upload_alloc(uploader, 0, prog_data->program_size, 64,
&shader->assembly.offset, &shader->assembly.res,
&shader->map);
memcpy(shader->map, assembly, prog_data->program_size);
simple_mtx_unlock(&ish->lock);
} else {
struct keybox *keybox = make_keybox(shader, cache_id, key, key_size);
- _mesa_hash_table_insert(ice->shaders.cache, keybox, shader);
+ _mesa_hash_table_insert(driver_shaders, keybox, shader);
}
return shader;
struct blorp_context *blorp = blorp_batch->blorp;
struct iris_context *ice = blorp->driver_ctx;
struct iris_batch *batch = blorp_batch->driver_batch;
+ struct iris_screen *screen = batch->screen;
void *prog_data = ralloc_size(NULL, prog_data_size);
memcpy(prog_data, prog_data_templ, prog_data_size);
memset(&bt, 0, sizeof(bt));
struct iris_compiled_shader *shader =
- iris_upload_shader(ice, NULL, IRIS_CACHE_BLORP, key_size, key, kernel,
+ iris_upload_shader(screen, NULL, ice->shaders.cache,
+ ice->shaders.uploader,
+ IRIS_CACHE_BLORP, key_size, key, kernel,
prog_data, NULL, NULL, 0, 0, 0, &bt);
struct iris_bo *bo = iris_resource_bo(shader->assembly.res);