diff options
author | Roland Scheidegger <[email protected]> | 2014-04-23 20:00:03 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2014-04-25 19:29:30 +0200 |
commit | fa4082320acaf0a1a22ae56144eef94b2997818d (patch) | |
tree | 3b18c83012d42ce24c248e23e4ee3cf239c6153c /src/gallium/drivers | |
parent | 2f65f61beac3a45fdf27bf25d7b13cd1fa2bbb8c (diff) |
gallium/util: use ui[4] instead of ui in union util_color
util_color often merely represents a collection of bytes, however it is
inconvenient if those bytes can only be accessed as floats/doubles for int
formats exceeding 32bits.
(Note that since rgba8 formats use one uint, not 4 bytes, hence the byte and
short member were left as is.)
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/freedreno/a2xx/fd2_draw.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/i915/i915_clear.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/i915/i915_surface.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_blitter_blt.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv30/nv30_clear.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_blit.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_state_derived.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_pipe_clear.c | 2 |
9 files changed, 18 insertions, 18 deletions
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_draw.c b/src/gallium/drivers/freedreno/a2xx/fd2_draw.c index d6e42b668a8..77fbf1af224 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_draw.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_draw.c @@ -123,7 +123,7 @@ pack_rgba(enum pipe_format format, const float *rgba) { union util_color uc; util_pack_color(rgba, format, &uc); - return uc.ui; + return uc.ui[0]; } static void diff --git a/src/gallium/drivers/i915/i915_clear.c b/src/gallium/drivers/i915/i915_clear.c index b17707f3f64..57244a65bb5 100644 --- a/src/gallium/drivers/i915/i915_clear.c +++ b/src/gallium/drivers/i915/i915_clear.c @@ -66,10 +66,10 @@ i915_clear_emit(struct pipe_context *pipe, unsigned buffers, util_pack_color(color->f, cbuf->format, &u_color); if (util_format_get_blocksize(cbuf_tex->b.b.format) == 4) { - clear_color = u_color.ui; + clear_color = u_color.ui[0]; color_clear_bbp = 32; } else { - clear_color = (u_color.ui & 0xffff) | (u_color.ui << 16); + clear_color = (u_color.ui[0] & 0xffff) | (u_color.ui[0] << 16); color_clear_bbp = 16; } @@ -78,7 +78,7 @@ i915_clear_emit(struct pipe_context *pipe, unsigned buffers, util_pack_color(color->f, cbuf->format, &u_color); else util_pack_color(color->f, PIPE_FORMAT_B8G8R8A8_UNORM, &u_color); - clear_color8888 = u_color.ui; + clear_color8888 = u_color.ui[0]; } else clear_color = clear_color8888 = 0; diff --git a/src/gallium/drivers/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c index 7496250faa2..df662873001 100644 --- a/src/gallium/drivers/i915/i915_surface.c +++ b/src/gallium/drivers/i915/i915_surface.c @@ -266,7 +266,7 @@ i915_clear_render_target_blitter(struct pipe_context *pipe, tex->buffer, offset, (short) dstx, (short) dsty, (short) width, (short) height, - uc.ui ); + uc.ui[0] ); } static void diff --git a/src/gallium/drivers/ilo/ilo_blitter_blt.c b/src/gallium/drivers/ilo/ilo_blitter_blt.c index 4571c097df2..ac34383f5bd 100644 --- a/src/gallium/drivers/ilo/ilo_blitter_blt.c +++ b/src/gallium/drivers/ilo/ilo_blitter_blt.c @@ -739,7 +739,7 @@ ilo_blitter_blt_clear_rt(struct ilo_blitter *blitter, size = end - offset; success = buf_clear_region(blitter, ilo_buffer(rt->texture), - offset, size, packed.ui, mask, mask); + offset, size, packed.ui[0], mask, mask); } else { struct pipe_box box; @@ -748,7 +748,7 @@ ilo_blitter_blt_clear_rt(struct ilo_blitter *blitter, rt->u.tex.last_layer - rt->u.tex.first_layer + 1, &box); success = tex_clear_region(blitter, ilo_texture(rt->texture), - rt->u.tex.level, &box, packed.ui, mask, mask); + rt->u.tex.level, &box, packed.ui[0], mask, mask); } return success; diff --git a/src/gallium/drivers/nouveau/nv30/nv30_clear.c b/src/gallium/drivers/nouveau/nv30/nv30_clear.c index 5317e892b25..1ab8929cc38 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_clear.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_clear.c @@ -37,7 +37,7 @@ pack_rgba(enum pipe_format format, const float *rgba) { union util_color uc; util_pack_color(rgba, format, &uc); - return uc.ui; + return uc.ui[0]; } static INLINE uint32_t diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index 05e55f3665e..2b516d284d1 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -118,7 +118,7 @@ static uint32_t r300_depth_clear_cb_value(enum pipe_format format, util_pack_color(rgba, format, &uc); if (util_format_get_blocksizebits(format) == 32) - return uc.ui; + return uc.ui[0]; else return uc.us | (uc.us << 16); } @@ -193,7 +193,7 @@ static void r300_set_clear_color(struct r300_context *r300, r300->color_clear_value_gb = uc.h[0] | ((uint32_t)uc.h[1] << 16); r300->color_clear_value_ar = uc.h[2] | ((uint32_t)uc.h[3] << 16); } else { - r300->color_clear_value = uc.ui; + r300->color_clear_value = uc.ui[0]; } } diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index b664c97f4dd..7d83576cf84 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -646,7 +646,7 @@ static void r300_set_blend_color(struct pipe_context* pipe, util_pack_color(c.color, PIPE_FORMAT_B8G8R8A8_UNORM, &uc); BEGIN_CB(state->cb, 2); - OUT_CB_REG(R300_RB3D_BLEND_COLOR, uc.ui); + OUT_CB_REG(R300_RB3D_BLEND_COLOR, uc.ui[0]); END_CB; } diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 1013557bde9..da472f4d7f4 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -699,24 +699,24 @@ static uint32_t r300_get_border_color(enum pipe_format format, /* The Y component is used for the border color. */ border_swizzled[1] = border_swizzled[0] + 1.0f/32; util_pack_color(border_swizzled, PIPE_FORMAT_B4G4R4A4_UNORM, &uc); - return uc.ui; + return uc.ui[0]; case PIPE_FORMAT_RGTC2_SNORM: case PIPE_FORMAT_LATC2_SNORM: util_pack_color(border_swizzled, PIPE_FORMAT_R8G8B8A8_SNORM, &uc); - return uc.ui; + return uc.ui[0]; case PIPE_FORMAT_RGTC2_UNORM: case PIPE_FORMAT_LATC2_UNORM: util_pack_color(border_swizzled, PIPE_FORMAT_R8G8B8A8_UNORM, &uc); - return uc.ui; + return uc.ui[0]; case PIPE_FORMAT_DXT1_SRGB: case PIPE_FORMAT_DXT1_SRGBA: case PIPE_FORMAT_DXT3_SRGBA: case PIPE_FORMAT_DXT5_SRGBA: util_pack_color(border_swizzled, PIPE_FORMAT_B8G8R8A8_SRGB, &uc); - return uc.ui; + return uc.ui[0]; default: util_pack_color(border_swizzled, PIPE_FORMAT_B8G8R8A8_UNORM, &uc); - return uc.ui; + return uc.ui[0]; } } @@ -789,7 +789,7 @@ static uint32_t r300_get_border_color(enum pipe_format format, break; } - return uc.ui; + return uc.ui[0]; } static void r300_merge_textures_and_samplers(struct r300_context* r300) diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c index 21869e9d6d0..c4edced9bae 100644 --- a/src/gallium/drivers/svga/svga_pipe_clear.c +++ b/src/gallium/drivers/svga/svga_pipe_clear.c @@ -86,7 +86,7 @@ try_clear(struct svga_context *svga, return ret; } - ret = SVGA3D_ClearRect(svga->swc, flags, uc.ui, (float) depth, stencil, + ret = SVGA3D_ClearRect(svga->swc, flags, uc.ui[0], (float) depth, stencil, rect.x, rect.y, rect.w, rect.h); if (ret != PIPE_OK) return ret; |