i965: Use NIR-based clip/cull lowering for OpenGL as well.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 17 Oct 2016 21:23:10 +0000 (14:23 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 22 Nov 2016 08:29:24 +0000 (00:29 -0800)
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@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_compiler.c
src/mesa/drivers/dri/i965/brw_nir.c

index 9387d64b05432514d674a9a2fcf720663ef4150f..1aa72bc6fff62e841c5df7ae4cce8f7c8f7d8786 100644 (file)
@@ -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];
 
index a93d8252535454bd72f5f259d8ce7d6fd23f4238..e45418045857a9315686cbad5f898c2d6e327efb 100644 (file)
@@ -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;