OpenCL: Solved the IA4 case (some byteswapping was necessary, hope there's a vectorized function for that). Some \n fixing I guess

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4399 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY 2009-10-11 20:03:55 +00:00
parent 6a537dd095
commit 449abdb01d
1 changed files with 384 additions and 372 deletions

View File

@ -46,6 +46,12 @@ kernel void DecodeI8(global uchar *dst, \n\
0, dst + ((y + iy)*width + x)); \n\
srcOffset++; \n\
} \n\
} \n\
\n\
\n\
ushort swapbytes(ushort x) { \n\
return (x & 0xf00f) | ((x >> 4) & 0x00f0) | \n\
((x << 4) & 0x0f00); \n\
} \n\
\n\
kernel void DecodeIA4(global ushort *dst, \n\
@ -56,9 +62,15 @@ kernel void DecodeIA4(global ushort *dst, \n\
for (int iy = 0; iy < 4; iy++) \n\
{ \n\
uchar8 val = vload8(srcOffset, src); \n\
ushort8 res; \n\
res.hi = upsample(val.hi, val.hi); \n\
res.lo = upsample(val.lo, val.lo); \n\
ushort8 res = val.s0011223344556677; \n\
res.s0 = swapbytes(res.s0); \n\
res.s1 = swapbytes(res.s1); \n\
res.s2 = swapbytes(res.s2); \n\
res.s3 = swapbytes(res.s3); \n\
res.s4 = swapbytes(res.s4); \n\
res.s5 = swapbytes(res.s5); \n\
res.s6 = swapbytes(res.s6); \n\
res.s7 = swapbytes(res.s7); \n\
vstore8(res, 0, dst + ((y + iy)*width + x)); \n\
srcOffset++; \n\
} \n\