Re: [Mesa-dev] [PATCH 02/45] glsl: Add 16-bit types

2017-08-18 Thread Alejandro Piñeiro
On 17/08/17 10:35, Eduardo Lima Mitev wrote:
> On 08/15/2017 10:56 PM, Jason Ekstrand wrote:
>> On Thu, Jul 13, 2017 at 7:35 AM, Alejandro Piñeiro > > wrote:
>>
>> From: Eduardo Lima Mitev >
>>
>> Adds new INT16, UINT16 and HALF FLOAT base types.
>>
>> The corresponding GL types for half floats were reused from the
>> AMD_gpu_shader_half_float extension. The int16 and uint16 types come
>> from
>> NV_gpu_shader_5 extension.
>>
>> This adds the builtins and the lexer support.
>>
>> To avoid a bunch of warnings due to cases not handled in switch, the
>> new types have been added to quite a few places using same behavior as
>> their 32-bit counterparts, except for a few trivial cases where they are
>> already handled properly. Subsequent patches in this set will provide
>> correct 16-bit implementations when needed.
>>
>> Signed-off-by: Jose Maria Casanova Crespo > >
>> Signed-off-by: Eduardo Lima >
>> Signed-off-by: Alejandro Piñeiro > >
>> ---
>>  src/compiler/builtin_type_macros.h  | 26 +++
>>  src/compiler/glsl/ast_to_hir.cpp|  3 +
>>  src/compiler/glsl/builtin_types.cpp |  1 +
>>  src/compiler/glsl/ir_clone.cpp  |  3 +
>>  src/compiler/glsl/link_uniform_initializers.cpp |  3 +
>>  src/compiler/glsl/lower_buffer_access.cpp   | 16 -
>>  src/compiler/glsl_types.cpp | 93
>> -
>>  src/compiler/glsl_types.h   | 10 ++-
>>  src/mesa/program/ir_to_mesa.cpp |  6 ++
>>  9 files changed, 155 insertions(+), 6 deletions(-)
>>
>> diff --git a/src/compiler/builtin_type_macros.h
>> b/src/compiler/builtin_type_macros.h
>> index a275617..52bae13 100644
>> --- a/src/compiler/builtin_type_macros.h
>> +++ b/src/compiler/builtin_type_macros.h
>> @@ -62,6 +62,22 @@ DECL_TYPE(mat3x4, GL_FLOAT_MAT3x4,
>> GLSL_TYPE_FLOAT, 4, 3)
>>  DECL_TYPE(mat4x2, GL_FLOAT_MAT4x2, GLSL_TYPE_FLOAT, 2, 4)
>>  DECL_TYPE(mat4x3, GL_FLOAT_MAT4x3, GLSL_TYPE_FLOAT, 3, 4)
>>
>> +DECL_TYPE(float16_t, GL_HALF_FLOAT, GLSL_TYPE_HALF_FLOAT, 1, 1)
>> +DECL_TYPE(f16vec2,   GL_FLOAT16_VEC2_NV,   GLSL_TYPE_HALF_FLOAT, 2, 1)
>> +DECL_TYPE(f16vec3,   GL_FLOAT16_VEC3_NV,   GLSL_TYPE_HALF_FLOAT, 3, 1)
>> +DECL_TYPE(f16vec4,   GL_FLOAT16_VEC4_NV,   GLSL_TYPE_HALF_FLOAT, 4, 1)
>> +
>> +DECL_TYPE(f16mat2,   GL_FLOAT16_MAT2_AMD,   GLSL_TYPE_HALF_FLOAT, 2, 2)
>> +DECL_TYPE(f16mat3,   GL_FLOAT16_MAT3_AMD,   GLSL_TYPE_HALF_FLOAT, 3, 3)
>> +DECL_TYPE(f16mat4,   GL_FLOAT16_MAT4_AMD,   GLSL_TYPE_HALF_FLOAT, 4, 4)
>> +
>> +DECL_TYPE(f16mat2x3, GL_FLOAT16_MAT2x3_AMD, GLSL_TYPE_HALF_FLOAT, 3, 2)
>> +DECL_TYPE(f16mat2x4, GL_FLOAT16_MAT2x4_AMD, GLSL_TYPE_HALF_FLOAT, 4, 2)
>> +DECL_TYPE(f16mat3x2, GL_FLOAT16_MAT3x2_AMD, GLSL_TYPE_HALF_FLOAT, 2, 3)
>> +DECL_TYPE(f16mat3x4, GL_FLOAT16_MAT3x4_AMD, GLSL_TYPE_HALF_FLOAT, 4, 3)
>> +DECL_TYPE(f16mat4x2, GL_FLOAT16_MAT4x2_AMD, GLSL_TYPE_HALF_FLOAT, 2, 4)
>> +DECL_TYPE(f16mat4x3, GL_FLOAT16_MAT4x3_AMD, GLSL_TYPE_HALF_FLOAT, 3, 4)
>> +
>>  DECL_TYPE(double,  GL_DOUBLE,GLSL_TYPE_DOUBLE, 1, 1)
>>  DECL_TYPE(dvec2,   GL_DOUBLE_VEC2,   GLSL_TYPE_DOUBLE, 2, 1)
>>  DECL_TYPE(dvec3,   GL_DOUBLE_VEC3,   GLSL_TYPE_DOUBLE, 3, 1)
>> @@ -88,6 +104,16 @@ DECL_TYPE(u64vec2,  GL_UNSIGNED_INT64_VEC2_ARB,
>> GLSL_TYPE_UINT64, 2, 1)
>>  DECL_TYPE(u64vec3,  GL_UNSIGNED_INT64_VEC3_ARB, GLSL_TYPE_UINT64, 3, 1)
>>  DECL_TYPE(u64vec4,  GL_UNSIGNED_INT64_VEC4_ARB, GLSL_TYPE_UINT64, 4, 1)
>>
>> +DECL_TYPE(int16_t,  GL_INT16_NV,  GLSL_TYPE_INT16, 1, 1)
>> +DECL_TYPE(i16vec2,  GL_INT16_VEC2_NV, GLSL_TYPE_INT16, 2, 1)
>> +DECL_TYPE(i16vec3,  GL_INT16_VEC3_NV, GLSL_TYPE_INT16, 3, 1)
>> +DECL_TYPE(i16vec4,  GL_INT16_VEC4_NV, GLSL_TYPE_INT16, 4, 1)
>> +
>> +DECL_TYPE(uint16_t, GL_UNSIGNED_INT16_NV,  GLSL_TYPE_UINT16, 1, 1)
>> +DECL_TYPE(u16vec2,  GL_UNSIGNED_INT16_VEC2_NV, GLSL_TYPE_UINT16, 2, 1)
>> +DECL_TYPE(u16vec3,  GL_UNSIGNED_INT16_VEC3_NV, GLSL_TYPE_UINT16, 3, 1)
>> +DECL_TYPE(u16vec4,  GL_UNSIGNED_INT16_VEC4_NV, GLSL_TYPE_UINT16, 4, 1)
>> +
>>  DECL_TYPE(sampler,   GL_SAMPLER_1D, 
>>  GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_1D,   0, 0, GLSL_TYPE_VOID)
>>  DECL_TYPE(sampler1D, GL_SAMPLER_1D, 
>>  GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_1D,   0, 0, GLSL_TYPE_FLOAT)
>>  DECL_TYPE(sampler2D, GL_SAMPLER_2D, 
>>  GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_2D,   0, 0, GLSL_TYPE_FLOAT)
>> diff --git 

