iris: Only resolve inputs for actual shader stages
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 20 Dec 2018 04:34:55 +0000 (20:34 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:11 +0000 (10:26 -0800)
We don't need to consider compute at render time, and don't need to
consider disabled stages.  4% on drawoverhead.

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

index 596b195b5a831265b74d3bf50b22f924ae1a6693..042a2cfb43d8c0b254b3f46fdaf0e6eecda9a402 100644 (file)
@@ -677,8 +677,8 @@ uint64_t iris_timebase_scale(const struct gen_device_info *devinfo,
 
 /* iris_resolve.c */
 
-void iris_predraw_resolve_inputs(struct iris_context *ice,
-                                 struct iris_batch *batch);
+void iris_predraw_resolve_inputs(struct iris_batch *batch,
+                                 struct iris_shader_state *shs);
 void iris_predraw_resolve_framebuffer(struct iris_context *ice,
                                       struct iris_batch *batch);
 void iris_postdraw_update_resolve_tracking(struct iris_context *ice,
index 602a0ec517f009e4088cbb2ee661d3fdea87e6b3..fb62f0c545266d002905458519e9edac28db9031 100644 (file)
@@ -98,7 +98,11 @@ iris_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
 
    iris_update_compiled_shaders(ice);
 
-   iris_predraw_resolve_inputs(ice, batch);
+   for (gl_shader_stage stage = 0; stage < MESA_SHADER_COMPUTE; stage++) {
+      if (ice->shaders.prog[stage])
+         iris_predraw_resolve_inputs(batch, &ice->state.shaders[stage]);
+   }
+
    iris_predraw_resolve_framebuffer(ice, batch);
 
    iris_binder_reserve_3d(ice);
index 240f6f8c8790502da71f60fa41dcf2ed8be4e3be..737bcfe0e90fb26cb1b6b9a0e1e0b2c84f154234 100644 (file)
@@ -74,16 +74,11 @@ resolve_image_views(struct iris_batch *batch,
  * enabled depth texture, and flush the render cache for any dirty textures.
  */
 void
-iris_predraw_resolve_inputs(struct iris_context *ice,
-                            struct iris_batch *batch)
+iris_predraw_resolve_inputs(struct iris_batch *batch,
+                            struct iris_shader_state *shs)
 {
-   for (gl_shader_stage stage = 0; stage < MESA_SHADER_STAGES; stage++) {
-      struct iris_shader_state *shs = &ice->state.shaders[stage];
-      resolve_sampler_views(batch, shs);
-      resolve_image_views(batch, shs);
-   }
-
-   // XXX: storage images
+   resolve_sampler_views(batch, shs);
+   resolve_image_views(batch, shs);
 }
 
 void