i965/vec4: Use nir info instead of pulling things out of [shader_]prog
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 1 Oct 2015 22:22:23 +0000 (15:22 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 2 Oct 2015 21:22:53 +0000 (14:22 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4.cpp
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
src/mesa/drivers/dri/i965/brw_wm_iz.cpp

index f069200ef30fc2ec829dc32ac13f46722a79f056..52db8ea8cf08dcfc1189440d0033dfc3b6b6e0fd 100644 (file)
@@ -1838,8 +1838,8 @@ vec4_visitor::run()
                                                                        \
       if (unlikely(INTEL_DEBUG & DEBUG_OPTIMIZER) && this_progress) {  \
          char filename[64];                                            \
-         snprintf(filename, 64, "%s-%04d-%02d-%02d-" #pass,            \
-                  stage_abbrev, shader_prog ? shader_prog->Name : 0, iteration, pass_num); \
+         snprintf(filename, 64, "%s-%s-%02d-%02d-" #pass,              \
+                  stage_abbrev, nir->info.name, iteration, pass_num);  \
                                                                        \
          backend_shader::dump_instructions(filename);                  \
       }                                                                \
@@ -1851,8 +1851,8 @@ vec4_visitor::run()
 
    if (unlikely(INTEL_DEBUG & DEBUG_OPTIMIZER)) {
       char filename[64];
-      snprintf(filename, 64, "%s-%04d-00-start",
-               stage_abbrev, shader_prog ? shader_prog->Name : 0);
+      snprintf(filename, 64, "%s-%s-00-start",
+               stage_abbrev, nir->info.name);
 
       backend_shader::dump_instructions(filename);
    }
index 8da8e2c3e89d7ff4fe928bde07a95ede55aff536..b25058c02a1da51aa80148f1a0244894ea5189f0 100644 (file)
@@ -470,7 +470,7 @@ vec4_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
 
          brw_mark_surface_used(&prog_data->base,
                                prog_data->base.binding_table.ubo_start +
-                               shader_prog->NumBufferInterfaceBlocks - 1);
+                               nir->info.num_ssbos - 1);
       }
 
       /* Offset */
@@ -617,7 +617,7 @@ vec4_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
           */
          brw_mark_surface_used(&prog_data->base,
                                prog_data->base.binding_table.ubo_start +
-                               shader_prog->NumBufferInterfaceBlocks - 1);
+                               nir->info.num_ssbos - 1);
       }
 
       src_reg offset_reg = src_reg(this, glsl_type::uint_type);
@@ -767,7 +767,7 @@ vec4_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
           */
          brw_mark_surface_used(&prog_data->base,
                                prog_data->base.binding_table.ubo_start +
-                               shader_prog->NumBufferInterfaceBlocks - 1);
+                               nir->info.num_ssbos - 1);
       }
 
       unsigned const_offset = instr->const_index[0];
@@ -837,7 +837,7 @@ vec4_visitor::nir_emit_ssbo_atomic(int op, nir_intrinsic_instr *instr)
        */
       brw_mark_surface_used(&prog_data->base,
                             prog_data->base.binding_table.ubo_start +
-                            shader_prog->NumBufferInterfaceBlocks - 1);
+                            nir->info.num_ssbos - 1);
    }
 
    src_reg offset = get_nir_src(instr->src[1], 1);
index 14930eb01842761b3c0469c7377713fa05e78c90..6f22f29447638495d8cfa97cd86238348c7d91a7 100644 (file)
@@ -124,12 +124,11 @@ void fs_visitor::setup_payload_gen4()
 {
    assert(stage == MESA_SHADER_FRAGMENT);
    brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
-   gl_fragment_program *fp = (gl_fragment_program*) prog;
    GLuint reg = 2;
    bool kill_stats_promoted_workaround = false;
    int lookup = key->iz_lookup;
    bool uses_depth =
-      (fp->Base.InputsRead & (1 << VARYING_SLOT_POS)) != 0;
+      (nir->info.inputs_read & (1 << VARYING_SLOT_POS)) != 0;
 
    assert(lookup < IZ_BIT_MAX);