diff options
author | Kenneth Graunke <[email protected]> | 2018-01-09 23:14:10 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-02-21 10:26:04 -0800 |
commit | c1c6c3a18a61f59809a46451521a941d938fbe57 (patch) | |
tree | 8c548e063f7140cca6e2b8d029a879c3c7577423 /src/gallium | |
parent | 3eadb1b3a1be98cd2f1d4787a4921d2e39f9901f (diff) |
iris: don't segfault on !old_cso
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/iris/iris_state.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 66f33fc242b..842136fc00d 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -540,14 +540,16 @@ iris_bind_rasterizer_state(struct pipe_context *ctx, void *state) struct iris_rasterizer_state *old_cso = ice->state.cso_rast; struct iris_rasterizer_state *new_cso = state; - /* Avoid re-emitting 3DSTATE_LINE_STIPPLE if we can, it's non-pipelined */ - if (old_cso->line_stipple_factor != new_cso->line_stipple_factor || - old_cso->line_stipple_pattern != new_cso->line_stipple_pattern) { - ice->state.dirty |= IRIS_DIRTY_LINE_STIPPLE; - } + if (old_cso) { + /* Try to avoid re-emitting 3DSTATE_LINE_STIPPLE, it's non-pipelined */ + if (old_cso->line_stipple_factor != new_cso->line_stipple_factor || + old_cso->line_stipple_pattern != new_cso->line_stipple_pattern) { + ice->state.dirty |= IRIS_DIRTY_LINE_STIPPLE; + } - if (old_cso->half_pixel_center != new_cso->half_pixel_center) { - ice->state.dirty |= IRIS_DIRTY_MULTISAMPLE; + if (old_cso->half_pixel_center != new_cso->half_pixel_center) { + ice->state.dirty |= IRIS_DIRTY_MULTISAMPLE; + } } ice->state.cso_rast = new_cso; |