Re: [Mesa-dev] [PATCH 1/2] i965/fs: Optimize conditional discards.

2014-08-19 Thread Matt Turner
On Mon, Aug 18, 2014 at 5:50 PM, Kenneth Graunke wrote: > Almost all uses of discard in GLSL take the form: > > if (some_condition) > discard; > > This generates the following assembly: > > cmp.condition.f0.0 src0 src1 /* generate some condition */ > IF >(+f0.1) cmp.ne.

Re: [Mesa-dev] [PATCH 1/2] i965/fs: Optimize conditional discards.

2014-08-19 Thread Henri Verbeet
On 19 August 2014 02:50, Kenneth Graunke wrote: > +/* Returns a conditional modifier that negates the condition. */ > +enum brw_conditional_mod > +brw_negate_cmod(uint32_t cmod) > +{ > + switch (cmod) { > + case BRW_CONDITIONAL_Z: > + return BRW_CONDITIONAL_NZ; > + case BRW_CONDITIONAL_

[Mesa-dev] [PATCH 1/2] i965/fs: Optimize conditional discards.

2014-08-18 Thread Kenneth Graunke
Almost all uses of discard in GLSL take the form: if (some_condition) discard; This generates the following assembly: cmp.condition.f0.0 src0 src1 /* generate some condition */ IF (+f0.1) cmp.ne.f0.1 g0 g0 /* figure out enabled channels */ (-f0.1.anyNh) halt