[Mesa-dev] [PATCH 1.9/2] i965: Add brw_imm_uv().

Jason Ekstrand jason at jlekstrand.net
Thu Nov 19 08:00:02 PST 2015


On Wed, Nov 18, 2015 at 2:25 PM, Matt Turner <mattst88 at gmail.com> wrote:
> ---
>  src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 3 +++
>  src/mesa/drivers/dri/i965/brw_reg.h            | 9 +++++++++
>  2 files changed, 12 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> index e5a286a..78c10e9 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> @@ -116,6 +116,9 @@ brw_reg_from_fs_reg(fs_inst *inst, fs_reg *reg, unsigned gen)
>        case BRW_REGISTER_TYPE_V:
>           brw_reg = brw_imm_v(reg->ud);
>           break;
> +      case BRW_REGISTER_TYPE_UV:
> +         brw_reg = brw_imm_uv(reg->ud);
> +         break;
>        default:
>          unreachable("not reached");
>        }
> diff --git a/src/mesa/drivers/dri/i965/brw_reg.h b/src/mesa/drivers/dri/i965/brw_reg.h
> index 759bd93..b77cdeb 100644
> --- a/src/mesa/drivers/dri/i965/brw_reg.h
> +++ b/src/mesa/drivers/dri/i965/brw_reg.h
> @@ -623,6 +623,15 @@ brw_imm_v(unsigned v)
>     return imm;
>  }
>
> +/** Construct vector of eight unsigned half-byte values */
> +static inline struct brw_reg
> +brw_imm_uv(unsigned uv)
> +{

Please add a GEN assertion either here or in the generator.  This only
becomes available on Haswell or Broadwell if I remember correctly.  I
do know it's not universally available.

> +   struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_UV);
> +   imm.ud = uv;
> +   return imm;
> +}
> +
>  /** Construct vector of four 8-bit float values */
>  static inline struct brw_reg
>  brw_imm_vf(unsigned v)
> --
> 2.4.9
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list