[Beignet] [PATCH 10/19] Backend: Add a auxiliary function to convert GenReg to uniform.

junyan.he at inbox.com junyan.he at inbox.com
Tue Sep 8 17:01:01 PDT 2015


From: Junyan He <junyan.he at linux.intel.com>

Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
 backend/src/backend/gen_register.hpp |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/backend/src/backend/gen_register.hpp b/backend/src/backend/gen_register.hpp
index 4f37e30..9e9e0e4 100644
--- a/backend/src/backend/gen_register.hpp
+++ b/backend/src/backend/gen_register.hpp
@@ -274,6 +274,15 @@ namespace gbe
       return r;
     }
 
+    static INLINE GenRegister toUniform(GenRegister reg, uint32_t type) {
+      GenRegister r = reg;
+      r.type = type;
+      r.hstride = GEN_HORIZONTAL_STRIDE_0;
+      r.vstride = GEN_VERTICAL_STRIDE_0;
+      r.width = GEN_WIDTH_1;
+      return r;
+    }
+
     static INLINE uint32_t grfOffset(GenRegister reg) {
       return reg.nr * GEN_REG_SIZE + reg.subnr;
     }
-- 
1.7.9.5





More information about the Beignet mailing list