Mesa (master): i965: Use NIR-based clip/cull lowering for OpenGL as well.

Kenneth Graunke kwg at kemper.freedesktop.org
Tue Nov 22 08:30:36 UTC 2016


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Oct 17 14:23:10 2016 -0700

i965: Use NIR-based clip/cull lowering for OpenGL as well.

The old approach works fine, and this approach isn't necessarily better.
But it at least has the advantage that Vulkan and GL use the same
approach.  I originally wrote it to gain additional testing for the
new paths.

shader-db statistics show 0 instruction count changes.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/mesa/drivers/dri/i965/brw_compiler.c | 1 -
 src/mesa/drivers/dri/i965/brw_nir.c      | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_compiler.c b/src/mesa/drivers/dri/i965/brw_compiler.c
index 9387d64..1aa72bc 100644
--- a/src/mesa/drivers/dri/i965/brw_compiler.c
+++ b/src/mesa/drivers/dri/i965/brw_compiler.c
@@ -126,7 +126,6 @@ brw_compiler_create(void *mem_ctx, const struct gen_device_info *devinfo)
       compiler->glsl_compiler_options[i].EmitNoMainReturn = true;
       compiler->glsl_compiler_options[i].EmitNoIndirectInput = true;
       compiler->glsl_compiler_options[i].EmitNoIndirectUniform = false;
-      compiler->glsl_compiler_options[i].LowerCombinedClipCullDistance = true;
 
       bool is_scalar = compiler->scalar_stage[i];
 
diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index a93d825..e454180 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -485,6 +485,8 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir)
    /* Get rid of split copies */
    nir = nir_optimize(nir, is_scalar);
 
+   OPT_V(nir_lower_clip_cull_distance_arrays);
+
    OPT(nir_remove_dead_variables, nir_var_local);
 
    return nir;




More information about the mesa-commit mailing list