A new update for OpenCL.h.

Changes:
 - Strict casting as required by NVidia. Now NVidia cards should work.
 - Fixed Alpha CMPR bug.

Please tell me if you find any bugs. Current known bug is the 'Press' texture in Paper Mario that is meant to flash rainbow colours appears black. Other than that, everything should work on every videocard.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5759 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
xsacha 2010-06-21 13:09:25 +00:00
parent 11ac672730
commit 92c98ac5fa

View file

@ -161,23 +161,22 @@ kernel void decodeCMPRBlock(global uchar *dst,
colorb565,
(uchar2)0xFF);
ushort4 frac2 = (ushort4)(color32.even & (uchar4)0xFF) - (ushort4)(color32.odd & (uchar4)0xFF);
ushort4 frac2 = convert_ushort4(color32.even & (uchar4)0xFF) - convert_ushort4(color32.odd & (uchar4)0xFF);
uchar4 frac = convert_uchar4((frac2 * (ushort4)3) / (ushort4)8);
ushort4 colorAlpha = upsample((uchar4)0, rhadd(color32.odd, color32.even));
colorAlpha.s3 = 0xFF;
ushort4 colorNoAlpha = upsample(color32.odd + frac, color32.even - frac);
ushort4 choice = isgreater(val.s0,val.s2);
uint4 colors = upsample(bitselect(colorNoAlpha, colorAlpha, choice),
uint4 colors = upsample((upsample(val.s0,val.s1) > upsample(val.s2,val.s3))?colorNoAlpha:colorAlpha,
upsample(color32.odd, color32.even));
uint16 colorsFull = (uint16)(colors, colors, colors, colors);
vstore16((uchar16)(colorsFull >> unpack(val.s4)), 0, dst);
vstore16((uchar16)(colorsFull >> unpack(val.s5)), 0, dst+=width*4);
vstore16((uchar16)(colorsFull >> unpack(val.s6)), 0, dst+=width*4);
vstore16((uchar16)(colorsFull >> unpack(val.s7)), 0, dst+=width*4);
vstore16(convert_uchar16(colorsFull >> unpack(val.s4)), 0, dst);
vstore16(convert_uchar16(colorsFull >> unpack(val.s5)), 0, dst+=width*4);
vstore16(convert_uchar16(colorsFull >> unpack(val.s6)), 0, dst+=width*4);
vstore16(convert_uchar16(colorsFull >> unpack(val.s7)), 0, dst+=width*4);
}
kernel void DecodeCMPR(global uchar *dst,