iris: unbind compiled shaders if none are present
avoids the case where you have a stale compiled shader bound, but no uncompiled shader bound, which is not just boats, but an entire marina
This commit is contained in:
@@ -416,6 +416,8 @@ void iris_print_program_cache(struct iris_context *ice);
|
|||||||
bool iris_bind_cached_shader(struct iris_context *ice,
|
bool iris_bind_cached_shader(struct iris_context *ice,
|
||||||
enum iris_program_cache_id cache_id,
|
enum iris_program_cache_id cache_id,
|
||||||
const void *key);
|
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,
|
void iris_upload_and_bind_shader(struct iris_context *ice,
|
||||||
enum iris_program_cache_id cache_id,
|
enum iris_program_cache_id cache_id,
|
||||||
const void *key,
|
const void *key,
|
||||||
|
@@ -439,8 +439,10 @@ iris_update_compiled_tcs(struct iris_context *ice)
|
|||||||
|
|
||||||
assert(!(tes && !tcs));
|
assert(!(tes && !tcs));
|
||||||
|
|
||||||
if (!tcs)
|
if (!tcs) {
|
||||||
|
iris_unbind_shader(ice, IRIS_CACHE_TCS);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const struct shader_info *tes_info =
|
const struct shader_info *tes_info =
|
||||||
iris_get_shader_info(ice, MESA_SHADER_TESS_EVAL);
|
iris_get_shader_info(ice, MESA_SHADER_TESS_EVAL);
|
||||||
@@ -513,8 +515,10 @@ iris_update_compiled_tes(struct iris_context *ice)
|
|||||||
struct iris_uncompiled_shader *ish =
|
struct iris_uncompiled_shader *ish =
|
||||||
ice->shaders.uncompiled[MESA_SHADER_TESS_EVAL];
|
ice->shaders.uncompiled[MESA_SHADER_TESS_EVAL];
|
||||||
|
|
||||||
if (!ish)
|
if (!ish) {
|
||||||
|
iris_unbind_shader(ice, IRIS_CACHE_TES);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
struct brw_tes_prog_key key = { .program_string_id = ish->program_id };
|
struct brw_tes_prog_key key = { .program_string_id = ish->program_id };
|
||||||
get_unified_tess_slots(ice, &key.inputs_read, &key.patch_inputs_read);
|
get_unified_tess_slots(ice, &key.inputs_read, &key.patch_inputs_read);
|
||||||
@@ -582,8 +586,10 @@ iris_update_compiled_gs(struct iris_context *ice)
|
|||||||
struct iris_uncompiled_shader *ish =
|
struct iris_uncompiled_shader *ish =
|
||||||
ice->shaders.uncompiled[MESA_SHADER_GEOMETRY];
|
ice->shaders.uncompiled[MESA_SHADER_GEOMETRY];
|
||||||
|
|
||||||
if (!ish)
|
if (!ish) {
|
||||||
|
iris_unbind_shader(ice, IRIS_CACHE_GS);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
struct brw_gs_prog_key key = { .program_string_id = ish->program_id };
|
struct brw_gs_prog_key key = { .program_string_id = ish->program_id };
|
||||||
ice->vtbl.populate_gs_key(ice, &key);
|
ice->vtbl.populate_gs_key(ice, &key);
|
||||||
|
@@ -172,6 +172,16 @@ iris_bind_cached_shader(struct iris_context *ice,
|
|||||||
return true;
|
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 *
|
const void *
|
||||||
iris_find_previous_compile(const struct iris_context *ice,
|
iris_find_previous_compile(const struct iris_context *ice,
|
||||||
enum iris_program_cache_id cache_id,
|
enum iris_program_cache_id cache_id,
|
||||||
|
Reference in New Issue
Block a user