diff options
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/iris/iris_program_cache.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/iris/iris_program_cache.c b/src/gallium/drivers/iris/iris_program_cache.c index a27a4b9a83c..0006e8e8bea 100644 --- a/src/gallium/drivers/iris/iris_program_cache.c +++ b/src/gallium/drivers/iris/iris_program_cache.c @@ -172,7 +172,9 @@ iris_bind_cached_shader(struct iris_context *ice, if (!shader) return false; - if (memcmp(shader, ice->shaders.prog[cache_id], sizeof(*shader)) != 0) { + // XXX: why memcmp? + if (!ice->shaders.prog[cache_id] || + memcmp(shader, ice->shaders.prog[cache_id], sizeof(*shader)) != 0) { ice->shaders.prog[cache_id] = shader; ice->state.dirty |= dirty_flag_for_cache(cache_id); } |