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

Author: Jason Ekstrand <jason.ekstr...@intel.com>
Date:   Mon Aug 21 17:41:28 2017 -0700

anv,i965: Move CS shared lowering into anv

Right now, OpenGL uses the GLSL lowering for shared variables and anv
uses NIR to lower them.  For a long time, we've done this weird thing
where we do the NIR lowering unconditionally and then add the SLM sizes
from the two together.  This works because one of them will always be 0
but it's a bit sketchy.  Let's just move the NIR-based lowering into
anv_pipeline and get rid of the sketch.

Reviewed-by: Jordan Justen <jordan.l.jus...@intel.com>

---

 src/intel/compiler/brw_fs.cpp   | 2 --
 src/intel/vulkan/anv_pipeline.c | 5 +++++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index f2596e3886..eb9b4c3890 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -6751,8 +6751,6 @@ brw_compile_cs(const struct brw_compiler *compiler, void 
*log_data,
 {
    nir_shader *shader = nir_shader_clone(mem_ctx, src_shader);
    shader = brw_nir_apply_sampler_key(shader, compiler, &key->tex, true);
-   brw_nir_lower_cs_shared(shader);
-   prog_data->base.total_shared += shader->num_shared;
 
    /* Now that we cloned the nir_shader, we can update num_uniforms based on
     * the thread_local_id_index.
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 6ae682fd8d..279d76561a 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -381,6 +381,11 @@ anv_pipeline_compile(struct anv_pipeline *pipeline,
    if (stage != MESA_SHADER_COMPUTE)
       NIR_PASS_V(nir, anv_nir_lower_multiview, pipeline->subpass->view_mask);
 
+   if (stage == MESA_SHADER_COMPUTE) {
+      NIR_PASS_V(nir, brw_nir_lower_cs_shared);
+      prog_data->total_shared = nir->num_shared;
+   }
+
    nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
 
    /* Figure out the number of parameters */

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to