i965/fs: don't pass ir_variable * to emit_samplepos_setup()
authorConnor Abbott <connor.abbott@intel.com>
Tue, 5 Aug 2014 18:10:07 +0000 (11:10 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 1 Sep 2014 07:12:15 +0000 (00:12 -0700)
We were only using it to get at its type, which we already know because
it's a builtin variable.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp

index 410c441e2d1188a3015a6c44ec0a830e804619cc..268f52891c269d1d43c3e70173f7a8f972560920 100644 (file)
@@ -1250,13 +1250,12 @@ fs_visitor::compute_sample_position(fs_reg dst, fs_reg int_sample_pos)
 }
 
 fs_reg *
-fs_visitor::emit_samplepos_setup(ir_variable *ir)
+fs_visitor::emit_samplepos_setup()
 {
    assert(brw->gen >= 6);
-   assert(ir->type == glsl_type::vec2_type);
 
    this->current_annotation = "compute sample position";
-   fs_reg *reg = new(this->mem_ctx) fs_reg(this, ir->type);
+   fs_reg *reg = new(this->mem_ctx) fs_reg(this, glsl_type::vec2_type);
    fs_reg pos = *reg;
    fs_reg int_sample_x = fs_reg(this, glsl_type::int_type);
    fs_reg int_sample_y = fs_reg(this, glsl_type::int_type);
index f8f38e00bb26e88b8df77e1d8e589d5a3123102a..02435b7d1d8de3ada3d202d32035d2d6d4339a6a 100644 (file)
@@ -366,7 +366,7 @@ public:
                          glsl_interp_qualifier interpolation_mode,
                          bool is_centroid, bool is_sample);
    fs_reg *emit_frontfacing_interpolation();
-   fs_reg *emit_samplepos_setup(ir_variable *ir);
+   fs_reg *emit_samplepos_setup();
    fs_reg *emit_sampleid_setup(ir_variable *ir);
    fs_reg *emit_general_interpolation(ir_variable *ir);
    void emit_interpolation_setup_gen4();
index df65e5e8b1d273e6076be41c3dfd8477601fbe2e..a6b0aefd1002ebdb82d9108e50bea612cf2cf4e3 100644 (file)
@@ -134,7 +134,7 @@ fs_visitor::visit(ir_variable *ir)
 
    } else if (ir->data.mode == ir_var_system_value) {
       if (ir->data.location == SYSTEM_VALUE_SAMPLE_POS) {
-        reg = emit_samplepos_setup(ir);
+        reg = emit_samplepos_setup();
       } else if (ir->data.location == SYSTEM_VALUE_SAMPLE_ID) {
         reg = emit_sampleid_setup(ir);
       } else if (ir->data.location == SYSTEM_VALUE_SAMPLE_MASK_IN) {