[Mesa-dev] [PATCH 1.9/2] i965: Add brw_imm_uv().

Matt Turner mattst88 at gmail.com
Wed Nov 18 14:25:49 PST 2015


---
 src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 3 +++
 src/mesa/drivers/dri/i965/brw_reg.h            | 9 +++++++++
 2 files changed, 12 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index e5a286a..78c10e9 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -116,6 +116,9 @@ brw_reg_from_fs_reg(fs_inst *inst, fs_reg *reg, unsigned gen)
       case BRW_REGISTER_TYPE_V:
          brw_reg = brw_imm_v(reg->ud);
          break;
+      case BRW_REGISTER_TYPE_UV:
+         brw_reg = brw_imm_uv(reg->ud);
+         break;
       default:
 	 unreachable("not reached");
       }
diff --git a/src/mesa/drivers/dri/i965/brw_reg.h b/src/mesa/drivers/dri/i965/brw_reg.h
index 759bd93..b77cdeb 100644
--- a/src/mesa/drivers/dri/i965/brw_reg.h
+++ b/src/mesa/drivers/dri/i965/brw_reg.h
@@ -623,6 +623,15 @@ brw_imm_v(unsigned v)
    return imm;
 }
 
+/** Construct vector of eight unsigned half-byte values */
+static inline struct brw_reg
+brw_imm_uv(unsigned uv)
+{
+   struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_UV);
+   imm.ud = uv;
+   return imm;
+}
+
 /** Construct vector of four 8-bit float values */
 static inline struct brw_reg
 brw_imm_vf(unsigned v)
-- 
2.4.9



More information about the mesa-dev mailing list