[Beignet] [PATCH] write_image: Fixed a bug when use scalar data as color source.

Zhigang Gong zhigang.gong at linux.intel.com
Tue Apr 16 20:20:29 PDT 2013


If the color source is scalar data type for example from the
kernel input parameters, then we should use QnPhysical to get
the source, rather than hard coded the subnr to zero.

Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>
---
 backend/src/backend/gen_context.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/backend/src/backend/gen_context.cpp b/backend/src/backend/gen_context.cpp
index b4c9a65..b3d385b 100644
--- a/backend/src/backend/gen_context.cpp
+++ b/backend/src/backend/gen_context.cpp
@@ -326,9 +326,9 @@ namespace gbe
     for( uint32_t quarter = 0; quarter < quarterNum; quarter++)
     {
 #define QUARTER_MOV0(dst_nr, src) p->MOV(GenRegister::ud8grf(dst_nr, 0), \
-                                        GenRegister::retype(GenRegister::ud8grf(src.nr + quarter, 0), src.type))
+                                        GenRegister::retype(GenRegister::QnPhysical(src, quarter), src.type))
 #define QUARTER_MOV1(dst_nr, src) p->MOV(GenRegister::retype(GenRegister::ud8grf(dst_nr, 0), src.type), \
-                                        GenRegister::retype(GenRegister::ud8grf(src.nr + quarter, 0), src.type))
+                                        GenRegister::retype(GenRegister::QnPhysical(src,quarter), src.type))
       QUARTER_MOV0(nr + 1, ucoord);
       QUARTER_MOV0(nr + 2, vcoord);
       QUARTER_MOV1(nr + 5, R);
-- 
1.7.11.7



More information about the Beignet mailing list