i965: Always do NIR IO lowering at specialization time.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 25 Feb 2016 05:36:15 +0000 (21:36 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 26 Feb 2016 23:55:59 +0000 (15:55 -0800)
We've now hit literally every case other than geometry shaders (and
compute shaders, but those are a no-op).  So, let's just move geometry
shaders over too and be done with it.

The only advantage to doing this at link time was to save the expense
of running the pass on recompiles.  But we're already running a lot of
passes, and the extra code complexity isn't worth it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/dri/i965/brw_nir.c
src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp

index 61acf38988c2a137ce157be45af92e8eb9343695..efa4c48de43e6c3b1ca87a00257a05f42a37ba61 100644 (file)
@@ -598,7 +598,6 @@ brw_create_nir(struct brw_context *brw,
                bool is_scalar)
 {
    struct gl_context *ctx = &brw->ctx;
-   const struct brw_device_info *devinfo = brw->intelScreen->devinfo;
    const nir_shader_compiler_options *options =
       ctx->Const.ShaderCompilerOptions[stage].NirOptions;
    bool progress;
@@ -625,13 +624,6 @@ brw_create_nir(struct brw_context *brw,
       OPT_V(nir_lower_atomics, shader_prog);
    }
 
-   if (nir->stage != MESA_SHADER_VERTEX &&
-       nir->stage != MESA_SHADER_TESS_CTRL &&
-       nir->stage != MESA_SHADER_TESS_EVAL &&
-       nir->stage != MESA_SHADER_FRAGMENT) {
-      nir = brw_nir_lower_io(nir, devinfo, is_scalar, false, NULL);
-   }
-
    return nir;
 }
 
index 183fe3509f2a404c5e8e4ca43ef7e6080066b590..40966c620e0015f30d5fb4463ce4399aa572c599 100644 (file)
@@ -598,6 +598,7 @@ brw_compile_gs(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->devinfo, &key->tex,
                                       is_scalar);
+   shader = brw_nir_lower_io(shader, compiler->devinfo, is_scalar, false, NULL);
    shader = brw_postprocess_nir(shader, compiler->devinfo, is_scalar);
 
    prog_data->include_primitive_id =