<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 28, 2018 at 11:51 AM, Rob Clark <span dir="ltr"><<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Karol Herbst <<a href="mailto:kherbst@redhat.com">kherbst@redhat.com</a>><br>
<br>
OpenCL kernels also have int8/uint8.<br>
<br>
Signed-off-by: Rob Clark <<a href="mailto:robdclark@gmail.com">robdclark@gmail.com</a>><br>
---<br>
src/compiler/builtin_type_<wbr>macros.h | 10 ++++++++<br>
src/compiler/glsl/ast_to_hir.<wbr>cpp | 2 ++<br>
src/compiler/glsl/ir_clone.cpp | 2 ++<br>
src/compiler/glsl/link_<wbr>uniform_initializers.cpp | 2 ++<br>
src/compiler/glsl_types.cpp | 33 +++++++++++++++++++++++++<br>
src/compiler/glsl_types.h | 4 +++<br>
src/compiler/nir/nir.h | 4 +++<br>
src/compiler/nir/nir_search.c | 2 ++<br>
src/compiler/nir_types.cpp | 12 +++++++++<br>
src/compiler/nir_types.h | 6 +++++<br>
src/compiler/spirv/spirv_to_<wbr>nir.c | 24 ++++++++++++++++++<br>
src/compiler/spirv/vtn_<wbr>variables.c | 14 +++++++++++<br>
src/intel/compiler/brw_fs.cpp | 3 +++<br>
src/intel/compiler/brw_shader.<wbr>cpp | 4 +++<br>
src/intel/compiler/brw_vec4_<wbr>visitor.cpp | 2 ++<br>
src/mesa/program/ir_to_mesa.<wbr>cpp | 4 +++<br>
src/mesa/state_tracker/st_<wbr>glsl_types.cpp | 2 ++<br>
17 files changed, 130 insertions(+)<br>
<br>
diff --git a/src/compiler/builtin_type_<wbr>macros.h b/src/compiler/builtin_type_<wbr>macros.h<br>
index e3a1cd29c87..807691824d3 100644<br>
--- a/src/compiler/builtin_type_<wbr>macros.h<br>
+++ b/src/compiler/builtin_type_<wbr>macros.h<br>
@@ -114,6 +114,16 @@ DECL_TYPE(u16vec2, GL_UNSIGNED_INT16_VEC2_NV, GLSL_TYPE_UINT16, 2, 1)<br>
DECL_TYPE(u16vec3, GL_UNSIGNED_INT16_VEC3_NV, GLSL_TYPE_UINT16, 3, 1)<br>
DECL_TYPE(u16vec4, GL_UNSIGNED_INT16_VEC4_NV, GLSL_TYPE_UINT16, 4, 1)<br>
<br>
+DECL_TYPE(int8_t, GL_INT8_NV, GLSL_TYPE_INT8, 1, 1)<br>
+DECL_TYPE(i8vec2, GL_INT8_VEC2_NV, GLSL_TYPE_INT8, 2, 1)<br>
+DECL_TYPE(i8vec3, GL_INT8_VEC3_NV, GLSL_TYPE_INT8, 3, 1)<br>
+DECL_TYPE(i8vec4, GL_INT8_VEC4_NV, GLSL_TYPE_INT8, 4, 1)<br>
+<br>
+DECL_TYPE(uint8_t, GL_UNSIGNED_INT8_NV, GLSL_TYPE_UINT8, 1, 1)<br>
+DECL_TYPE(u8vec2, GL_UNSIGNED_INT8_VEC2_NV, GLSL_TYPE_UINT8, 2, 1)<br>
+DECL_TYPE(u8vec3, GL_UNSIGNED_INT8_VEC3_NV, GLSL_TYPE_UINT8, 3, 1)<br>
+DECL_TYPE(u8vec4, GL_UNSIGNED_INT8_VEC4_NV, GLSL_TYPE_UINT8, 4, 1)<br>
+<br>
DECL_TYPE(sampler, GL_SAMPLER_1D, GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_VOID)<br>
DECL_TYPE(sampler1D, GL_SAMPLER_1D, GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_FLOAT)<br>
DECL_TYPE(sampler2D, GL_SAMPLER_2D, GLSL_TYPE_SAMPLER, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_FLOAT)<br>
diff --git a/src/compiler/glsl/ast_to_<wbr>hir.cpp b/src/compiler/glsl/ast_to_<wbr>hir.cpp<br>
index 41e74815f31..815e571097c 100644<br>
--- a/src/compiler/glsl/ast_to_<wbr>hir.cpp<br>
+++ b/src/compiler/glsl/ast_to_<wbr>hir.cpp<br>
@@ -1117,6 +1117,8 @@ do_comparison(void *mem_ctx, int operation, ir_rvalue *op0, ir_rvalue *op1)<br>
case GLSL_TYPE_INT64:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
return new(mem_ctx) ir_expression(operation, op0, op1);<br>
<br>
case GLSL_TYPE_ARRAY: {<br>
diff --git a/src/compiler/glsl/ir_clone.<wbr>cpp b/src/compiler/glsl/ir_clone.<wbr>cpp<br>
index f088b6aebd5..69441fae7de 100644<br>
--- a/src/compiler/glsl/ir_clone.<wbr>cpp<br>
+++ b/src/compiler/glsl/ir_clone.<wbr>cpp<br>
@@ -344,6 +344,8 @@ ir_constant::clone(void *mem_ctx, struct hash_table *ht) const<br>
case GLSL_TYPE_INT64:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_SAMPLER:<br>
case GLSL_TYPE_IMAGE:<br>
return new(mem_ctx) ir_constant(this->type, &this->value);<br>
diff --git a/src/compiler/glsl/link_<wbr>uniform_initializers.cpp b/src/compiler/glsl/link_<wbr>uniform_initializers.cpp<br>
index 35522f76467..d6d63bd61fc 100644<br>
--- a/src/compiler/glsl/link_<wbr>uniform_initializers.cpp<br>
+++ b/src/compiler/glsl/link_<wbr>uniform_initializers.cpp<br>
@@ -83,6 +83,8 @@ copy_constant_to_storage(union gl_constant_value *storage,<br>
case GLSL_TYPE_ERROR:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_FLOAT16:<br>
/* All other types should have already been filtered by other<br>
* paths in the caller.<br>
diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp<br>
index 3cc5eb0495c..b1438300746 100644<br>
--- a/src/compiler/glsl_types.cpp<br>
+++ b/src/compiler/glsl_types.cpp<br>
@@ -623,6 +623,31 @@ glsl_type::u16vec(unsigned components)<br>
return ts[components - 1];<br>
}<br>
<br>
+const glsl_type *<br>
+glsl_type::i8vec(unsigned components)<br>
+{<br>
+ if (components == 0 || components > 4)<br>
+ return error_type;<br>
+<br>
+ static const glsl_type *const ts[] = {<br>
+ int8_t_type, i8vec2_type, i8vec3_type, i8vec4_type<br>
+ };<br>
+ return ts[components - 1];<br>
+}<br>
+<br>
+<br>
+const glsl_type *<br>
+glsl_type::u8vec(unsigned components)<br>
+{<br>
+ if (components == 0 || components > 4)<br>
+ return error_type;<br>
+<br>
+ static const glsl_type *const ts[] = {<br>
+ uint8_t_type, u8vec2_type, u8vec3_type, u8vec4_type<br>
+ };<br>
+ return ts[components - 1];<br>
+}<br>
+<br>
const glsl_type *<br>
glsl_type::get_instance(<wbr>unsigned base_type, unsigned rows, unsigned columns)<br>
{<br>
@@ -656,6 +681,10 @@ glsl_type::get_instance(<wbr>unsigned base_type, unsigned rows, unsigned columns)<br>
return u16vec(rows);<br>
case GLSL_TYPE_INT16:<br>
return i16vec(rows);<br>
+ case GLSL_TYPE_UINT8:<br>
+ return u8vec(rows);<br>
+ case GLSL_TYPE_INT8:<br>
+ return i8vec(rows);<br>
default:<br>
return error_type;<br>
}<br>
@@ -1357,6 +1386,8 @@ glsl_type::component_slots() const<br>
switch (this->base_type) {<br>
case GLSL_TYPE_UINT:<br>
case GLSL_TYPE_INT:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
case GLSL_TYPE_FLOAT:<br>
@@ -2058,6 +2089,8 @@ glsl_type::count_attribute_<wbr>slots(bool is_vertex_input) const<br>
switch (this->base_type) {<br>
case GLSL_TYPE_UINT:<br>
case GLSL_TYPE_INT:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
case GLSL_TYPE_FLOAT:<br>
diff --git a/src/compiler/glsl_types.h b/src/compiler/glsl_types.h<br>
index ab0b2637649..224f754c0dd 100644<br>
--- a/src/compiler/glsl_types.h<br>
+++ b/src/compiler/glsl_types.h<br>
@@ -63,6 +63,8 @@ enum glsl_base_type {<br>
GLSL_TYPE_FLOAT,<br>
GLSL_TYPE_FLOAT16,<br>
GLSL_TYPE_DOUBLE,<br>
+ GLSL_TYPE_UINT8,<br>
+ GLSL_TYPE_INT8,<br>
GLSL_TYPE_UINT16,<br>
GLSL_TYPE_INT16,<br>
GLSL_TYPE_UINT64,<br>
@@ -264,6 +266,8 @@ public:<br>
static const glsl_type *u64vec(unsigned components);<br>
static const glsl_type *i16vec(unsigned components);<br>
static const glsl_type *u16vec(unsigned components);<br>
+ static const glsl_type *i8vec(unsigned components);<br>
+ static const glsl_type *u8vec(unsigned components);<br>
/**@}*/<br>
<br>
/**<br>
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h<br>
index 29181694a35..ce6114424b3 100644<br>
--- a/src/compiler/nir/nir.h<br>
+++ b/src/compiler/nir/nir.h<br>
@@ -735,6 +735,10 @@ nir_get_nir_type_for_glsl_<wbr>base_type(enum glsl_base_type base_type)<br>
case GLSL_TYPE_INT16:<br>
return nir_type_int16;<br>
break;<br>
+ case GLSL_TYPE_UINT8:<br>
+ return nir_type_uint8;<br>
+ case GLSL_TYPE_INT8:<br>
+ return nir_type_int8;<br>
case GLSL_TYPE_UINT64:<br>
return nir_type_uint64;<br>
break;<br>
diff --git a/src/compiler/nir/nir_search.<wbr>c b/src/compiler/nir/nir_search.<wbr>c<br>
index dec56fee747..dda7878b372 100644<br>
--- a/src/compiler/nir/nir_search.<wbr>c<br>
+++ b/src/compiler/nir/nir_search.<wbr>c<br>
@@ -213,6 +213,8 @@ match_value(const nir_search_value *value, nir_alu_instr *instr, unsigned src,<br>
case nir_type_uint:<br>
case nir_type_bool32:<br>
switch (load->def.bit_size) {<br>
+ case 8:<br>
+ case 16:<br></blockquote><div><br></div><div>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.<br><br></div><div>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<br><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
case 32:<br>
for (unsigned i = 0; i < num_components; ++i) {<br>
if (load->value.u32[new_swizzle[<wbr>i]] !=<br>
diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp<br>
index 0085a19248a..718cec5e032 100644<br>
--- a/src/compiler/nir_types.cpp<br>
+++ b/src/compiler/nir_types.cpp<br>
@@ -351,6 +351,18 @@ glsl_uint16_t_type(void)<br>
return glsl_type::uint16_t_type;<br>
}<br>
<br>
+const glsl_type *<br>
+glsl_int8_t_type(void)<br>
+{<br>
+ return glsl_type::int8_t_type;<br>
+}<br>
+<br>
+const glsl_type *<br>
+glsl_uint8_t_type(void)<br>
+{<br>
+ return glsl_type::uint8_t_type;<br>
+}<br>
+<br>
const glsl_type *<br>
glsl_bool_type(void)<br>
{<br>
diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h<br>
index 5b5e09d137f..b2a51c6df5d 100644<br>
--- a/src/compiler/nir_types.h<br>
+++ b/src/compiler/nir_types.h<br>
@@ -103,6 +103,10 @@ glsl_get_bit_size(const struct glsl_type *type)<br>
case GLSL_TYPE_INT16:<br>
return 16;<br>
<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
+ return 8;<br>
+<br>
case GLSL_TYPE_DOUBLE:<br>
case GLSL_TYPE_INT64:<br>
case GLSL_TYPE_UINT64:<br>
@@ -149,6 +153,8 @@ const struct glsl_type *glsl_int64_t_type(void);<br>
const struct glsl_type *glsl_uint64_t_type(void);<br>
const struct glsl_type *glsl_int16_t_type(void);<br>
const struct glsl_type *glsl_uint16_t_type(void);<br>
+const struct glsl_type *glsl_int8_t_type(void);<br>
+const struct glsl_type *glsl_uint8_t_type(void);<br>
const struct glsl_type *glsl_bool_type(void);<br>
<br>
const struct glsl_type *glsl_scalar_type(enum glsl_base_type base_type);<br>
diff --git a/src/compiler/spirv/spirv_to_<wbr>nir.c b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
index b9e5198e7bc..2f261fbadd7 100644<br>
--- a/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
+++ b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
@@ -207,6 +207,8 @@ vtn_const_ssa_value(struct vtn_builder *b, nir_constant *constant,<br>
case GLSL_TYPE_UINT:<br>
case GLSL_TYPE_INT16:<br>
case GLSL_TYPE_UINT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_INT64:<br>
case GLSL_TYPE_UINT64:<br>
case GLSL_TYPE_BOOL:<br>
@@ -1007,6 +1009,9 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,<br>
case 16:<br>
val->type->type = (signedness ? glsl_int16_t_type() : glsl_uint16_t_type());<br>
break;<br>
+ case 8:<br>
+ val->type->type = (signedness ? glsl_int8_t_type() : glsl_uint8_t_type());<br>
+ break;<br>
default:<br>
vtn_fail("Invalid int bit size");<br>
}<br>
@@ -1281,6 +1286,8 @@ vtn_null_constant(struct vtn_builder *b, const struct glsl_type *type)<br>
case GLSL_TYPE_UINT:<br>
case GLSL_TYPE_INT16:<br>
case GLSL_TYPE_UINT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_INT64:<br>
case GLSL_TYPE_UINT64:<br>
case GLSL_TYPE_BOOL:<br>
@@ -1420,6 +1427,9 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,<br>
case 16:<br>
val->constant->values->u16[0] = w[3];<br>
break;<br>
+ case 8:<br>
+ val->constant->values->u8[0] = w[3];<br>
+ break;<br>
default:<br>
vtn_fail("Unsupported SpvOpConstant bit size");<br>
}<br>
@@ -1442,6 +1452,9 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,<br>
case 16:<br>
val->constant->values[0].u16[<wbr>0] = get_specialization(b, val, w[3]);<br>
break;<br>
+ case 8:<br>
+ val->constant->values[0].u8[0] = get_specialization(b, val, w[3]);<br>
+ break;<br>
default:<br>
vtn_fail("Unsupported SpvOpSpecConstant bit size");<br>
}<br>
@@ -1474,6 +1487,9 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,<br>
case 16:<br>
val->constant->values[0].u16[<wbr>i] = elems[i]->values[0].u16[0];<br>
break;<br>
+ case 8:<br>
+ val->constant->values[0].u8[i] = elems[i]->values[0].u8[0];<br>
+ break;<br>
default:<br>
vtn_fail("Invalid SpvOpConstantComposite bit size");<br>
}<br>
@@ -1644,6 +1660,9 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,<br>
case 16:<br>
val->constant->values[0].u16[<wbr>i] = (*c)->values[col].u16[elem + i];<br>
break;<br>
+ case 8:<br>
+ val->constant->values[0].u8[i] = (*c)->values[col].u8[elem + i];<br>
+ break;<br>
default:<br>
vtn_fail("Invalid SpvOpCompositeExtract bit size");<br>
}<br>
@@ -1668,6 +1687,9 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,<br>
case 16:<br>
(*c)->values[col].u16[elem + i] = insert->constant->values[0].<wbr>u16[i];<br>
break;<br>
+ case 8:<br>
+ (*c)->values[col].u8[elem + i] = insert->constant->values[0].<wbr>u8[i];<br>
+ break;<br>
default:<br>
vtn_fail("Invalid SpvOpCompositeInsert bit size");<br>
}<br>
@@ -1802,6 +1824,8 @@ vtn_create_ssa_value(struct vtn_builder *b, const struct glsl_type *type)<br>
case GLSL_TYPE_UINT:<br>
case GLSL_TYPE_INT16:<br>
case GLSL_TYPE_UINT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_INT64:<br>
case GLSL_TYPE_UINT64:<br>
case GLSL_TYPE_BOOL:<br>
diff --git a/src/compiler/spirv/vtn_<wbr>variables.c b/src/compiler/spirv/vtn_<wbr>variables.c<br>
index 9680d074131..b156451b3ec 100644<br>
--- a/src/compiler/spirv/vtn_<wbr>variables.c<br>
+++ b/src/compiler/spirv/vtn_<wbr>variables.c<br>
@@ -297,6 +297,8 @@ vtn_ssa_offset_pointer_<wbr>dereference(struct vtn_builder *b,<br>
case GLSL_TYPE_INT:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_UINT64:<br>
case GLSL_TYPE_INT64:<br>
case GLSL_TYPE_FLOAT:<br>
@@ -413,6 +415,8 @@ vtn_pointer_to_deref(struct vtn_builder *b, struct vtn_pointer *ptr)<br>
case GLSL_TYPE_INT:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_UINT64:<br>
case GLSL_TYPE_INT64:<br>
case GLSL_TYPE_FLOAT:<br>
@@ -624,6 +628,8 @@ vtn_pointer_to_offset(struct vtn_builder *b, struct vtn_pointer *ptr,<br>
case GLSL_TYPE_INT:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_UINT64:<br>
case GLSL_TYPE_INT64:<br>
case GLSL_TYPE_FLOAT:<br>
@@ -672,6 +678,8 @@ vtn_type_block_size(struct vtn_builder *b, struct vtn_type *type)<br>
case GLSL_TYPE_INT:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_UINT64:<br>
case GLSL_TYPE_INT64:<br>
case GLSL_TYPE_FLOAT:<br>
@@ -807,6 +815,8 @@ _vtn_block_load_store(struct vtn_builder *b, nir_intrinsic_op op, bool load,<br>
case GLSL_TYPE_INT:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_UINT64:<br>
case GLSL_TYPE_INT64:<br>
case GLSL_TYPE_FLOAT:<br>
@@ -992,6 +1002,8 @@ _vtn_variable_load_store(<wbr>struct vtn_builder *b, bool load,<br>
case GLSL_TYPE_INT:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_UINT64:<br>
case GLSL_TYPE_INT64:<br>
case GLSL_TYPE_FLOAT:<br>
@@ -1076,6 +1088,8 @@ _vtn_variable_copy(struct vtn_builder *b, struct vtn_pointer *dest,<br>
case GLSL_TYPE_INT:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_UINT64:<br>
case GLSL_TYPE_INT64:<br>
case GLSL_TYPE_FLOAT:<br>
diff --git a/src/intel/compiler/brw_fs.<wbr>cpp b/src/intel/compiler/brw_fs.<wbr>cpp<br>
index bed632d21b9..cde63b89e86 100644<br>
--- a/src/intel/compiler/brw_fs.<wbr>cpp<br>
+++ b/src/intel/compiler/brw_fs.<wbr>cpp<br>
@@ -467,6 +467,9 @@ type_size_scalar(const struct glsl_type *type)<br>
case GLSL_TYPE_INT16:<br>
case GLSL_TYPE_FLOAT16:<br>
return DIV_ROUND_UP(type->components(<wbr>), 2);<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
+ return DIV_ROUND_UP(type->components(<wbr>), 4);<br>
case GLSL_TYPE_DOUBLE:<br>
case GLSL_TYPE_UINT64:<br>
case GLSL_TYPE_INT64:<br>
diff --git a/src/intel/compiler/brw_<wbr>shader.cpp b/src/intel/compiler/brw_<wbr>shader.cpp<br>
index 1df4f35cd8e..9aeea7276d7 100644<br>
--- a/src/intel/compiler/brw_<wbr>shader.cpp<br>
+++ b/src/intel/compiler/brw_<wbr>shader.cpp<br>
@@ -44,10 +44,14 @@ brw_type_for_base_type(const struct glsl_type *type)<br>
return BRW_REGISTER_TYPE_D;<br>
case GLSL_TYPE_INT16:<br>
return BRW_REGISTER_TYPE_W;<br>
+ case GLSL_TYPE_INT8:<br>
+ return BRW_REGISTER_TYPE_B;<br>
case GLSL_TYPE_UINT:<br>
return BRW_REGISTER_TYPE_UD;<br>
case GLSL_TYPE_UINT16:<br>
return BRW_REGISTER_TYPE_UW;<br>
+ case GLSL_TYPE_UINT8:<br>
+ return BRW_REGISTER_TYPE_UB;<br>
case GLSL_TYPE_ARRAY:<br>
return brw_type_for_base_type(type-><wbr>fields.array);<br>
case GLSL_TYPE_STRUCT:<br>
diff --git a/src/intel/compiler/brw_vec4_<wbr>visitor.cpp b/src/intel/compiler/brw_vec4_<wbr>visitor.cpp<br>
index 53f6a5ed546..cea6a85ff10 100644<br>
--- a/src/intel/compiler/brw_vec4_<wbr>visitor.cpp<br>
+++ b/src/intel/compiler/brw_vec4_<wbr>visitor.cpp<br>
@@ -589,6 +589,8 @@ type_size_xvec4(const struct glsl_type *type, bool as_vec4)<br>
case GLSL_TYPE_DOUBLE:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_UINT64:<br>
case GLSL_TYPE_INT64:<br>
if (type->is_matrix()) {<br>
diff --git a/src/mesa/program/ir_to_mesa.<wbr>cpp b/src/mesa/program/ir_to_mesa.<wbr>cpp<br>
index 74089605029..29025d1c177 100644<br>
--- a/src/mesa/program/ir_to_mesa.<wbr>cpp<br>
+++ b/src/mesa/program/ir_to_mesa.<wbr>cpp<br>
@@ -506,6 +506,8 @@ storage_type_size(const struct glsl_type *type, bool bindless)<br>
switch (type->base_type) {<br>
case GLSL_TYPE_UINT:<br>
case GLSL_TYPE_INT:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
case GLSL_TYPE_FLOAT:<br>
@@ -2534,6 +2536,7 @@ _mesa_associate_uniform_<wbr>storage(struct gl_context *ctx,<br>
/* fallthrough */<br>
case GLSL_TYPE_UINT:<br>
case GLSL_TYPE_UINT16:<br>
+ case GLSL_TYPE_UINT8:<br>
assert(ctx->Const.<wbr>NativeIntegers);<br>
format = uniform_native;<br>
columns = 1;<br>
@@ -2544,6 +2547,7 @@ _mesa_associate_uniform_<wbr>storage(struct gl_context *ctx,<br>
/* fallthrough */<br>
case GLSL_TYPE_INT:<br>
case GLSL_TYPE_INT16:<br>
+ case GLSL_TYPE_INT8:<br>
format =<br>
(ctx->Const.NativeIntegers) ? uniform_native : uniform_int_float;<br>
columns = 1;<br>
diff --git a/src/mesa/state_tracker/st_<wbr>glsl_types.cpp b/src/mesa/state_tracker/st_<wbr>glsl_types.cpp<br>
index e57fbc8f314..d4d2139d9da 100644<br>
--- a/src/mesa/state_tracker/st_<wbr>glsl_types.cpp<br>
+++ b/src/mesa/state_tracker/st_<wbr>glsl_types.cpp<br>
@@ -101,6 +101,8 @@ st_glsl_storage_type_size(<wbr>const struct glsl_type *type, bool is_bindless)<br>
case GLSL_TYPE_FLOAT16:<br>
case GLSL_TYPE_UINT16:<br>
case GLSL_TYPE_INT16:<br>
+ case GLSL_TYPE_UINT8:<br>
+ case GLSL_TYPE_INT8:<br>
assert(!"Invalid type in type_size");<br>
break;<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.14.3<br>
<br>
</font></span></blockquote></div><br></div></div>