use pointer to union instead of void pointer.
gcc complained a lot, depending what the pointer originally actually was.
Looks like it's in fact maybe legal to cast for instance uint pointers to
union pointers as long as union contains a uint type, hence use this with some
callers, other just use union util_color in the first place.
{
if (buffers & PIPE_CLEAR_COLOR) {
struct pipe_surface *ps = framebuffer->cbufs[0];
- unsigned color;
+ union util_color uc;
- util_pack_color(rgba, ps->format, &color);
+ util_pack_color(rgba, ps->format, &uc);
if (pipe->surface_fill) {
- pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, color);
+ pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, uc.ui);
} else {
- util_surface_fill(pipe, ps, 0, 0, ps->width, ps->height, color);
+ util_surface_fill(pipe, ps, 0, 0, ps->width, ps->height, uc.ui);
}
}
#include "util/u_math.h"
+
+union util_color {
+ ubyte ub;
+ ushort us;
+ uint ui;
+ float f[4];
+};
+
/**
* Pack ubyte R,G,B,A into dest pixel.
*/
static INLINE void
util_pack_color_ub(ubyte r, ubyte g, ubyte b, ubyte a,
- enum pipe_format format, void *dest)
+ enum pipe_format format, union util_color *uc)
{
switch (format) {
case PIPE_FORMAT_R8G8B8A8_UNORM:
{
- uint *d = (uint *) dest;
- *d = (r << 24) | (g << 16) | (b << 8) | a;
+ uc->ui = (r << 24) | (g << 16) | (b << 8) | a;
}
return;
case PIPE_FORMAT_R8G8B8X8_UNORM:
{
- uint *d = (uint *) dest;
- *d = (r << 24) | (g << 16) | (b << 8) | 0xff;
+ uc->ui = (r << 24) | (g << 16) | (b << 8) | 0xff;
}
return;
case PIPE_FORMAT_A8R8G8B8_UNORM:
{
- uint *d = (uint *) dest;
- *d = (a << 24) | (r << 16) | (g << 8) | b;
+ uc->ui = (a << 24) | (r << 16) | (g << 8) | b;
}
return;
case PIPE_FORMAT_X8R8G8B8_UNORM:
{
- uint *d = (uint *) dest;
- *d = (0xff << 24) | (r << 16) | (g << 8) | b;
+ uc->ui = (0xff << 24) | (r << 16) | (g << 8) | b;
}
return;
case PIPE_FORMAT_B8G8R8A8_UNORM:
{
- uint *d = (uint *) dest;
- *d = (b << 24) | (g << 16) | (r << 8) | a;
+ uc->ui = (b << 24) | (g << 16) | (r << 8) | a;
}
return;
case PIPE_FORMAT_B8G8R8X8_UNORM:
{
- uint *d = (uint *) dest;
- *d = (b << 24) | (g << 16) | (r << 8) | 0xff;
+ uc->ui = (b << 24) | (g << 16) | (r << 8) | 0xff;
}
return;
case PIPE_FORMAT_R5G6B5_UNORM:
{
- ushort *d = (ushort *) dest;
- *d = ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3);
+ uc->us = ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3);
}
return;
case PIPE_FORMAT_A1R5G5B5_UNORM:
{
- ushort *d = (ushort *) dest;
- *d = ((a & 0x80) << 8) | ((r & 0xf8) << 7) | ((g & 0xf8) << 2) | (b >> 3);
+ uc->us = ((a & 0x80) << 8) | ((r & 0xf8) << 7) | ((g & 0xf8) << 2) | (b >> 3);
}
return;
case PIPE_FORMAT_A4R4G4B4_UNORM:
{
- ushort *d = (ushort *) dest;
- *d = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4);
+ uc->us = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4);
}
return;
case PIPE_FORMAT_A8_UNORM:
{
- ubyte *d = (ubyte *) dest;
- *d = a;
+ uc->ub = a;
}
return;
case PIPE_FORMAT_L8_UNORM:
case PIPE_FORMAT_I8_UNORM:
{
- ubyte *d = (ubyte *) dest;
- *d = r;
+ uc->ub = a;
}
return;
case PIPE_FORMAT_R32G32B32A32_FLOAT:
{
- float *d = (float *) dest;
- d[0] = (float)r / 255.0f;
- d[1] = (float)g / 255.0f;
- d[2] = (float)b / 255.0f;
- d[3] = (float)a / 255.0f;
+ uc->f[0] = (float)r / 255.0f;
+ uc->f[1] = (float)g / 255.0f;
+ uc->f[2] = (float)b / 255.0f;
+ uc->f[3] = (float)a / 255.0f;
}
return;
case PIPE_FORMAT_R32G32B32_FLOAT:
{
- float *d = (float *) dest;
- d[0] = (float)r / 255.0f;
- d[1] = (float)g / 255.0f;
- d[2] = (float)b / 255.0f;
+ uc->f[0] = (float)r / 255.0f;
+ uc->f[1] = (float)g / 255.0f;
+ uc->f[2] = (float)b / 255.0f;
}
return;
/* XXX lots more cases to add */
default:
+ uc->ui = 0; /* keep compiler happy */
debug_print_format("gallium: unhandled format in util_pack_color_ub()", format);
assert(0);
}
* Unpack RGBA from a packed pixel, returning values as ubytes in [0,255].
*/
static INLINE void
-util_unpack_color_ub(enum pipe_format format, const void *src,
+util_unpack_color_ub(enum pipe_format format, union util_color *uc,
ubyte *r, ubyte *g, ubyte *b, ubyte *a)
{
switch (format) {
case PIPE_FORMAT_R8G8B8A8_UNORM:
{
- uint p = ((const uint *) src)[0];
+ uint p = uc->ui;
*r = (ubyte) ((p >> 24) & 0xff);
*g = (ubyte) ((p >> 16) & 0xff);
*b = (ubyte) ((p >> 8) & 0xff);
return;
case PIPE_FORMAT_R8G8B8X8_UNORM:
{
- uint p = ((const uint *) src)[0];
+ uint p = uc->ui;
*r = (ubyte) ((p >> 24) & 0xff);
*g = (ubyte) ((p >> 16) & 0xff);
*b = (ubyte) ((p >> 8) & 0xff);
return;
case PIPE_FORMAT_A8R8G8B8_UNORM:
{
- uint p = ((const uint *) src)[0];
+ uint p = uc->ui;
*r = (ubyte) ((p >> 16) & 0xff);
*g = (ubyte) ((p >> 8) & 0xff);
*b = (ubyte) ((p >> 0) & 0xff);
return;
case PIPE_FORMAT_X8R8G8B8_UNORM:
{
- uint p = ((const uint *) src)[0];
+ uint p = uc->ui;
*r = (ubyte) ((p >> 16) & 0xff);
*g = (ubyte) ((p >> 8) & 0xff);
*b = (ubyte) ((p >> 0) & 0xff);
return;
case PIPE_FORMAT_B8G8R8A8_UNORM:
{
- uint p = ((const uint *) src)[0];
+ uint p = uc->ui;
*r = (ubyte) ((p >> 8) & 0xff);
*g = (ubyte) ((p >> 16) & 0xff);
*b = (ubyte) ((p >> 24) & 0xff);
return;
case PIPE_FORMAT_B8G8R8X8_UNORM:
{
- uint p = ((const uint *) src)[0];
+ uint p = uc->ui;
*r = (ubyte) ((p >> 8) & 0xff);
*g = (ubyte) ((p >> 16) & 0xff);
*b = (ubyte) ((p >> 24) & 0xff);
return;
case PIPE_FORMAT_R5G6B5_UNORM:
{
- ushort p = ((const ushort *) src)[0];
+ ushort p = uc->us;
*r = (ubyte) (((p >> 8) & 0xf8) | ((p >> 13) & 0x7));
*g = (ubyte) (((p >> 3) & 0xfc) | ((p >> 9) & 0x3));
*b = (ubyte) (((p << 3) & 0xf8) | ((p >> 2) & 0x7));
return;
case PIPE_FORMAT_A1R5G5B5_UNORM:
{
- ushort p = ((const ushort *) src)[0];
+ ushort p = uc->us;
*r = (ubyte) (((p >> 7) & 0xf8) | ((p >> 12) & 0x7));
*g = (ubyte) (((p >> 2) & 0xf8) | ((p >> 7) & 0x7));
*b = (ubyte) (((p << 3) & 0xf8) | ((p >> 2) & 0x7));
return;
case PIPE_FORMAT_A4R4G4B4_UNORM:
{
- ushort p = ((const ushort *) src)[0];
+ ushort p = uc->us;
*r = (ubyte) (((p >> 4) & 0xf0) | ((p >> 8) & 0xf));
*g = (ubyte) (((p >> 0) & 0xf0) | ((p >> 4) & 0xf));
*b = (ubyte) (((p << 4) & 0xf0) | ((p >> 0) & 0xf));
return;
case PIPE_FORMAT_A8_UNORM:
{
- ubyte p = ((const ubyte *) src)[0];
+ ubyte p = uc->ub;
*r = *g = *b = (ubyte) 0xff;
*a = p;
}
return;
case PIPE_FORMAT_L8_UNORM:
{
- ubyte p = ((const ubyte *) src)[0];
+ ubyte p = uc->ub;
*r = *g = *b = p;
*a = (ubyte) 0xff;
}
return;
case PIPE_FORMAT_I8_UNORM:
{
- ubyte p = ((const ubyte *) src)[0];
+ ubyte p = uc->ub;
*r = *g = *b = *a = p;
}
return;
case PIPE_FORMAT_R32G32B32A32_FLOAT:
{
- const float *p = (const float *) src;
+ const float *p = &uc->f[0];
*r = float_to_ubyte(p[0]);
*g = float_to_ubyte(p[1]);
*b = float_to_ubyte(p[2]);
return;
case PIPE_FORMAT_R32G32B32_FLOAT:
{
- const float *p = (const float *) src;
+ const float *p = &uc->f[0];
*r = float_to_ubyte(p[0]);
*g = float_to_ubyte(p[1]);
*b = float_to_ubyte(p[2]);
case PIPE_FORMAT_R32G32_FLOAT:
{
- const float *p = (const float *) src;
+ const float *p = &uc->f[0];
*r = float_to_ubyte(p[0]);
*g = float_to_ubyte(p[1]);
*b = *a = (ubyte) 0xff;
case PIPE_FORMAT_R32_FLOAT:
{
- const float *p = (const float *) src;
+ const float *p = &uc->f[0];
*r = float_to_ubyte(p[0]);
*g = *b = *a = (ubyte) 0xff;
}
assert(0);
}
}
-
/**
* Note rgba outside [0,1] will be clamped for int pixel formats.
*/
static INLINE void
-util_pack_color(const float rgba[4], enum pipe_format format, void *dest)
+util_pack_color(const float rgba[4], enum pipe_format format, union util_color *uc)
{
ubyte r = 0;
ubyte g = 0;
switch (format) {
case PIPE_FORMAT_R8G8B8A8_UNORM:
{
- uint *d = (uint *) dest;
- *d = (r << 24) | (g << 16) | (b << 8) | a;
+ uc->ui = (r << 24) | (g << 16) | (b << 8) | a;
}
return;
case PIPE_FORMAT_R8G8B8X8_UNORM:
{
- uint *d = (uint *) dest;
- *d = (r << 24) | (g << 16) | (b << 8) | 0xff;
+ uc->ui = (r << 24) | (g << 16) | (b << 8) | 0xff;
}
return;
case PIPE_FORMAT_A8R8G8B8_UNORM:
{
- uint *d = (uint *) dest;
- *d = (a << 24) | (r << 16) | (g << 8) | b;
+ uc->ui = (a << 24) | (r << 16) | (g << 8) | b;
}
return;
case PIPE_FORMAT_X8R8G8B8_UNORM:
{
- uint *d = (uint *) dest;
- *d = (0xff << 24) | (r << 16) | (g << 8) | b;
+ uc->ui = (0xff << 24) | (r << 16) | (g << 8) | b;
}
return;
case PIPE_FORMAT_B8G8R8A8_UNORM:
{
- uint *d = (uint *) dest;
- *d = (b << 24) | (g << 16) | (r << 8) | a;
+ uc->ui = (b << 24) | (g << 16) | (r << 8) | a;
}
return;
case PIPE_FORMAT_B8G8R8X8_UNORM:
{
- uint *d = (uint *) dest;
- *d = (b << 24) | (g << 16) | (r << 8) | 0xff;
+ uc->ui = (b << 24) | (g << 16) | (r << 8) | 0xff;
}
return;
case PIPE_FORMAT_R5G6B5_UNORM:
{
- ushort *d = (ushort *) dest;
- *d = ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3);
+ uc->us = ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3);
}
return;
case PIPE_FORMAT_A1R5G5B5_UNORM:
{
- ushort *d = (ushort *) dest;
- *d = ((a & 0x80) << 8) | ((r & 0xf8) << 7) | ((g & 0xf8) << 2) | (b >> 3);
+ uc->us = ((a & 0x80) << 8) | ((r & 0xf8) << 7) | ((g & 0xf8) << 2) | (b >> 3);
}
return;
case PIPE_FORMAT_A4R4G4B4_UNORM:
{
- ushort *d = (ushort *) dest;
- *d = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4);
+ uc->ub = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4);
}
return;
case PIPE_FORMAT_A8_UNORM:
{
- ubyte *d = (ubyte *) dest;
- *d = a;
+ uc->ub = a;
}
return;
case PIPE_FORMAT_L8_UNORM:
case PIPE_FORMAT_I8_UNORM:
{
- ubyte *d = (ubyte *) dest;
- *d = r;
+ uc->ub = r;
}
return;
case PIPE_FORMAT_R32G32B32A32_FLOAT:
{
- float *d = (float *) dest;
- d[0] = rgba[0];
- d[1] = rgba[1];
- d[2] = rgba[2];
- d[3] = rgba[3];
+ uc->f[0] = rgba[0];
+ uc->f[1] = rgba[1];
+ uc->f[2] = rgba[2];
+ uc->f[3] = rgba[3];
}
return;
case PIPE_FORMAT_R32G32B32_FLOAT:
{
- float *d = (float *) dest;
- d[0] = rgba[0];
- d[1] = rgba[1];
- d[2] = rgba[2];
+ uc->f[0] = rgba[0];
+ uc->f[1] = rgba[1];
+ uc->f[2] = rgba[2];
}
return;
/* XXX lots more cases to add */
default:
+ uc->ui = 0; /* keep compiler happy */
debug_print_format("gallium: unhandled format in util_pack_color()", format);
assert(0);
}
if (buffers & PIPE_CLEAR_COLOR) {
uint surfIndex = 0;
- uint clearValue;
+ union util_color uc;
- util_pack_color(rgba, cell->framebuffer.cbufs[0]->format, &clearValue);
+ util_pack_color(rgba, cell->framebuffer.cbufs[0]->format, &uc);
/* Build a CLEAR command and place it in the current batch buffer */
STATIC_ASSERT(sizeof(struct cell_command_clear_surface) % 16 == 0);
cell_batch_alloc16(cell, sizeof(*clr));
clr->opcode[0] = CELL_CMD_CLEAR_SURFACE;
clr->surface = surfIndex;
- clr->value = clearValue;
+ clr->value = uc.ui;
}
if (buffers & PIPE_CLEAR_DEPTHSTENCIL) {
double depth, unsigned stencil)
{
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
+ union util_color uc;
unsigned cv;
uint i;
for (i = 0; i < llvmpipe->framebuffer.nr_cbufs; i++) {
struct pipe_surface *ps = llvmpipe->framebuffer.cbufs[i];
- util_pack_color(rgba, ps->format, &cv);
- lp_tile_cache_clear(llvmpipe->cbuf_cache[i], rgba, cv);
+ util_pack_color(rgba, ps->format, &uc);
+ lp_tile_cache_clear(llvmpipe->cbuf_cache[i], rgba, uc.ui);
}
llvmpipe->dirty_render_cache = TRUE;
}
struct r300_context* r300 = r300_context(pipe);
util_pack_color(color->color, PIPE_FORMAT_A8R8G8B8_UNORM,
- &r300->blend_color_state->blend_color);
+ (union util_color *)&r300->blend_color_state->blend_color);
/* XXX if FP16 blending is enabled, we should use the FP16 format */
r300->blend_color_state->blend_color_red_alpha =
sampler->filter1 |= r300_anisotropy(state->max_anisotropy);
util_pack_color(state->border_color, PIPE_FORMAT_A8R8G8B8_UNORM,
- &sampler->border_color);
+ (union util_color *)&sampler->border_color);
/* R500-specific fixups and optimizations */
if (r300_screen(r300->context.screen)->caps->is_r500) {
double depth, unsigned stencil)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
+ union util_color uc;
unsigned cv;
uint i;
for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++) {
struct pipe_surface *ps = softpipe->framebuffer.cbufs[i];
- util_pack_color(rgba, ps->format, &cv);
- sp_tile_cache_clear(softpipe->cbuf_cache[i], rgba, cv);
+ util_pack_color(rgba, ps->format, &uc);
+ sp_tile_cache_clear(softpipe->cbuf_cache[i], rgba, uc.ui);
#if !TILE_CLEAR_OPTIMIZATION
/* non-cached surface */
- pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, cv);
+ pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, uc.ui);
#endif
}
}
boolean restore_viewport = FALSE;
SVGA3dClearFlag flags = 0;
struct pipe_framebuffer_state *fb = &svga->curr.framebuffer;
- unsigned color = 0;
+ union util_color uc;
ret = svga_update_state(svga, SVGA_STATE_HW_CLEAR);
if (ret)
if ((buffers & PIPE_CLEAR_COLOR) && fb->cbufs[0]) {
flags |= SVGA3D_CLEAR_COLOR;
- util_pack_color(rgba, PIPE_FORMAT_A8R8G8B8_UNORM, &color);
+ util_pack_color(rgba, PIPE_FORMAT_A8R8G8B8_UNORM, &uc);
rect.w = fb->cbufs[0]->width;
rect.h = fb->cbufs[0]->height;
return ret;
}
- ret = SVGA3D_ClearRect(svga->swc, flags, color, depth, stencil,
+ ret = SVGA3D_ClearRect(svga->swc, flags, uc.ui, depth, stencil,
rect.x, rect.y, rect.w, rect.h);
if (ret != PIPE_OK)
return ret;
util_pack_color_ub( r, g, b, a,
PIPE_FORMAT_B8G8R8A8_UNORM,
- &cso->bordercolor );
+ (union util_color *)&cso->bordercolor );
}
/* No SVGA3D support for:
a = 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
}
a = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
a = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
clr[3] = 1.f;
util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
}
clr[3] = ((*src >> 0) & 1)/1.;
util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
}
clr[3] = ((*src >> 0) & 15)/15.;
util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
}
src += offset;
for (i = 0; i < n; ++i) {
util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
}
a = 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
}
a = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
a = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
src += offset;
for (i = 0; i < n; ++i) {
util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
}
src += offset;
for (i = 0; i < n; ++i) {
util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
}
clr[3] = 1.f;
util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i+j]);
+ (union util_color *)rgba[i+j]);
}
++src;
}
clr[3] = (((*src) & (1<<shift)) >> shift);
util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i+j]);
+ (union util_color *)rgba[i+j]);
}
++src;
}
clr[3] = ((*src) & (bitter)) >> shift;
util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i +j]);
+ (union util_color *)rgba[i +j]);
}
++src;
}
b = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
b = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
b = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
b = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
a = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
a = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
a = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
a = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
r = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
r = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
r = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
r = (*src >> 0) & 0xff;
util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT,
- rgba[i]);
+ (union util_color *)rgba[i]);
++src;
}
return;
ubyte g = ctx->PixelMaps.GtoG.Map8[i * gSize / texSize];
ubyte b = ctx->PixelMaps.BtoB.Map8[j * bSize / texSize];
ubyte a = ctx->PixelMaps.AtoA.Map8[i * aSize / texSize];
- util_pack_color_ub(r, g, b, a, pt->format, dest + k);
+ util_pack_color_ub(r, g, b, a, pt->format, (union util_color *)(dest + k));
}
}