[Mesa-dev] [WIP 16/25] i965/gen7: Add support for double precision constant operands

Topi Pohjolainen topi.pohjolainen at intel.com
Thu Oct 16 05:24:28 PDT 2014


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index c352631..fa3fc41 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -2302,6 +2302,11 @@ fs_visitor::visit(ir_constant *ir)
          case GLSL_TYPE_DOUBLE:
             if (brw->gen >= 8) {
                emit(MOV(dst_reg, fs_reg(ir->value.d[i])));
+            } else if (brw->gen >= 7) {
+               /* 64-bit immediates are not supported before gen8 */
+               const unsigned *u = (const unsigned *)&ir->value.d[i];
+               emit(FS_OPCODE_PACK_DOUBLE_2x32, dst_reg,
+                    fs_reg(u[0]), fs_reg(u[1]));
             }
             break;
 	 case GLSL_TYPE_FLOAT:
-- 
1.8.3.1



More information about the mesa-dev mailing list