On Thursday, February 12, 2015 03:36:36 PM Matt Turner wrote:
> ---
>  src/mesa/drivers/dri/i965/brw_shader.cpp | 16 ++++++++++++++++
>  src/mesa/drivers/dri/i965/brw_shader.h   |  1 +
>  2 files changed, 17 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp 
> b/src/mesa/drivers/dri/i965/brw_shader.cpp
> index 8b87d0d..d7b9c44 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
> @@ -734,6 +734,22 @@ backend_reg::is_one() const
>  }
>  
>  bool
> +backend_reg::is_negative_one() const
> +{
> +   if (file != IMM)
> +      return false;
> +
> +   switch (type) {
> +   case BRW_REGISTER_TYPE_F:
> +      return fixed_hw_reg.dw1.f == -1.0;
> +   case BRW_REGISTER_TYPE_D:
> +      return fixed_hw_reg.dw1.d == -1;
> +   default:
> +      return false;
> +   }
> +}
> +
> +bool
>  backend_reg::is_null() const
>  {
>     return file == HW_REG &&
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.h 
> b/src/mesa/drivers/dri/i965/brw_shader.h
> index 4b5c573..7bff186 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.h
> +++ b/src/mesa/drivers/dri/i965/brw_shader.h
> @@ -51,6 +51,7 @@ struct backend_reg
>  #ifdef __cplusplus
>     bool is_zero() const;
>     bool is_one() const;
> +   bool is_negative_one() const;
>     bool is_null() const;
>     bool is_accumulator() const;
>  #endif
> 

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

Attachment: signature.asc
Description: This is a digitally signed message part.

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

Reply via email to