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

Henri Verbeet hverbeet at gmail.com
Tue Aug 19 09:05:13 PDT 2014


On 19 August 2014 02:50, Kenneth Graunke <kenneth at whitecape.org> 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_NZ:
> +      return BRW_CONDITIONAL_Z;
> +   case BRW_CONDITIONAL_G:
> +      return BRW_CONDITIONAL_LE;
> +   case BRW_CONDITIONAL_GE:
> +      return BRW_CONDITIONAL_L;
> +   case BRW_CONDITIONAL_L:
> +      return BRW_CONDITIONAL_GE;
> +   case BRW_CONDITIONAL_LE:
> +      return BRW_CONDITIONAL_G;
> +   default:
> +      return ~0;
> +   }
> +}
I suspect you may not care because GLSL seems to leave INF and NaN
behaviour mostly undefined, but note that strictly speaking e.g. "x <
x" isn't equivalent to "!(x >= x)" when x is NaN.


More information about the mesa-dev mailing list