bool iris_bind_cached_shader(struct iris_context *ice,
enum iris_program_cache_id cache_id,
const void *key);
+void iris_unbind_shader(struct iris_context *ice,
+ enum iris_program_cache_id cache_id);
void iris_upload_and_bind_shader(struct iris_context *ice,
enum iris_program_cache_id cache_id,
const void *key,
assert(!(tes && !tcs));
- if (!tcs)
+ if (!tcs) {
+ iris_unbind_shader(ice, IRIS_CACHE_TCS);
return;
+ }
const struct shader_info *tes_info =
iris_get_shader_info(ice, MESA_SHADER_TESS_EVAL);
struct iris_uncompiled_shader *ish =
ice->shaders.uncompiled[MESA_SHADER_TESS_EVAL];
- if (!ish)
+ if (!ish) {
+ iris_unbind_shader(ice, IRIS_CACHE_TES);
return;
+ }
struct brw_tes_prog_key key = { .program_string_id = ish->program_id };
get_unified_tess_slots(ice, &key.inputs_read, &key.patch_inputs_read);
struct iris_uncompiled_shader *ish =
ice->shaders.uncompiled[MESA_SHADER_GEOMETRY];
- if (!ish)
+ if (!ish) {
+ iris_unbind_shader(ice, IRIS_CACHE_GS);
return;
+ }
struct brw_gs_prog_key key = { .program_string_id = ish->program_id };
ice->vtbl.populate_gs_key(ice, &key);
return true;
}
+void
+iris_unbind_shader(struct iris_context *ice,
+ enum iris_program_cache_id cache_id)
+{
+ if (ice->shaders.prog[cache_id]) {
+ ice->shaders.prog[cache_id] = NULL;
+ ice->state.dirty |= dirty_flag_for_cache(cache_id);
+ }
+}
+
const void *
iris_find_previous_compile(const struct iris_context *ice,
enum iris_program_cache_id cache_id,