[Mesa-dev] [PATCH 13/45] i965/fs: Handle 16-bit base types in helper functions

Jason Ekstrand jason at jlekstrand.net
Thu Aug 17 19:26:14 UTC 2017


On Thu, Jul 13, 2017 at 7:35 AM, Alejandro PiƱeiro <apinheiro at igalia.com>
wrote:

> From: Eduardo Lima Mitev <elima at igalia.com>
>
> ---
>  src/intel/compiler/brw_fs.cpp     | 3 +++
>  src/intel/compiler/brw_shader.cpp | 6 ++++++
>  2 files changed, 9 insertions(+)
>
> diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
> index a2a99b7..0862918 100644
> --- a/src/intel/compiler/brw_fs.cpp
> +++ b/src/intel/compiler/brw_fs.cpp
> @@ -456,7 +456,10 @@ type_size_scalar(const struct glsl_type *type)
>     switch (type->base_type) {
>     case GLSL_TYPE_UINT:
>     case GLSL_TYPE_INT:
> +   case GLSL_TYPE_UINT16:
> +   case GLSL_TYPE_INT16:
>     case GLSL_TYPE_FLOAT:
> +   case GLSL_TYPE_HALF_FLOAT:
>

Is this correct?  Should it be DIV_ROUND_UP(type->components(), 2)?

Also, you might as well squash this into patch 12


>     case GLSL_TYPE_BOOL:
>        return type->components();
>     case GLSL_TYPE_DOUBLE:
> diff --git a/src/intel/compiler/brw_shader.cpp b/src/intel/compiler/brw_
> shader.cpp
> index 53d0742..9c43391 100644
> --- a/src/intel/compiler/brw_shader.cpp
> +++ b/src/intel/compiler/brw_shader.cpp
> @@ -34,14 +34,20 @@ enum brw_reg_type
>  brw_type_for_base_type(const struct glsl_type *type)
>  {
>     switch (type->base_type) {
> +   case GLSL_TYPE_HALF_FLOAT:
> +      return BRW_REGISTER_TYPE_HF;
>     case GLSL_TYPE_FLOAT:
>        return BRW_REGISTER_TYPE_F;
>     case GLSL_TYPE_INT:
>     case GLSL_TYPE_BOOL:
>     case GLSL_TYPE_SUBROUTINE:
>        return BRW_REGISTER_TYPE_D;
> +   case GLSL_TYPE_INT16:
> +      return BRW_REGISTER_TYPE_W;
>     case GLSL_TYPE_UINT:
>        return BRW_REGISTER_TYPE_UD;
> +   case GLSL_TYPE_UINT16:
> +      return BRW_REGISTER_TYPE_UW;
>     case GLSL_TYPE_ARRAY:
>        return brw_type_for_base_type(type->fields.array);
>     case GLSL_TYPE_STRUCT:
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170817/8c67baa6/attachment.html>


More information about the mesa-dev mailing list