Re: [Mesa-dev] [PATCH 7/8] i965/fs: Optimize gl_FrontFacing calculation on Gen6+.

2014-08-18 Thread Anuj Phogat
On Fri, Aug 15, 2014 at 4:43 PM, Matt Turner matts...@gmail.com wrote:
 On Fri, Aug 15, 2014 at 3:26 PM, Anuj Phogat anuj.pho...@gmail.com wrote:
 With comment on patch 3 addressed:
 Patches 1-7 are: Acked-by: Anuj Phogat anuj.pho...@gmail.com

 Thanks for looking over the patches!

 Acked-by is used in the kernel by a maintainer to acknowledge the
 changes to his particular subsystem in a patch that affects many
 subsystems, or for maintainers to say yeah, looks good to me. We use
 it in Mesa to say yeah, the idea seems good without really saying
 that we've reviewed the contents of the patch itself.

 The kernel docs describe what a Reviewed-by really means here [1], but
 basically it's that (1) I read the patch, (2) I'm satisfied with the
 patch, (3) I think the patch is worthwhile, and (4) I'm not making any
 guarantees. :-)

 Can I upgrade your Acked-bys to Reviewed-bys?

Yes. go ahead.

 [1] 
 http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches#n498
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 7/8] i965/fs: Optimize gl_FrontFacing calculation on Gen6+.

2014-08-15 Thread Anuj Phogat
On Sun, Aug 10, 2014 at 4:18 PM, Matt Turner matts...@gmail.com wrote:
 total instructions in shared programs: 4288650 - 4282838 (-0.14%)
 instructions in affected programs: 595018 - 589206 (-0.98%)
 ---
  src/mesa/drivers/dri/i965/brw_fs.cpp | 21 +++--
  1 file changed, 15 insertions(+), 6 deletions(-)

 diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
 b/src/mesa/drivers/dri/i965/brw_fs.cpp
 index f394ec9..f7cadd5 100644
 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
 +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
 @@ -1188,13 +1188,22 @@ 
 fs_visitor::emit_frontfacing_interpolation(ir_variable *ir)
  {
 fs_reg *reg = new(this-mem_ctx) fs_reg(this, ir-type);

 -   /* The frontfacing comes in as a bit in the thread payload. */
 if (brw-gen = 6) {
 -  emit(BRW_OPCODE_SHL, *reg,
 -  fs_reg(retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_D)),
 -   fs_reg(16));
 -  emit(BRW_OPCODE_NOT, *reg, *reg);
 -  emit(BRW_OPCODE_ASR, *reg, *reg, fs_reg(31));
 +  /* Bit 15 of g0.0 is 0 if the polygon is front facing. We want to 
 create
 +   * a boolean result from this (~0/true or 0/false).
 +   *
 +   * We can use the fact that bit 15 is the MSB of g0.0:W to accomplish
 +   * this task in only one instruction:
 +   *- a negation source modifier will flip the bit; and
 +   *- a W - D type conversion will sign extend the bit into the high
 +   *  word of the destination.
 +   *
 +   * An ASR 15 fills the low word of the destination.
 +   */
Nice trick.
 +  fs_reg g0 = fs_reg(retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_W));
 +  g0.negate = true;
 +
 +  emit(ASR(*reg, g0, fs_reg(15)));
 } else {
struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), 
 BRW_REGISTER_TYPE_UD);
/* bit 31 is primitive is back face, so checking  (1  31) gives
 --
 1.8.5.5

 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev

With comment on patch 3 addressed:
Patches 1-7 are: Acked-by: Anuj Phogat anuj.pho...@gmail.com
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 7/8] i965/fs: Optimize gl_FrontFacing calculation on Gen6+.

2014-08-15 Thread Matt Turner
On Fri, Aug 15, 2014 at 3:26 PM, Anuj Phogat anuj.pho...@gmail.com wrote:
 With comment on patch 3 addressed:
 Patches 1-7 are: Acked-by: Anuj Phogat anuj.pho...@gmail.com

Thanks for looking over the patches!

Acked-by is used in the kernel by a maintainer to acknowledge the
changes to his particular subsystem in a patch that affects many
subsystems, or for maintainers to say yeah, looks good to me. We use
it in Mesa to say yeah, the idea seems good without really saying
that we've reviewed the contents of the patch itself.

The kernel docs describe what a Reviewed-by really means here [1], but
basically it's that (1) I read the patch, (2) I'm satisfied with the
patch, (3) I think the patch is worthwhile, and (4) I'm not making any
guarantees. :-)

Can I upgrade your Acked-bys to Reviewed-bys?

[1] 
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches#n498
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev