[Mesa-dev] [PATCH 3/4] i965: Make L3 partitioning code only use the current pipeline's shaders.

Kenneth Graunke kenneth at whitecape.org
Wed Feb 10 00:49:46 UTC 2016


When uploading state for the compute pipeline, we don't want to
look at VS/TCS/TES/GS/FS programs, as they might be stale, and
aren't relevant anyway.  Likewise, the render pipeline shouldn't
look at CS.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93790
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/mesa/drivers/dri/i965/gen7_l3_state.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/gen7_l3_state.c b/src/mesa/drivers/dri/i965/gen7_l3_state.c
index c4babc2..b2e9306 100644
--- a/src/mesa/drivers/dri/i965/gen7_l3_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_l3_state.c
@@ -307,7 +307,12 @@ get_pipeline_state_l3_weights(const struct brw_context *brw)
    };
    bool needs_dc = false, needs_slm = false;
 
-   for (unsigned i = 0; i < ARRAY_SIZE(stage_states); i++) {
+   unsigned first_stage = MESA_SHADER_VERTEX;
+   unsigned last_stage = MESA_SHADER_FRAGMENT;
+   if (brw->last_pipeline == BRW_COMPUTE_PIPELINE)
+      first_stage = last_stage = MESA_SHADER_COMPUTE;
+
+   for (unsigned i = first_stage; i <= last_stage; i++) {
       const struct gl_shader_program *prog =
          brw->ctx._Shader->CurrentProgram[stage_states[i]->stage];
       const struct brw_stage_prog_data *prog_data = stage_states[i]->prog_data;
-- 
2.7.0



More information about the mesa-dev mailing list