[Mesa-dev] [PATCH 38/51] intel/compiler/fs: Use original reg size when retyping nir src

Topi Pohjolainen topi.pohjolainen at gmail.com
Fri Nov 24 12:27:05 UTC 2017


In case of boolean typed the values maybe given in 16-bits whereas
NIR unconditionally regards them as 32-bit.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/intel/compiler/brw_fs_nir.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp
index d28ed57eca..2a32b1449a 100644
--- a/src/intel/compiler/brw_fs_nir.cpp
+++ b/src/intel/compiler/brw_fs_nir.cpp
@@ -1604,8 +1604,9 @@ fs_visitor::get_nir_src(const nir_src &src)
        * default to an integer type - instructions that need floating point
        * semantics will set this to F if they need to
        */
-      reg.type = brw_reg_type_from_bit_size(nir_src_bit_size(src),
-                                            BRW_REGISTER_TYPE_D);
+      reg.type = brw_reg_type_from_bit_size(
+                    brw_reg_type_to_size(reg.type) * 8,
+                    BRW_REGISTER_TYPE_D);
    }
 
    return reg;
-- 
2.11.0



More information about the mesa-dev mailing list