diff options
author | Connor Abbott <[email protected]> | 2014-08-05 10:29:00 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2014-09-01 00:11:16 -0700 |
commit | ec3d06f591f9561289f7bc64a543a1e8a625faee (patch) | |
tree | 4785c002e9e5dfea71c64ee14d300e2def1d3d1c | |
parent | 70691f0c283ec4e03523f3a4690d9b897b36872e (diff) |
i965/fs: don't pass ir_variable * to emit_frontfacing_interpolation()
We were only using it to get at its type, which we already know because
it's a builtin variable.
v2 (Ken): Rebase on Matt's optimized gl_FrontFacing calculations.
Signed-off-by: Connor Abbott <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_fp.cpp | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index e700ef6e63a..410c441e2d1 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1185,9 +1185,9 @@ fs_visitor::emit_general_interpolation(ir_variable *ir) } fs_reg * -fs_visitor::emit_frontfacing_interpolation(ir_variable *ir) +fs_visitor::emit_frontfacing_interpolation() { - fs_reg *reg = new(this->mem_ctx) fs_reg(this, ir->type); + fs_reg *reg = new(this->mem_ctx) fs_reg(this, glsl_type::bool_type); if (brw->gen >= 6) { /* Bit 15 of g0.0 is 0 if the polygon is front facing. We want to create @@ -1217,7 +1217,7 @@ fs_visitor::emit_frontfacing_interpolation(ir_variable *ir) * Instead, use ASR (which will give ~0/true or 0/false) followed by an * AND 1. */ - fs_reg asr = fs_reg(this, ir->type); + fs_reg asr = fs_reg(this, glsl_type::bool_type); fs_reg g1_6 = fs_reg(retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_D)); g1_6.negate = true; diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index c2bc1f0e130..f8f38e00bb2 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -365,7 +365,7 @@ public: fs_inst *emit_linterp(const fs_reg &attr, const fs_reg &interp, glsl_interp_qualifier interpolation_mode, bool is_centroid, bool is_sample); - fs_reg *emit_frontfacing_interpolation(ir_variable *ir); + fs_reg *emit_frontfacing_interpolation(); fs_reg *emit_samplepos_setup(ir_variable *ir); fs_reg *emit_sampleid_setup(ir_variable *ir); fs_reg *emit_general_interpolation(ir_variable *ir); diff --git a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp index 98df29947ef..c82bd9b76ac 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp @@ -609,7 +609,7 @@ fs_visitor::setup_fp_regs() fp_input_regs[i] = *emit_fragcoord_interpolation(ir); break; case VARYING_SLOT_FACE: - fp_input_regs[i] = *emit_frontfacing_interpolation(ir); + fp_input_regs[i] = *emit_frontfacing_interpolation(); break; default: fp_input_regs[i] = *emit_general_interpolation(ir); diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 24d6bcea476..df65e5e8b1d 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -60,7 +60,7 @@ fs_visitor::visit(ir_variable *ir) if (!strcmp(ir->name, "gl_FragCoord")) { reg = emit_fragcoord_interpolation(ir); } else if (!strcmp(ir->name, "gl_FrontFacing")) { - reg = emit_frontfacing_interpolation(ir); + reg = emit_frontfacing_interpolation(); } else { reg = emit_general_interpolation(ir); } |