From: Brian Date: Tue, 5 Feb 2008 01:02:21 +0000 (-0700) Subject: Cell: don't use VEC_LITERAL macro, doesn't work w/ SDK 3.0 X-Git-Tag: 062012170305~17580^2~390^2~2717 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7cbe5cf212d296c19ccf8e1b74d3a5b1bcb2d9e9;p=profile%2Fivi%2Fmesa.git Cell: don't use VEC_LITERAL macro, doesn't work w/ SDK 3.0 --- diff --git a/src/mesa/pipe/cell/spu/spu_colorpack.h b/src/mesa/pipe/cell/spu/spu_colorpack.h index 57ea352..e9fee8a 100644 --- a/src/mesa/pipe/cell/spu/spu_colorpack.h +++ b/src/mesa/pipe/cell/spu/spu_colorpack.h @@ -31,7 +31,6 @@ #define SPU_COLORPACK_H -#include #include @@ -39,9 +38,11 @@ static INLINE unsigned int spu_pack_R8G8B8A8(vector float rgba) { vector unsigned int out = spu_convtu(rgba, 32); - out = spu_shuffle(out, out, VEC_LITERAL(vector unsigned char, - 0, 4, 8, 12, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0)); + + out = spu_shuffle(out, out, ((vector unsigned char) { + 0, 4, 8, 12, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 }) ); + return spu_extract(out, 0); } @@ -50,9 +51,9 @@ static INLINE unsigned int spu_pack_A8R8G8B8(vector float rgba) { vector unsigned int out = spu_convtu(rgba, 32); - out = spu_shuffle(out, out, VEC_LITERAL(vector unsigned char, - 12, 0, 4, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0)); + out = spu_shuffle(out, out, ((vector unsigned char) { + 12, 0, 4, 8, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0}) ); return spu_extract(out, 0); } @@ -61,9 +62,9 @@ static INLINE unsigned int spu_pack_B8G8R8A8(vector float rgba) { vector unsigned int out = spu_convtu(rgba, 32); - out = spu_shuffle(out, out, VEC_LITERAL(vector unsigned char, - 8, 4, 0, 12, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0)); + out = spu_shuffle(out, out, ((vector unsigned char) { + 8, 4, 0, 12, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0}) ); return spu_extract(out, 0); } @@ -82,11 +83,11 @@ spu_unpack_color(uint color) { vector unsigned int color_u4 = spu_splats(color); color_u4 = spu_shuffle(color_u4, color_u4, - VEC_LITERAL(vector unsigned char, - 0, 0, 0, 0, - 5, 5, 5, 5, - 10, 10, 10, 10, - 15, 15, 15, 15)); + ((vector unsigned char) { + 0, 0, 0, 0, + 5, 5, 5, 5, + 10, 10, 10, 10, + 15, 15, 15, 15}) ); return spu_convtf(color_u4, 32); } @@ -96,11 +97,11 @@ spu_unpack_A8R8G8B8(uint color) { vector unsigned int color_u4 = spu_splats(color); color_u4 = spu_shuffle(color_u4, color_u4, - VEC_LITERAL(vector unsigned char, - 5, 5, 5, 5, - 10, 10, 10, 10, - 15, 15, 15, 15, - 0, 0, 0, 0)); + ((vector unsigned char) { + 5, 5, 5, 5, + 10, 10, 10, 10, + 15, 15, 15, 15, + 0, 0, 0, 0}) ); return spu_convtf(color_u4, 32); } diff --git a/src/mesa/pipe/cell/spu/spu_ztest.h b/src/mesa/pipe/cell/spu/spu_ztest.h index 5fefb15..ce8ad00 100644 --- a/src/mesa/pipe/cell/spu/spu_ztest.h +++ b/src/mesa/pipe/cell/spu/spu_ztest.h @@ -68,9 +68,9 @@ spu_z16_test_less(vector float zvals, vector unsigned short *zbuf, /* gather lower four ushorts */ zbuf_ui4 = spu_shuffle((vector unsigned int) *zbuf, (vector unsigned int) *zbuf, - VEC_LITERAL(vector unsigned char, - ZERO, ZERO, 8, 9, ZERO, ZERO, 10, 11, - ZERO, ZERO, 12, 13, ZERO, ZERO, 14, 15)); + ((vector unsigned char) { + ZERO, ZERO, 8, 9, ZERO, ZERO, 10, 11, + ZERO, ZERO, 12, 13, ZERO, ZERO, 14, 15})); /* mask = (zbuf_ui4 < zvals_ui4) ? ~0 : 0 */ mask = spu_cmpgt(zbuf_ui4, zvals_ui4); /* mask &= inMask */ @@ -80,18 +80,18 @@ spu_z16_test_less(vector float zvals, vector unsigned short *zbuf, /* convert zbuffer values from uints back to ushorts, preserve lower 4 */ *zbuf = (vector unsigned short) spu_shuffle(zbuf_ui4, (vector unsigned int) *zbuf, - VEC_LITERAL(vector unsigned char, - 16, 17, 18, 19, 20, 21, 22, 23, - 2, 3, 6, 7, 10, 11, 14, 15)); + ((vector unsigned char) { + 16, 17, 18, 19, 20, 21, 22, 23, + 2, 3, 6, 7, 10, 11, 14, 15})); } else { /* convert zbuffer values from ushorts to uints */ /* gather upper four ushorts */ zbuf_ui4 = spu_shuffle((vector unsigned int) *zbuf, (vector unsigned int) *zbuf, - VEC_LITERAL(vector unsigned char, - ZERO, ZERO, 0, 1, ZERO, ZERO, 2, 3, - ZERO, ZERO, 4, 5, ZERO, ZERO, 6, 7)); + ((vector unsigned char) { + ZERO, ZERO, 0, 1, ZERO, ZERO, 2, 3, + ZERO, ZERO, 4, 5, ZERO, ZERO, 6, 7})); /* mask = (zbuf_ui4 < zvals_ui4) ? ~0 : 0 */ mask = spu_cmpgt(zbuf_ui4, zvals_ui4); /* mask &= inMask */ @@ -101,9 +101,9 @@ spu_z16_test_less(vector float zvals, vector unsigned short *zbuf, /* convert zbuffer values from uints back to ushorts, preserve upper 4 */ *zbuf = (vector unsigned short) spu_shuffle(zbuf_ui4, (vector unsigned int) *zbuf, - VEC_LITERAL(vector unsigned char, - 2, 3, 6, 7, 10, 11, 14, 15, - 24, 25, 26, 27, 28, 29, 30, 31)); + ((vector unsigned char) { + 2, 3, 6, 7, 10, 11, 14, 15, + 24, 25, 26, 27, 28, 29, 30, 31})); } return mask; #undef ZERO