[Mesa-dev] [PATCH 13/45] i965/fs: Handle 16-bit base types in helper functions
Alejandro PiƱeiro
apinheiro at igalia.com
Thu Jul 13 14:35:17 UTC 2017
From: Eduardo Lima Mitev <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:
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
More information about the mesa-dev
mailing list