[Mesa-dev] [PATCH 13/45] i965/fs: Handle 16-bit base types in helper functions
Eduardo Lima Mitev
elima at igalia.com
Mon Aug 21 07:57:44 UTC 2017
On 08/17/2017 09:26 PM, Jason Ekstrand wrote:
> On Thu, Jul 13, 2017 at 7:35 AM, Alejandro PiƱeiro <apinheiro at igalia.com
> <mailto:apinheiro at igalia.com>> wrote:
>
> From: Eduardo Lima Mitev <elima at igalia.com <mailto: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)?
>
Yes it should. I forgot to update that after the initial
everything-is-like-32-bit-types. Fixed for v2.
> Also, you might as well squash this into patch 12
>
Yes, I will do that too.
>
> 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 <mailto:mesa-dev at lists.freedesktop.org>
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> <https://lists.freedesktop.org/mailman/listinfo/mesa-dev>
>
>
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
More information about the mesa-dev
mailing list