iris: fix crash - CSO binding can be NULL (when destroying context)
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 10 Jan 2018 08:21:56 +0000 (00:21 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:04 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_state.c

index f161598292f2b9b637c2b448d04cfa7a7e957c28..b581c043fceaa0236e6ffe61dec659bbe6a18921 100644 (file)
@@ -566,7 +566,7 @@ 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;
 
-   if (old_cso) {
+   if (old_cso && new_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) {