[Mesa-dev] [PATCH v2 1/3] i965/fs: Add basic support for double-precision floating-point types for Gen7+

Darius Goad alegend45 at gmail.com
Sat Apr 11 10:57:06 PDT 2015


---
 src/mesa/drivers/dri/i965/brw_fs.cpp           | 2 +-
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp   | 4 ++--
 src/mesa/drivers/dri/i965/brw_shader.cpp       | 3 ++-
 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 1 +
 4 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index a57f501..0171b9d 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -647,6 +647,7 @@ fs_visitor::type_size(const struct glsl_type *type)
    case GLSL_TYPE_INT:
    case GLSL_TYPE_FLOAT:
    case GLSL_TYPE_BOOL:
+   case GLSL_TYPE_DOUBLE:
       return type->components();
    case GLSL_TYPE_ARRAY:
       return type_size(type->fields.array) * type->length;
@@ -667,7 +668,6 @@ fs_visitor::type_size(const struct glsl_type *type)
    case GLSL_TYPE_VOID:
    case GLSL_TYPE_ERROR:
    case GLSL_TYPE_INTERFACE:
-   case GLSL_TYPE_DOUBLE:
       unreachable("not reached");
    }
 
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index e6fb0cb..f9fc535 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -1298,6 +1298,7 @@ fs_visitor::emit_assignment_writes(fs_reg &l, fs_reg &r,
 				   const glsl_type *type, bool predicated)
 {
    switch (type->base_type) {
+   case GLSL_TYPE_DOUBLE:
    case GLSL_TYPE_FLOAT:
    case GLSL_TYPE_UINT:
    case GLSL_TYPE_INT:
@@ -1332,8 +1333,7 @@ fs_visitor::emit_assignment_writes(fs_reg &l, fs_reg &r,
    case GLSL_TYPE_IMAGE:
    case GLSL_TYPE_ATOMIC_UINT:
       break;
-
-   case GLSL_TYPE_DOUBLE:
+   
    case GLSL_TYPE_VOID:
    case GLSL_TYPE_ERROR:
    case GLSL_TYPE_INTERFACE:
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index 0dda9bb..7a5f7978 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -286,6 +286,8 @@ brw_type_for_base_type(const struct glsl_type *type)
    switch (type->base_type) {
    case GLSL_TYPE_FLOAT:
       return BRW_REGISTER_TYPE_F;
+   case GLSL_TYPE_DOUBLE:
+      return BRW_REGISTER_TYPE_DF;
    case GLSL_TYPE_INT:
    case GLSL_TYPE_BOOL:
       return BRW_REGISTER_TYPE_D;
@@ -306,7 +308,6 @@ brw_type_for_base_type(const struct glsl_type *type)
    case GLSL_TYPE_VOID:
    case GLSL_TYPE_ERROR:
    case GLSL_TYPE_INTERFACE:
-   case GLSL_TYPE_DOUBLE:
       unreachable("not reached");
    }
 
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 26a3b9f..8dff19a 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -583,6 +583,7 @@ type_size(const struct glsl_type *type)
    case GLSL_TYPE_UINT:
    case GLSL_TYPE_INT:
    case GLSL_TYPE_FLOAT:
+   case GLSL_TYPE_DOUBLE:
    case GLSL_TYPE_BOOL:
       if (type->is_matrix()) {
 	 return type->matrix_columns;
-- 
2.1.4



More information about the mesa-dev mailing list