write_image: Fixed a bug when use scalar data as color source.
authorZhigang Gong <zhigang.gong@linux.intel.com>
Wed, 17 Apr 2013 03:15:15 +0000 (11:15 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Thu, 18 Apr 2013 03:14:05 +0000 (11:14 +0800)
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@linux.intel.com>
Tested-by: Meng Lv <meng.lv@intel.com>
backend/src/backend/gen_context.cpp

index b4c9a65..b3d385b 100644 (file)
@@ -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);