iris: don't let render/compute contexts stomp each other's dirty bits
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 19 Oct 2018 08:31:56 +0000 (01:31 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:09 +0000 (10:26 -0800)
only clear what you process

src/gallium/drivers/iris/iris_context.h
src/gallium/drivers/iris/iris_draw.c

index 096a3d2ff5131a9f84ced4ac293cb07166e1a3a3..4060cdb5d2daf7be5f9eeb39932ad77bd77c0593 100644 (file)
@@ -111,6 +111,14 @@ struct blorp_params;
 #define IRIS_DIRTY_VF                       (1ull << 53)
 #define IRIS_DIRTY_VF_TOPOLOGY              (1ull << 54)
 
+#define IRIS_ALL_DIRTY_FOR_COMPUTE (IRIS_DIRTY_CS | \
+                                    IRIS_DIRTY_SAMPLER_STATES_CS | \
+                                    IRIS_DIRTY_UNCOMPILED_CS | \
+                                    IRIS_DIRTY_CONSTANTS_CS | \
+                                    IRIS_DIRTY_BINDINGS_CS)
+
+#define IRIS_ALL_DIRTY_FOR_RENDER ~IRIS_ALL_DIRTY_FOR_COMPUTE
+
 #define IRIS_ALL_DIRTY_BINDINGS (IRIS_DIRTY_BINDINGS_VS  | \
                                  IRIS_DIRTY_BINDINGS_TCS | \
                                  IRIS_DIRTY_BINDINGS_TES | \
index c2216a22beda1b853507cde95abce034d1c0a342..f9b8db7b64ea5b6fb3db0739679adb7bac7efc02 100644 (file)
@@ -89,7 +89,7 @@ iris_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
    ice->vtbl.update_surface_base_address(batch, &ice->state.binder);
    ice->vtbl.upload_render_state(ice, batch, info);
 
-   ice->state.dirty = 0ull;
+   ice->state.dirty &= ~IRIS_ALL_DIRTY_FOR_RENDER;
 
    iris_postdraw_update_resolve_tracking(ice, batch);
 }
@@ -163,8 +163,7 @@ iris_launch_grid(struct pipe_context *ctx, const struct pipe_grid_info *grid)
    ice->vtbl.update_surface_base_address(batch, &ice->state.binder);
    ice->vtbl.upload_compute_state(ice, batch, grid);
 
-   // XXX: this is wrong.  we need separate dirty tracking for compute/render
-   ice->state.dirty = 0ull;
+   ice->state.dirty &= ~IRIS_ALL_DIRTY_FOR_COMPUTE;
 
    // XXX: postdraw resolve tracking
 }