[Mesa-dev] [PATCH 12/13] compiler: int8/uint8 support

Jason Ekstrand jason at jlekstrand.net
Wed Feb 28 21:33:45 UTC 2018


On Wed, Feb 28, 2018 at 11:51 AM, Rob Clark <robdclark at gmail.com> wrote:

> From: Karol Herbst <kherbst at redhat.com>
>
> OpenCL kernels also have int8/uint8.
>
> Signed-off-by: Rob Clark <robdclark at gmail.com>
> ---
>  src/compiler/builtin_type_macros.h              | 10 ++++++++
>  src/compiler/glsl/ast_to_hir.cpp                |  2 ++
>  src/compiler/glsl/ir_clone.cpp                  |  2 ++
>  src/compiler/glsl/link_uniform_initializers.cpp |  2 ++
>  src/compiler/glsl_types.cpp                     | 33
> +++++++++++++++++++++++++
>  src/compiler/glsl_types.h                       |  4 +++
>  src/compiler/nir/nir.h                          |  4 +++
>  src/compiler/nir/nir_search.c                   |  2 ++
>  src/compiler/nir_types.cpp                      | 12 +++++++++
>  src/compiler/nir_types.h                        |  6 +++++
>  src/compiler/spirv/spirv_to_nir.c               | 24 ++++++++++++++++++
>  src/compiler/spirv/vtn_variables.c              | 14 +++++++++++
>  src/intel/compiler/brw_fs.cpp                   |  3 +++
>  src/intel/compiler/brw_shader.cpp               |  4 +++
>  src/intel/compiler/brw_vec4_visitor.cpp         |  2 ++
>  src/mesa/program/ir_to_mesa.cpp                 |  4 +++
>  src/mesa/state_tracker/st_glsl_types.cpp        |  2 ++
>  17 files changed, 130 insertions(+)
>
> diff --git a/src/compiler/builtin_type_macros.h
> b/src/compiler/builtin_type_macros.h
> index e3a1cd29c87..807691824d3 100644
> --- a/src/compiler/builtin_type_macros.h
> +++ b/src/compiler/builtin_type_macros.h
> @@ -114,6 +114,16 @@ 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(int8_t,   GL_INT8_NV,      GLSL_TYPE_INT8, 1, 1)
> +DECL_TYPE(i8vec2,   GL_INT8_VEC2_NV, GLSL_TYPE_INT8, 2, 1)
> +DECL_TYPE(i8vec3,   GL_INT8_VEC3_NV, GLSL_TYPE_INT8, 3, 1)
> +DECL_TYPE(i8vec4,   GL_INT8_VEC4_NV, GLSL_TYPE_INT8, 4, 1)
> +
> +DECL_TYPE(uint8_t,  GL_UNSIGNED_INT8_NV,      GLSL_TYPE_UINT8, 1, 1)
> +DECL_TYPE(u8vec2,   GL_UNSIGNED_INT8_VEC2_NV, GLSL_TYPE_UINT8, 2, 1)
> +DECL_TYPE(u8vec3,   GL_UNSIGNED_INT8_VEC3_NV, GLSL_TYPE_UINT8, 3, 1)
> +DECL_TYPE(u8vec4,   GL_UNSIGNED_INT8_VEC4_NV, GLSL_TYPE_UINT8, 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 41e74815f31..815e571097c 100644
> --- a/src/compiler/glsl/ast_to_hir.cpp
> +++ b/src/compiler/glsl/ast_to_hir.cpp
> @@ -1117,6 +1117,8 @@ do_comparison(void *mem_ctx, int operation,
> ir_rvalue *op0, ir_rvalue *op1)
>     case GLSL_TYPE_INT64:
>     case GLSL_TYPE_UINT16:
>     case GLSL_TYPE_INT16:
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
>        return new(mem_ctx) ir_expression(operation, op0, op1);
>
>     case GLSL_TYPE_ARRAY: {
> diff --git a/src/compiler/glsl/ir_clone.cpp b/src/compiler/glsl/ir_clone.
> cpp
> index f088b6aebd5..69441fae7de 100644
> --- a/src/compiler/glsl/ir_clone.cpp
> +++ b/src/compiler/glsl/ir_clone.cpp
> @@ -344,6 +344,8 @@ ir_constant::clone(void *mem_ctx, struct hash_table
> *ht) const
>     case GLSL_TYPE_INT64:
>     case GLSL_TYPE_UINT16:
>     case GLSL_TYPE_INT16:
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
>     case GLSL_TYPE_SAMPLER:
>     case GLSL_TYPE_IMAGE:
>        return new(mem_ctx) ir_constant(this->type, &this->value);
> diff --git a/src/compiler/glsl/link_uniform_initializers.cpp
> b/src/compiler/glsl/link_uniform_initializers.cpp
> index 35522f76467..d6d63bd61fc 100644
> --- a/src/compiler/glsl/link_uniform_initializers.cpp
> +++ b/src/compiler/glsl/link_uniform_initializers.cpp
> @@ -83,6 +83,8 @@ copy_constant_to_storage(union gl_constant_value
> *storage,
>        case GLSL_TYPE_ERROR:
>        case GLSL_TYPE_UINT16:
>        case GLSL_TYPE_INT16:
> +      case GLSL_TYPE_UINT8:
> +      case GLSL_TYPE_INT8:
>        case GLSL_TYPE_FLOAT16:
>           /* All other types should have already been filtered by other
>            * paths in the caller.
> diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
> index 3cc5eb0495c..b1438300746 100644
> --- a/src/compiler/glsl_types.cpp
> +++ b/src/compiler/glsl_types.cpp
> @@ -623,6 +623,31 @@ glsl_type::u16vec(unsigned components)
>     return ts[components - 1];
>  }
>
> +const glsl_type *
> +glsl_type::i8vec(unsigned components)
> +{
> +   if (components == 0 || components > 4)
> +      return error_type;
> +
> +   static const glsl_type *const ts[] = {
> +      int8_t_type, i8vec2_type, i8vec3_type, i8vec4_type
> +   };
> +   return ts[components - 1];
> +}
> +
> +
> +const glsl_type *
> +glsl_type::u8vec(unsigned components)
> +{
> +   if (components == 0 || components > 4)
> +      return error_type;
> +
> +   static const glsl_type *const ts[] = {
> +      uint8_t_type, u8vec2_type, u8vec3_type, u8vec4_type
> +   };
> +   return ts[components - 1];
> +}
> +
>  const glsl_type *
>  glsl_type::get_instance(unsigned base_type, unsigned rows, unsigned
> columns)
>  {
> @@ -656,6 +681,10 @@ glsl_type::get_instance(unsigned base_type, unsigned
> rows, unsigned columns)
>           return u16vec(rows);
>        case GLSL_TYPE_INT16:
>           return i16vec(rows);
> +      case GLSL_TYPE_UINT8:
> +         return u8vec(rows);
> +      case GLSL_TYPE_INT8:
> +         return i8vec(rows);
>        default:
>           return error_type;
>        }
> @@ -1357,6 +1386,8 @@ glsl_type::component_slots() const
>     switch (this->base_type) {
>     case GLSL_TYPE_UINT:
>     case GLSL_TYPE_INT:
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
>     case GLSL_TYPE_UINT16:
>     case GLSL_TYPE_INT16:
>     case GLSL_TYPE_FLOAT:
> @@ -2058,6 +2089,8 @@ glsl_type::count_attribute_slots(bool
> is_vertex_input) const
>     switch (this->base_type) {
>     case GLSL_TYPE_UINT:
>     case GLSL_TYPE_INT:
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
>     case GLSL_TYPE_UINT16:
>     case GLSL_TYPE_INT16:
>     case GLSL_TYPE_FLOAT:
> diff --git a/src/compiler/glsl_types.h b/src/compiler/glsl_types.h
> index ab0b2637649..224f754c0dd 100644
> --- a/src/compiler/glsl_types.h
> +++ b/src/compiler/glsl_types.h
> @@ -63,6 +63,8 @@ enum glsl_base_type {
>     GLSL_TYPE_FLOAT,
>     GLSL_TYPE_FLOAT16,
>     GLSL_TYPE_DOUBLE,
> +   GLSL_TYPE_UINT8,
> +   GLSL_TYPE_INT8,
>     GLSL_TYPE_UINT16,
>     GLSL_TYPE_INT16,
>     GLSL_TYPE_UINT64,
> @@ -264,6 +266,8 @@ public:
>     static const glsl_type *u64vec(unsigned components);
>     static const glsl_type *i16vec(unsigned components);
>     static const glsl_type *u16vec(unsigned components);
> +   static const glsl_type *i8vec(unsigned components);
> +   static const glsl_type *u8vec(unsigned components);
>     /**@}*/
>
>     /**
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
> index 29181694a35..ce6114424b3 100644
> --- a/src/compiler/nir/nir.h
> +++ b/src/compiler/nir/nir.h
> @@ -735,6 +735,10 @@ nir_get_nir_type_for_glsl_base_type(enum
> glsl_base_type base_type)
>     case GLSL_TYPE_INT16:
>        return nir_type_int16;
>        break;
> +   case GLSL_TYPE_UINT8:
> +      return nir_type_uint8;
> +   case GLSL_TYPE_INT8:
> +      return nir_type_int8;
>     case GLSL_TYPE_UINT64:
>        return nir_type_uint64;
>        break;
> diff --git a/src/compiler/nir/nir_search.c b/src/compiler/nir/nir_search.c
> index dec56fee747..dda7878b372 100644
> --- a/src/compiler/nir/nir_search.c
> +++ b/src/compiler/nir/nir_search.c
> @@ -213,6 +213,8 @@ match_value(const nir_search_value *value,
> nir_alu_instr *instr, unsigned src,
>        case nir_type_uint:
>        case nir_type_bool32:
>           switch (load->def.bit_size) {
> +         case 8:
> +         case 16:
>

This is wrong.  We need to do different things for 8 and 16.  I found
another broken case above for fp16.  I'll send a patch.

Other than that, I don't see anything amiss.  There may be something
missing but I double-checked nir_constant_expressions and it should be
doing 8-bit correctly already.  Assuming you rebase on my nir_search patch,
this patch is

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>


>           case 32:
>              for (unsigned i = 0; i < num_components; ++i) {
>                 if (load->value.u32[new_swizzle[i]] !=
> diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp
> index 0085a19248a..718cec5e032 100644
> --- a/src/compiler/nir_types.cpp
> +++ b/src/compiler/nir_types.cpp
> @@ -351,6 +351,18 @@ glsl_uint16_t_type(void)
>     return glsl_type::uint16_t_type;
>  }
>
> +const glsl_type *
> +glsl_int8_t_type(void)
> +{
> +   return glsl_type::int8_t_type;
> +}
> +
> +const glsl_type *
> +glsl_uint8_t_type(void)
> +{
> +   return glsl_type::uint8_t_type;
> +}
> +
>  const glsl_type *
>  glsl_bool_type(void)
>  {
> diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h
> index 5b5e09d137f..b2a51c6df5d 100644
> --- a/src/compiler/nir_types.h
> +++ b/src/compiler/nir_types.h
> @@ -103,6 +103,10 @@ glsl_get_bit_size(const struct glsl_type *type)
>     case GLSL_TYPE_INT16:
>        return 16;
>
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
> +      return 8;
> +
>     case GLSL_TYPE_DOUBLE:
>     case GLSL_TYPE_INT64:
>     case GLSL_TYPE_UINT64:
> @@ -149,6 +153,8 @@ const struct glsl_type *glsl_int64_t_type(void);
>  const struct glsl_type *glsl_uint64_t_type(void);
>  const struct glsl_type *glsl_int16_t_type(void);
>  const struct glsl_type *glsl_uint16_t_type(void);
> +const struct glsl_type *glsl_int8_t_type(void);
> +const struct glsl_type *glsl_uint8_t_type(void);
>  const struct glsl_type *glsl_bool_type(void);
>
>  const struct glsl_type *glsl_scalar_type(enum glsl_base_type base_type);
> diff --git a/src/compiler/spirv/spirv_to_nir.c
> b/src/compiler/spirv/spirv_to_nir.c
> index b9e5198e7bc..2f261fbadd7 100644
> --- a/src/compiler/spirv/spirv_to_nir.c
> +++ b/src/compiler/spirv/spirv_to_nir.c
> @@ -207,6 +207,8 @@ vtn_const_ssa_value(struct vtn_builder *b,
> nir_constant *constant,
>     case GLSL_TYPE_UINT:
>     case GLSL_TYPE_INT16:
>     case GLSL_TYPE_UINT16:
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
>     case GLSL_TYPE_INT64:
>     case GLSL_TYPE_UINT64:
>     case GLSL_TYPE_BOOL:
> @@ -1007,6 +1009,9 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
>        case 16:
>           val->type->type = (signedness ? glsl_int16_t_type() :
> glsl_uint16_t_type());
>           break;
> +      case 8:
> +         val->type->type = (signedness ? glsl_int8_t_type() :
> glsl_uint8_t_type());
> +         break;
>        default:
>           vtn_fail("Invalid int bit size");
>        }
> @@ -1281,6 +1286,8 @@ vtn_null_constant(struct vtn_builder *b, const
> struct glsl_type *type)
>     case GLSL_TYPE_UINT:
>     case GLSL_TYPE_INT16:
>     case GLSL_TYPE_UINT16:
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
>     case GLSL_TYPE_INT64:
>     case GLSL_TYPE_UINT64:
>     case GLSL_TYPE_BOOL:
> @@ -1420,6 +1427,9 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp
> opcode,
>        case 16:
>           val->constant->values->u16[0] = w[3];
>           break;
> +      case 8:
> +         val->constant->values->u8[0] = w[3];
> +         break;
>        default:
>           vtn_fail("Unsupported SpvOpConstant bit size");
>        }
> @@ -1442,6 +1452,9 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp
> opcode,
>        case 16:
>           val->constant->values[0].u16[0] = get_specialization(b, val,
> w[3]);
>           break;
> +      case 8:
> +         val->constant->values[0].u8[0] = get_specialization(b, val,
> w[3]);
> +         break;
>        default:
>           vtn_fail("Unsupported SpvOpSpecConstant bit size");
>        }
> @@ -1474,6 +1487,9 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp
> opcode,
>              case 16:
>                 val->constant->values[0].u16[i] =
> elems[i]->values[0].u16[0];
>                 break;
> +            case 8:
> +               val->constant->values[0].u8[i] = elems[i]->values[0].u8[0];
> +               break;
>              default:
>                 vtn_fail("Invalid SpvOpConstantComposite bit size");
>              }
> @@ -1644,6 +1660,9 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp
> opcode,
>                    case 16:
>                       val->constant->values[0].u16[i] =
> (*c)->values[col].u16[elem + i];
>                       break;
> +                  case 8:
> +                     val->constant->values[0].u8[i] =
> (*c)->values[col].u8[elem + i];
> +                     break;
>                    default:
>                       vtn_fail("Invalid SpvOpCompositeExtract bit size");
>                    }
> @@ -1668,6 +1687,9 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp
> opcode,
>                    case 16:
>                       (*c)->values[col].u16[elem + i] =
> insert->constant->values[0].u16[i];
>                       break;
> +                  case 8:
> +                     (*c)->values[col].u8[elem + i] =
> insert->constant->values[0].u8[i];
> +                     break;
>                    default:
>                       vtn_fail("Invalid SpvOpCompositeInsert bit size");
>                    }
> @@ -1802,6 +1824,8 @@ vtn_create_ssa_value(struct vtn_builder *b, const
> struct glsl_type *type)
>           case GLSL_TYPE_UINT:
>           case GLSL_TYPE_INT16:
>           case GLSL_TYPE_UINT16:
> +         case GLSL_TYPE_UINT8:
> +         case GLSL_TYPE_INT8:
>           case GLSL_TYPE_INT64:
>           case GLSL_TYPE_UINT64:
>           case GLSL_TYPE_BOOL:
> diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_
> variables.c
> index 9680d074131..b156451b3ec 100644
> --- a/src/compiler/spirv/vtn_variables.c
> +++ b/src/compiler/spirv/vtn_variables.c
> @@ -297,6 +297,8 @@ vtn_ssa_offset_pointer_dereference(struct vtn_builder
> *b,
>        case GLSL_TYPE_INT:
>        case GLSL_TYPE_UINT16:
>        case GLSL_TYPE_INT16:
> +      case GLSL_TYPE_UINT8:
> +      case GLSL_TYPE_INT8:
>        case GLSL_TYPE_UINT64:
>        case GLSL_TYPE_INT64:
>        case GLSL_TYPE_FLOAT:
> @@ -413,6 +415,8 @@ vtn_pointer_to_deref(struct vtn_builder *b, struct
> vtn_pointer *ptr)
>        case GLSL_TYPE_INT:
>        case GLSL_TYPE_UINT16:
>        case GLSL_TYPE_INT16:
> +      case GLSL_TYPE_UINT8:
> +      case GLSL_TYPE_INT8:
>        case GLSL_TYPE_UINT64:
>        case GLSL_TYPE_INT64:
>        case GLSL_TYPE_FLOAT:
> @@ -624,6 +628,8 @@ vtn_pointer_to_offset(struct vtn_builder *b, struct
> vtn_pointer *ptr,
>           case GLSL_TYPE_INT:
>           case GLSL_TYPE_UINT16:
>           case GLSL_TYPE_INT16:
> +         case GLSL_TYPE_UINT8:
> +         case GLSL_TYPE_INT8:
>           case GLSL_TYPE_UINT64:
>           case GLSL_TYPE_INT64:
>           case GLSL_TYPE_FLOAT:
> @@ -672,6 +678,8 @@ vtn_type_block_size(struct vtn_builder *b, struct
> vtn_type *type)
>     case GLSL_TYPE_INT:
>     case GLSL_TYPE_UINT16:
>     case GLSL_TYPE_INT16:
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
>     case GLSL_TYPE_UINT64:
>     case GLSL_TYPE_INT64:
>     case GLSL_TYPE_FLOAT:
> @@ -807,6 +815,8 @@ _vtn_block_load_store(struct vtn_builder *b,
> nir_intrinsic_op op, bool load,
>     case GLSL_TYPE_INT:
>     case GLSL_TYPE_UINT16:
>     case GLSL_TYPE_INT16:
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
>     case GLSL_TYPE_UINT64:
>     case GLSL_TYPE_INT64:
>     case GLSL_TYPE_FLOAT:
> @@ -992,6 +1002,8 @@ _vtn_variable_load_store(struct vtn_builder *b, bool
> load,
>     case GLSL_TYPE_INT:
>     case GLSL_TYPE_UINT16:
>     case GLSL_TYPE_INT16:
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
>     case GLSL_TYPE_UINT64:
>     case GLSL_TYPE_INT64:
>     case GLSL_TYPE_FLOAT:
> @@ -1076,6 +1088,8 @@ _vtn_variable_copy(struct vtn_builder *b, struct
> vtn_pointer *dest,
>     case GLSL_TYPE_INT:
>     case GLSL_TYPE_UINT16:
>     case GLSL_TYPE_INT16:
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
>     case GLSL_TYPE_UINT64:
>     case GLSL_TYPE_INT64:
>     case GLSL_TYPE_FLOAT:
> diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
> index bed632d21b9..cde63b89e86 100644
> --- a/src/intel/compiler/brw_fs.cpp
> +++ b/src/intel/compiler/brw_fs.cpp
> @@ -467,6 +467,9 @@ type_size_scalar(const struct glsl_type *type)
>     case GLSL_TYPE_INT16:
>     case GLSL_TYPE_FLOAT16:
>        return DIV_ROUND_UP(type->components(), 2);
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
> +      return DIV_ROUND_UP(type->components(), 4);
>     case GLSL_TYPE_DOUBLE:
>     case GLSL_TYPE_UINT64:
>     case GLSL_TYPE_INT64:
> diff --git a/src/intel/compiler/brw_shader.cpp b/src/intel/compiler/brw_
> shader.cpp
> index 1df4f35cd8e..9aeea7276d7 100644
> --- a/src/intel/compiler/brw_shader.cpp
> +++ b/src/intel/compiler/brw_shader.cpp
> @@ -44,10 +44,14 @@ brw_type_for_base_type(const struct glsl_type *type)
>        return BRW_REGISTER_TYPE_D;
>     case GLSL_TYPE_INT16:
>        return BRW_REGISTER_TYPE_W;
> +   case GLSL_TYPE_INT8:
> +      return BRW_REGISTER_TYPE_B;
>     case GLSL_TYPE_UINT:
>        return BRW_REGISTER_TYPE_UD;
>     case GLSL_TYPE_UINT16:
>        return BRW_REGISTER_TYPE_UW;
> +   case GLSL_TYPE_UINT8:
> +      return BRW_REGISTER_TYPE_UB;
>     case GLSL_TYPE_ARRAY:
>        return brw_type_for_base_type(type->fields.array);
>     case GLSL_TYPE_STRUCT:
> diff --git a/src/intel/compiler/brw_vec4_visitor.cpp
> b/src/intel/compiler/brw_vec4_visitor.cpp
> index 53f6a5ed546..cea6a85ff10 100644
> --- a/src/intel/compiler/brw_vec4_visitor.cpp
> +++ b/src/intel/compiler/brw_vec4_visitor.cpp
> @@ -589,6 +589,8 @@ type_size_xvec4(const struct glsl_type *type, bool
> as_vec4)
>     case GLSL_TYPE_DOUBLE:
>     case GLSL_TYPE_UINT16:
>     case GLSL_TYPE_INT16:
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
>     case GLSL_TYPE_UINT64:
>     case GLSL_TYPE_INT64:
>        if (type->is_matrix()) {
> diff --git a/src/mesa/program/ir_to_mesa.cpp
> b/src/mesa/program/ir_to_mesa.cpp
> index 74089605029..29025d1c177 100644
> --- a/src/mesa/program/ir_to_mesa.cpp
> +++ b/src/mesa/program/ir_to_mesa.cpp
> @@ -506,6 +506,8 @@ storage_type_size(const struct glsl_type *type, bool
> bindless)
>     switch (type->base_type) {
>     case GLSL_TYPE_UINT:
>     case GLSL_TYPE_INT:
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
>     case GLSL_TYPE_UINT16:
>     case GLSL_TYPE_INT16:
>     case GLSL_TYPE_FLOAT:
> @@ -2534,6 +2536,7 @@ _mesa_associate_uniform_storage(struct gl_context
> *ctx,
>              /* fallthrough */
>           case GLSL_TYPE_UINT:
>           case GLSL_TYPE_UINT16:
> +         case GLSL_TYPE_UINT8:
>              assert(ctx->Const.NativeIntegers);
>              format = uniform_native;
>              columns = 1;
> @@ -2544,6 +2547,7 @@ _mesa_associate_uniform_storage(struct gl_context
> *ctx,
>              /* fallthrough */
>           case GLSL_TYPE_INT:
>           case GLSL_TYPE_INT16:
> +         case GLSL_TYPE_INT8:
>              format =
>                 (ctx->Const.NativeIntegers) ? uniform_native :
> uniform_int_float;
>              columns = 1;
> diff --git a/src/mesa/state_tracker/st_glsl_types.cpp
> b/src/mesa/state_tracker/st_glsl_types.cpp
> index e57fbc8f314..d4d2139d9da 100644
> --- a/src/mesa/state_tracker/st_glsl_types.cpp
> +++ b/src/mesa/state_tracker/st_glsl_types.cpp
> @@ -101,6 +101,8 @@ st_glsl_storage_type_size(const struct glsl_type
> *type, bool is_bindless)
>     case GLSL_TYPE_FLOAT16:
>     case GLSL_TYPE_UINT16:
>     case GLSL_TYPE_INT16:
> +   case GLSL_TYPE_UINT8:
> +   case GLSL_TYPE_INT8:
>        assert(!"Invalid type in type_size");
>        break;
>     }
> --
> 2.14.3
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180228/d0f001ef/attachment-0001.html>


More information about the mesa-dev mailing list