i965: Move lower_output_reads to brw_link_shader().
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 7 Apr 2015 22:05:12 +0000 (15:05 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 11 Apr 2015 18:38:14 +0000 (11:38 -0700)
This makes it so emit_nir_code() doesn't modify the GLSL IR.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp
src/mesa/drivers/dri/i965/brw_shader.cpp

index c179d7137a846ac5641837ad81b23fd9e3a1779f..6bb52ebd8775ee489cae7c021eecb41f760957dd 100644 (file)
@@ -90,7 +90,6 @@ fs_visitor::emit_nir_code()
    nir_shader *nir;
    /* First, lower the GLSL IR or Mesa IR to NIR */
    if (shader_prog) {
-      lower_output_reads(shader->base.ir);
       nir = glsl_to_nir(&shader->base, options);
    } else {
       nir = prog_to_nir(prog, options);
index bf9aceb99238bf411eb41aab07806da541fd6992..87000776f1da4da62cd0109e91983255848f4a2c 100644 (file)
@@ -199,6 +199,9 @@ process_glsl_ir(struct brw_context *brw,
                                         options, ctx->Const.NativeIntegers) || progress;
    } while (progress);
 
+   if (options->NirOptions != NULL)
+      lower_output_reads(shader->ir);
+
    validate_ir_tree(shader->ir);
 
    /* Now that we've finished altering the linked IR, reparent any live IR back