Re: [Mesa-dev] [PATCH 02/45] glsl: Add 16-bit types

2017-08-17 Thread Jason Ekstrand
On Thu, Aug 17, 2017 at 7:20 AM, Jason Ekstrand 
wrote:

> On Thu, Aug 17, 2017 at 1:35 AM, Eduardo Lima Mitev 
> wrote:
>
>> On 08/15/2017 10:56 PM, Jason Ekstrand wrote:
>> >
>> > On Thu, Jul 13, 2017 at 7:35 AM, Alejandro Piñeiro <
>> apinhe...@igalia.com
>> > > wrote:
>> >
>> > From: Eduardo Lima Mitev > >>
>> >
>> > Adds new INT16, UINT16 and HALF FLOAT base types.
>> >
>> > The corresponding GL types for half floats were reused from the
>> > AMD_gpu_shader_half_float extension. The int16 and uint16 types come
>> > from
>> > NV_gpu_shader_5 extension.
>> >
>> > This adds the builtins and the lexer support.
>> >
>> > To avoid a bunch of warnings due to cases not handled in switch, the
>> > new types have been added to quite a few places using same behavior
>> as
>> > their 32-bit counterparts, except for a few trivial cases where
>> they are
>> > already handled properly. Subsequent patches in this set will
>> provide
>> > correct 16-bit implementations when needed.
>> >
>> > Signed-off-by: Jose Maria Casanova Crespo > > >
>> > Signed-off-by: Eduardo Lima  el...@igalia.com>>
>> > Signed-off-by: Alejandro Piñeiro > > >
>> > ---
>> >  src/compiler/builtin_type_macros.h  | 26 +++
>> >  src/compiler/glsl/ast_to_hir.cpp|  3 +
>> >  src/compiler/glsl/builtin_types.cpp |  1 +
>> >  src/compiler/glsl/ir_clone.cpp  |  3 +
>> >  src/compiler/glsl/link_uniform_initializers.cpp |  3 +
>> >  src/compiler/glsl/lower_buffer_access.cpp   | 16 -
>> >  src/compiler/glsl_types.cpp | 93
>> > -
>> >  src/compiler/glsl_types.h   | 10 ++-
>> >  src/mesa/program/ir_to_mesa.cpp |  6 ++
>> >  9 files changed, 155 insertions(+), 6 deletions(-)
>> >
>> > diff --git a/src/compiler/builtin_type_macros.h
>> > b/src/compiler/builtin_type_macros.h
>> > index a275617..52bae13 100644
>> > --- a/src/compiler/builtin_type_macros.h
>> > +++ b/src/compiler/builtin_type_macros.h
>> > @@ -62,6 +62,22 @@ DECL_TYPE(mat3x4, GL_FLOAT_MAT3x4,
>> > GLSL_TYPE_FLOAT, 4, 3)
>> >  DECL_TYPE(mat4x2, GL_FLOAT_MAT4x2, GLSL_TYPE_FLOAT, 2, 4)
>> >  DECL_TYPE(mat4x3, GL_FLOAT_MAT4x3, GLSL_TYPE_FLOAT, 3, 4)
>> >
>> > +DECL_TYPE(float16_t, GL_HALF_FLOAT, GLSL_TYPE_HALF_FLOAT, 1, 1)
>> > +DECL_TYPE(f16vec2,   GL_FLOAT16_VEC2_NV,   GLSL_TYPE_HALF_FLOAT,
>> 2, 1)
>> > +DECL_TYPE(f16vec3,   GL_FLOAT16_VEC3_NV,   GLSL_TYPE_HALF_FLOAT,
>> 3, 1)
>> > +DECL_TYPE(f16vec4,   GL_FLOAT16_VEC4_NV,   GLSL_TYPE_HALF_FLOAT,
>> 4, 1)
>> > +
>> > +DECL_TYPE(f16mat2,   GL_FLOAT16_MAT2_AMD,   GLSL_TYPE_HALF_FLOAT,
>> 2, 2)
>> > +DECL_TYPE(f16mat3,   GL_FLOAT16_MAT3_AMD,   GLSL_TYPE_HALF_FLOAT,
>> 3, 3)
>> > +DECL_TYPE(f16mat4,   GL_FLOAT16_MAT4_AMD,   GLSL_TYPE_HALF_FLOAT,
>> 4, 4)
>> > +
>> > +DECL_TYPE(f16mat2x3, GL_FLOAT16_MAT2x3_AMD, GLSL_TYPE_HALF_FLOAT,
>> 3, 2)
>> > +DECL_TYPE(f16mat2x4, GL_FLOAT16_MAT2x4_AMD, GLSL_TYPE_HALF_FLOAT,
>> 4, 2)
>> > +DECL_TYPE(f16mat3x2, GL_FLOAT16_MAT3x2_AMD, GLSL_TYPE_HALF_FLOAT,
>> 2, 3)
>> > +DECL_TYPE(f16mat3x4, GL_FLOAT16_MAT3x4_AMD, GLSL_TYPE_HALF_FLOAT,
>> 4, 3)
>> > +DECL_TYPE(f16mat4x2, GL_FLOAT16_MAT4x2_AMD, GLSL_TYPE_HALF_FLOAT,
>> 2, 4)
>> > +DECL_TYPE(f16mat4x3, GL_FLOAT16_MAT4x3_AMD, GLSL_TYPE_HALF_FLOAT,
>> 3, 4)
>> > +
>> >  DECL_TYPE(double,  GL_DOUBLE,GLSL_TYPE_DOUBLE, 1, 1)
>> >  DECL_TYPE(dvec2,   GL_DOUBLE_VEC2,   GLSL_TYPE_DOUBLE, 2, 1)
>> >  DECL_TYPE(dvec3,   GL_DOUBLE_VEC3,   GLSL_TYPE_DOUBLE, 3, 1)
>> > @@ -88,6 +104,16 @@ DECL_TYPE(u64vec2,  GL_UNSIGNED_INT64_VEC2_ARB,
>> > GLSL_TYPE_UINT64, 2, 1)
>> >  DECL_TYPE(u64vec3,  GL_UNSIGNED_INT64_VEC3_ARB, GLSL_TYPE_UINT64,
>> 3, 1)
>> >  DECL_TYPE(u64vec4,  GL_UNSIGNED_INT64_VEC4_ARB, GLSL_TYPE_UINT64,
>> 4, 1)
>> >
>> > +DECL_TYPE(int16_t,  GL_INT16_NV,  GLSL_TYPE_INT16, 1, 1)
>> > +DECL_TYPE(i16vec2,  GL_INT16_VEC2_NV, GLSL_TYPE_INT16, 2, 1)
>> > +DECL_TYPE(i16vec3,  GL_INT16_VEC3_NV, GLSL_TYPE_INT16, 3, 1)
>> > +DECL_TYPE(i16vec4,  GL_INT16_VEC4_NV, GLSL_TYPE_INT16, 4, 1)
>> > +
>> > +DECL_TYPE(uint16_t, GL_UNSIGNED_INT16_NV,  GLSL_TYPE_UINT16,
>> 1, 1)
>> > +DECL_TYPE(u16vec2,  GL_UNSIGNED_INT16_VEC2_NV, GLSL_TYPE_UINT16,
>> 2, 1)
>> > +DECL_TYPE(u16vec3,  GL_UNSIGNED_INT16_VEC3_NV, GLSL_TYPE_UINT16,
>> 3, 1)
>> > +DECL_TYPE(u16vec4,  GL_UNSIGNED_INT16_VEC4_NV, GLSL_TYPE_UINT16,
>> 4, 1)
>> > +
>> >  DECL_TYPE(sampler,   GL_SAMPLER_1D,
>> >  GLSL_TYPE_SAMPLER, 

Re: [Mesa-dev] [PATCH 02/45] glsl: Add 16-bit types

2017-08-17 Thread Jason Ekstrand
On Thu, Aug 17, 2017 at 1:35 AM, Eduardo Lima Mitev 
wrote:

> On 08/15/2017 10:56 PM, Jason Ekstrand wrote:
> >
> > On Thu, Jul 13, 2017 at 7:35 AM, Alejandro Piñeiro  > > wrote:
> >
> > From: Eduardo Lima Mitev  >>
> >
> > Adds new INT16, UINT16 and HALF FLOAT base types.
> >
> > The corresponding GL types for half floats were reused from the
> > AMD_gpu_shader_half_float extension. The int16 and uint16 types come
> > from
> > NV_gpu_shader_5 extension.
> >
> > This adds the builtins and the lexer support.
> >
> > To avoid a bunch of warnings due to cases not handled in switch, the
> > new types have been added to quite a few places using same behavior
> as
> > their 32-bit counterparts, except for a few trivial cases where they
> are
> > already handled properly. Subsequent patches in this set will provide
> > correct 16-bit implementations when needed.
> >
> > Signed-off-by: Jose Maria Casanova Crespo  > >
> > Signed-off-by: Eduardo Lima >
> > Signed-off-by: Alejandro Piñeiro  > >
> > ---
> >  src/compiler/builtin_type_macros.h  | 26 +++
> >  src/compiler/glsl/ast_to_hir.cpp|  3 +
> >  src/compiler/glsl/builtin_types.cpp |  1 +
> >  src/compiler/glsl/ir_clone.cpp  |  3 +
> >  src/compiler/glsl/link_uniform_initializers.cpp |  3 +
> >  src/compiler/glsl/lower_buffer_access.cpp   | 16 -
> >  src/compiler/glsl_types.cpp | 93
> > -
> >  src/compiler/glsl_types.h   | 10 ++-
> >  src/mesa/program/ir_to_mesa.cpp |  6 ++
> >  9 files changed, 155 insertions(+), 6 deletions(-)
> >
> > diff --git a/src/compiler/builtin_type_macros.h
> > b/src/compiler/builtin_type_macros.h
> > index a275617..52bae13 100644
> > --- a/src/compiler/builtin_type_macros.h
> > +++ b/src/compiler/builtin_type_macros.h
> > @@ -62,6 +62,22 @@ DECL_TYPE(mat3x4, GL_FLOAT_MAT3x4,
> > GLSL_TYPE_FLOAT, 4, 3)
> >  DECL_TYPE(mat4x2, GL_FLOAT_MAT4x2, GLSL_TYPE_FLOAT, 2, 4)
> >  DECL_TYPE(mat4x3, GL_FLOAT_MAT4x3, GLSL_TYPE_FLOAT, 3, 4)
> >
> > +DECL_TYPE(float16_t, GL_HALF_FLOAT, GLSL_TYPE_HALF_FLOAT, 1, 1)
> > +DECL_TYPE(f16vec2,   GL_FLOAT16_VEC2_NV,   GLSL_TYPE_HALF_FLOAT, 2,
> 1)
> > +DECL_TYPE(f16vec3,   GL_FLOAT16_VEC3_NV,   GLSL_TYPE_HALF_FLOAT, 3,
> 1)
> > +DECL_TYPE(f16vec4,   GL_FLOAT16_VEC4_NV,   GLSL_TYPE_HALF_FLOAT, 4,
> 1)
> > +
> > +DECL_TYPE(f16mat2,   GL_FLOAT16_MAT2_AMD,   GLSL_TYPE_HALF_FLOAT,
> 2, 2)
> > +DECL_TYPE(f16mat3,   GL_FLOAT16_MAT3_AMD,   GLSL_TYPE_HALF_FLOAT,
> 3, 3)
> > +DECL_TYPE(f16mat4,   GL_FLOAT16_MAT4_AMD,   GLSL_TYPE_HALF_FLOAT,
> 4, 4)
> > +
> > +DECL_TYPE(f16mat2x3, GL_FLOAT16_MAT2x3_AMD, GLSL_TYPE_HALF_FLOAT,
> 3, 2)
> > +DECL_TYPE(f16mat2x4, GL_FLOAT16_MAT2x4_AMD, GLSL_TYPE_HALF_FLOAT,
> 4, 2)
> > +DECL_TYPE(f16mat3x2, GL_FLOAT16_MAT3x2_AMD, GLSL_TYPE_HALF_FLOAT,
> 2, 3)
> > +DECL_TYPE(f16mat3x4, GL_FLOAT16_MAT3x4_AMD, GLSL_TYPE_HALF_FLOAT,
> 4, 3)
> > +DECL_TYPE(f16mat4x2, GL_FLOAT16_MAT4x2_AMD, GLSL_TYPE_HALF_FLOAT,
> 2, 4)
> > +DECL_TYPE(f16mat4x3, GL_FLOAT16_MAT4x3_AMD, GLSL_TYPE_HALF_FLOAT,
> 3, 4)
> > +
> >  DECL_TYPE(double,  GL_DOUBLE,GLSL_TYPE_DOUBLE, 1, 1)
> >  DECL_TYPE(dvec2,   GL_DOUBLE_VEC2,   GLSL_TYPE_DOUBLE, 2, 1)
> >  DECL_TYPE(dvec3,   GL_DOUBLE_VEC3,   GLSL_TYPE_DOUBLE, 3, 1)
> > @@ -88,6 +104,16 @@ DECL_TYPE(u64vec2,  GL_UNSIGNED_INT64_VEC2_ARB,
> > GLSL_TYPE_UINT64, 2, 1)
> >  DECL_TYPE(u64vec3,  GL_UNSIGNED_INT64_VEC3_ARB, GLSL_TYPE_UINT64,
> 3, 1)
> >  DECL_TYPE(u64vec4,  GL_UNSIGNED_INT64_VEC4_ARB, GLSL_TYPE_UINT64,
> 4, 1)
> >
> > +DECL_TYPE(int16_t,  GL_INT16_NV,  GLSL_TYPE_INT16, 1, 1)
> > +DECL_TYPE(i16vec2,  GL_INT16_VEC2_NV, GLSL_TYPE_INT16, 2, 1)
> > +DECL_TYPE(i16vec3,  GL_INT16_VEC3_NV, GLSL_TYPE_INT16, 3, 1)
> > +DECL_TYPE(i16vec4,  GL_INT16_VEC4_NV, GLSL_TYPE_INT16, 4, 1)
> > +
> > +DECL_TYPE(uint16_t, GL_UNSIGNED_INT16_NV,  GLSL_TYPE_UINT16, 1,
> 1)
> > +DECL_TYPE(u16vec2,  GL_UNSIGNED_INT16_VEC2_NV, GLSL_TYPE_UINT16, 2,
> 1)
> > +DECL_TYPE(u16vec3,  GL_UNSIGNED_INT16_VEC3_NV, GLSL_TYPE_UINT16, 3,
> 1)
> > +DECL_TYPE(u16vec4,  GL_UNSIGNED_INT16_VEC4_NV, GLSL_TYPE_UINT16, 4,
> 1)
> > +
> >  DECL_TYPE(sampler,   GL_SAMPLER_1D,
> >  GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_1D,   0, 0, GLSL_TYPE_VOID)
> >  DECL_TYPE(sampler1D, GL_SAMPLER_1D,
> >  GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_1D,   0, 0, GLSL_TYPE_FLOAT)
> >  DECL_TYPE(sampler2D, 

Re: [Mesa-dev] [PATCH 02/45] glsl: Add 16-bit types

2017-08-17 Thread Eduardo Lima Mitev
On 08/15/2017 10:56 PM, Jason Ekstrand wrote:
> 
> On Thu, Jul 13, 2017 at 7:35 AM, Alejandro Piñeiro  > wrote:
> 
> From: Eduardo Lima Mitev >
> 
> Adds new INT16, UINT16 and HALF FLOAT base types.
> 
> The corresponding GL types for half floats were reused from the
> AMD_gpu_shader_half_float extension. The int16 and uint16 types come
> from
> NV_gpu_shader_5 extension.
> 
> This adds the builtins and the lexer support.
> 
> To avoid a bunch of warnings due to cases not handled in switch, the
> new types have been added to quite a few places using same behavior as
> their 32-bit counterparts, except for a few trivial cases where they are
> already handled properly. Subsequent patches in this set will provide
> correct 16-bit implementations when needed.
> 
> Signed-off-by: Jose Maria Casanova Crespo  >
> Signed-off-by: Eduardo Lima >
> Signed-off-by: Alejandro Piñeiro  >
> ---
>  src/compiler/builtin_type_macros.h  | 26 +++
>  src/compiler/glsl/ast_to_hir.cpp|  3 +
>  src/compiler/glsl/builtin_types.cpp |  1 +
>  src/compiler/glsl/ir_clone.cpp  |  3 +
>  src/compiler/glsl/link_uniform_initializers.cpp |  3 +
>  src/compiler/glsl/lower_buffer_access.cpp   | 16 -
>  src/compiler/glsl_types.cpp | 93
> -
>  src/compiler/glsl_types.h   | 10 ++-
>  src/mesa/program/ir_to_mesa.cpp |  6 ++
>  9 files changed, 155 insertions(+), 6 deletions(-)
> 
> diff --git a/src/compiler/builtin_type_macros.h
> b/src/compiler/builtin_type_macros.h
> index a275617..52bae13 100644
> --- a/src/compiler/builtin_type_macros.h
> +++ b/src/compiler/builtin_type_macros.h
> @@ -62,6 +62,22 @@ DECL_TYPE(mat3x4, GL_FLOAT_MAT3x4,
> GLSL_TYPE_FLOAT, 4, 3)
>  DECL_TYPE(mat4x2, GL_FLOAT_MAT4x2, GLSL_TYPE_FLOAT, 2, 4)
>  DECL_TYPE(mat4x3, GL_FLOAT_MAT4x3, GLSL_TYPE_FLOAT, 3, 4)
> 
> +DECL_TYPE(float16_t, GL_HALF_FLOAT, GLSL_TYPE_HALF_FLOAT, 1, 1)
> +DECL_TYPE(f16vec2,   GL_FLOAT16_VEC2_NV,   GLSL_TYPE_HALF_FLOAT, 2, 1)
> +DECL_TYPE(f16vec3,   GL_FLOAT16_VEC3_NV,   GLSL_TYPE_HALF_FLOAT, 3, 1)
> +DECL_TYPE(f16vec4,   GL_FLOAT16_VEC4_NV,   GLSL_TYPE_HALF_FLOAT, 4, 1)
> +
> +DECL_TYPE(f16mat2,   GL_FLOAT16_MAT2_AMD,   GLSL_TYPE_HALF_FLOAT, 2, 2)
> +DECL_TYPE(f16mat3,   GL_FLOAT16_MAT3_AMD,   GLSL_TYPE_HALF_FLOAT, 3, 3)
> +DECL_TYPE(f16mat4,   GL_FLOAT16_MAT4_AMD,   GLSL_TYPE_HALF_FLOAT, 4, 4)
> +
> +DECL_TYPE(f16mat2x3, GL_FLOAT16_MAT2x3_AMD, GLSL_TYPE_HALF_FLOAT, 3, 2)
> +DECL_TYPE(f16mat2x4, GL_FLOAT16_MAT2x4_AMD, GLSL_TYPE_HALF_FLOAT, 4, 2)
> +DECL_TYPE(f16mat3x2, GL_FLOAT16_MAT3x2_AMD, GLSL_TYPE_HALF_FLOAT, 2, 3)
> +DECL_TYPE(f16mat3x4, GL_FLOAT16_MAT3x4_AMD, GLSL_TYPE_HALF_FLOAT, 4, 3)
> +DECL_TYPE(f16mat4x2, GL_FLOAT16_MAT4x2_AMD, GLSL_TYPE_HALF_FLOAT, 2, 4)
> +DECL_TYPE(f16mat4x3, GL_FLOAT16_MAT4x3_AMD, GLSL_TYPE_HALF_FLOAT, 3, 4)
> +
>  DECL_TYPE(double,  GL_DOUBLE,GLSL_TYPE_DOUBLE, 1, 1)
>  DECL_TYPE(dvec2,   GL_DOUBLE_VEC2,   GLSL_TYPE_DOUBLE, 2, 1)
>  DECL_TYPE(dvec3,   GL_DOUBLE_VEC3,   GLSL_TYPE_DOUBLE, 3, 1)
> @@ -88,6 +104,16 @@ DECL_TYPE(u64vec2,  GL_UNSIGNED_INT64_VEC2_ARB,
> GLSL_TYPE_UINT64, 2, 1)
>  DECL_TYPE(u64vec3,  GL_UNSIGNED_INT64_VEC3_ARB, GLSL_TYPE_UINT64, 3, 1)
>  DECL_TYPE(u64vec4,  GL_UNSIGNED_INT64_VEC4_ARB, GLSL_TYPE_UINT64, 4, 1)
> 
> +DECL_TYPE(int16_t,  GL_INT16_NV,  GLSL_TYPE_INT16, 1, 1)
> +DECL_TYPE(i16vec2,  GL_INT16_VEC2_NV, GLSL_TYPE_INT16, 2, 1)
> +DECL_TYPE(i16vec3,  GL_INT16_VEC3_NV, GLSL_TYPE_INT16, 3, 1)
> +DECL_TYPE(i16vec4,  GL_INT16_VEC4_NV, GLSL_TYPE_INT16, 4, 1)
> +
> +DECL_TYPE(uint16_t, GL_UNSIGNED_INT16_NV,  GLSL_TYPE_UINT16, 1, 1)
> +DECL_TYPE(u16vec2,  GL_UNSIGNED_INT16_VEC2_NV, GLSL_TYPE_UINT16, 2, 1)
> +DECL_TYPE(u16vec3,  GL_UNSIGNED_INT16_VEC3_NV, GLSL_TYPE_UINT16, 3, 1)
> +DECL_TYPE(u16vec4,  GL_UNSIGNED_INT16_VEC4_NV, GLSL_TYPE_UINT16, 4, 1)
> +
>  DECL_TYPE(sampler,   GL_SAMPLER_1D, 
>  GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_1D,   0, 0, GLSL_TYPE_VOID)
>  DECL_TYPE(sampler1D, GL_SAMPLER_1D, 
>  GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_1D,   0, 0, GLSL_TYPE_FLOAT)
>  DECL_TYPE(sampler2D, GL_SAMPLER_2D, 
>  GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_2D,   0, 0, GLSL_TYPE_FLOAT)
> diff --git a/src/compiler/glsl/ast_to_hir.cpp
> b/src/compiler/glsl/ast_to_hir.cpp
> index c338ad7..4f6a324 100644
> ---