From 0268dc155e04f4797faeef62293f30f23e96c202 Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Wed, 17 Apr 2013 11:15:15 +0800 Subject: [PATCH] write_image: Fixed a bug when use scalar data as color source. 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 Tested-by: Meng Lv --- 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); -- 2.7.4