<p dir="ltr">Sure</p>
<div class="gmail_quote">On Dec 16, 2014 10:17 AM, "Connor Abbott" <<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When Ken rebased my texture patches, he changed the titles to say<br>
"make thing() not take an ir_variable", which I like. Can you change<br>
the title of this one too?<br>
<br>
On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> From: Connor Abbott <<a href="mailto:connor.abbott@intel.com">connor.abbott@intel.com</a>><br>
><br>
> ---<br>
> src/mesa/drivers/dri/i965/brw_fs.cpp | 13 +++++++------<br>
> src/mesa/drivers/dri/i965/brw_fs.h | 3 ++-<br>
> src/mesa/drivers/dri/i965/brw_fs_fp.cpp | 4 +++-<br>
> src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 3 ++-<br>
> 4 files changed, 14 insertions(+), 9 deletions(-)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> index 6cac6d7..5de862c 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> @@ -1194,16 +1194,17 @@ fs_visitor::setup_builtin_uniform_values(ir_variable *ir)<br>
> }<br>
><br>
> fs_reg *<br>
> -fs_visitor::emit_fragcoord_interpolation(ir_variable *ir)<br>
> +fs_visitor::emit_fragcoord_interpolation(bool pixel_center_integer,<br>
> + bool origin_upper_left)<br>
> {<br>
> assert(stage == MESA_SHADER_FRAGMENT);<br>
> brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;<br>
> - fs_reg *reg = new(this->mem_ctx) fs_reg(this, ir->type);<br>
> + fs_reg *reg = new(this->mem_ctx) fs_reg(this, glsl_type::vec4_type);<br>
> fs_reg wpos = *reg;<br>
> - bool flip = !ir->data.origin_upper_left ^ key->render_to_fbo;<br>
> + bool flip = !origin_upper_left ^ key->render_to_fbo;<br>
><br>
> /* gl_FragCoord.x */<br>
> - if (ir->data.pixel_center_integer) {<br>
> + if (pixel_center_integer) {<br>
> emit(MOV(wpos, this->pixel_x));<br>
> } else {<br>
> emit(ADD(wpos, this->pixel_x, fs_reg(0.5f)));<br>
> @@ -1211,11 +1212,11 @@ fs_visitor::emit_fragcoord_interpolation(ir_variable *ir)<br>
> wpos = offset(wpos, 1);<br>
><br>
> /* gl_FragCoord.y */<br>
> - if (!flip && ir->data.pixel_center_integer) {<br>
> + if (!flip && pixel_center_integer) {<br>
> emit(MOV(wpos, this->pixel_y));<br>
> } else {<br>
> fs_reg pixel_y = this->pixel_y;<br>
> - float offset = (ir->data.pixel_center_integer ? 0.0 : 0.5);<br>
> + float offset = (pixel_center_integer ? 0.0 : 0.5);<br>
><br>
> if (flip) {<br>
> pixel_y.negate = true;<br>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h<br>
> index 58bb3ae..b270623 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_fs.h<br>
> +++ b/src/mesa/drivers/dri/i965/brw_fs.h<br>
> @@ -471,7 +471,8 @@ public:<br>
><br>
> void emit_dummy_fs();<br>
> void emit_repclear_shader();<br>
> - fs_reg *emit_fragcoord_interpolation(ir_variable *ir);<br>
> + fs_reg *emit_fragcoord_interpolation(bool pixel_center_integer,<br>
> + bool origin_upper_left);<br>
> fs_inst *emit_linterp(const fs_reg &attr, const fs_reg &interp,<br>
> glsl_interp_qualifier interpolation_mode,<br>
> bool is_centroid, bool is_sample);<br>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp<br>
> index 6348bc1..acef9de 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp<br>
> +++ b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp<br>
> @@ -586,8 +586,10 @@ fs_visitor::setup_fp_regs()<br>
> gl_fragment_program *fp = (gl_fragment_program*) prog;<br>
> ir->data.pixel_center_integer = fp->PixelCenterInteger;<br>
> ir->data.origin_upper_left = fp->OriginUpperLeft;<br>
> + fp_input_regs[i] =<br>
> + *emit_fragcoord_interpolation(fp->PixelCenterInteger,<br>
> + fp->OriginUpperLeft);<br>
> }<br>
> - fp_input_regs[i] = *emit_fragcoord_interpolation(ir);<br>
> break;<br>
> case VARYING_SLOT_FACE:<br>
> fp_input_regs[i] = *emit_frontfacing_interpolation();<br>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
> index 399e772..593c6e9 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
> +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
> @@ -92,7 +92,8 @@ fs_visitor::visit(ir_variable *ir)<br>
> fs_reg(ATTR, ir->data.location,<br>
> brw_type_for_base_type(ir->type->get_scalar_type()));<br>
> } else if (!strcmp(ir->name, "gl_FragCoord")) {<br>
> - reg = emit_fragcoord_interpolation(ir);<br>
> + reg = emit_fragcoord_interpolation(ir->data.pixel_center_integer,<br>
> + ir->data.origin_upper_left);<br>
> } else if (!strcmp(ir->name, "gl_FrontFacing")) {<br>
> reg = emit_frontfacing_interpolation();<br>
> } else {<br>
> --<br>
> 2.2.0<br>
><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>