[Mesa-dev] [PATCH 02/11] i965/fs: Cut an instruction and a temporary from gen6 discard statements.

Kenneth Graunke kenneth at whitecape.org
Fri May 13 16:12:01 PDT 2011

On 05/12/2011 09:05 PM, Eric Anholt wrote:
> I thought I was thwarted initially when I couldn't do conditional mod
> on a MOV, and couldn't use two immediate constants in one instruction.
> But g0 != g0 is also a way to produce a failing comparison.
> +      some_register = retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW);

Yes it is!

>         brw_CMP(p, retype(brw_null_reg(), BRW_REGISTER_TYPE_UD),
> -	      BRW_CONDITIONAL_Z, mask, brw_imm_ud(0)); /* active channels fail test */
> +	      BRW_CONDITIONAL_NZ, some_register, some_register);

Nice touch. :)

I assume you've tested this.  It does seem a lot simpler; the whole 
"discard AND" and "discard NOT" thing confused me quite a bit.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

More information about the mesa-dev mailing list