diff options
author | Kenneth Graunke <[email protected]> | 2018-08-23 21:21:04 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-02-21 10:26:08 -0800 |
commit | 47d3019c4a4528e17711ceee16dd4191cab2f301 (patch) | |
tree | 597606aff38a3dedc5fe68f15ec0839cf3cb7fd2 /src/gallium | |
parent | 6331b754dfc7300259cf77737feaf4853c71c171 (diff) |
iris: fix crash when binding optional shader for the first time
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); } |