compiler: int8/uint8 support

OpenCL kernels also have int8/uint8.

v2: remove changes in nir_search as Jason posted a patch for that

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
This commit is contained in:
Karol Herbst
2018-01-25 07:59:06 -05:00
committed by Rob Clark
parent fcf267ba08
commit b617bfcccf
16 changed files with 128 additions and 0 deletions

View File

@@ -483,6 +483,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:

View File

@@ -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:

View File

@@ -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()) {