Mesa (master): iris: Split iris_update_draw_info into two functions.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun May 12 19:41:47 UTC 2019


Module: Mesa
Branch: master
Commit: 21a0be4a797e39117d507b970abfa1243fef99b0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=21a0be4a797e39117d507b970abfa1243fef99b0

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Sat May 11 23:43:17 2019 -0700

iris: Split iris_update_draw_info into two functions.

Shader draw parameters need updating on each iteration of a multidraw
loop, but the primitive based information only needs to be updated once.

Also, patch information needs to be recorded before filling out the TCS
program key, as it determines the number of HS instances.

---

 src/gallium/drivers/iris/iris_draw.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/gallium/drivers/iris/iris_draw.c b/src/gallium/drivers/iris/iris_draw.c
index 86fc95cac0c..87399c430ee 100644
--- a/src/gallium/drivers/iris/iris_draw.c
+++ b/src/gallium/drivers/iris/iris_draw.c
@@ -55,6 +55,9 @@ prim_is_points_or_lines(const struct pipe_draw_info *draw)
 /**
  * Record the current primitive mode and restart information, flagging
  * related packets as dirty if necessary.
+ *
+ * This must be called before updating compiled shaders, because the patch
+ * information informs the TCS key.
  */
 static void
 iris_update_draw_info(struct iris_context *ice,
@@ -94,7 +97,15 @@ iris_update_draw_info(struct iris_context *ice,
       ice->state.primitive_restart = info->primitive_restart;
       ice->state.cut_index = info->restart_index;
    }
+}
 
+/**
+ * Update shader draw parameters, flagging VF packets as dirty if necessary.
+ */
+static void
+iris_update_draw_parameters(struct iris_context *ice,
+                            const struct pipe_draw_info *info)
+{
    if (info->indirect) {
       pipe_resource_reference(&ice->draw.draw_params_res,
                               info->indirect->buffer);
@@ -153,6 +164,7 @@ iris_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
    iris_batch_maybe_flush(batch, 1500);
 
    iris_update_draw_info(ice, info);
+   iris_update_draw_parameters(ice, dinfo);
 
    if (devinfo->gen == 9)
       gen9_toggle_preemption(ice, batch, info);




More information about the mesa-commit mailing list