diff options
author | Dave Airlie <[email protected]> | 2011-09-27 10:08:34 +0100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2011-09-27 20:02:02 +0100 |
commit | 9f61e43b4903c6cf0ac03a479ec9ed7b15fd6ccf (patch) | |
tree | 8985ff4b3c47899deb7604511ac168fa76e46f63 /src/gallium/drivers | |
parent | 0527c11d7aa42bd74f4527d7299e3c18f37c4c44 (diff) |
gallium: move border color to be a color union
EXT_texture_integer also specifies border color should be a color
union, the values are used according to the texture sampler format.
(update docs)
Signed-off-by: Dave Airlie <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/i915/i915_state.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_state.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/nvfx/nvfx_fragtex.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_state_derived.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 10 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_state.c | 10 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_tex_sample.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_pipe_sampler.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/trace/tr_dump_state.c | 2 |
10 files changed, 30 insertions, 30 deletions
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index 2812de1fe80..345c109a995 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -279,10 +279,10 @@ i915_create_sampler_state(struct pipe_context *pipe, } { - ubyte r = float_to_ubyte(sampler->border_color[0]); - ubyte g = float_to_ubyte(sampler->border_color[1]); - ubyte b = float_to_ubyte(sampler->border_color[2]); - ubyte a = float_to_ubyte(sampler->border_color[3]); + ubyte r = float_to_ubyte(sampler->border_color.f[0]); + ubyte g = float_to_ubyte(sampler->border_color.f[1]); + ubyte b = float_to_ubyte(sampler->border_color.f[2]); + ubyte a = float_to_ubyte(sampler->border_color.f[3]); cso->state[2] = I915PACKCOLOR8888(r, g, b, a); } return cso; diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index cbe06e58a78..1479ed44f0f 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -729,7 +729,7 @@ lp_setup_set_fragment_sampler_state(struct lp_setup_context *setup, jit_tex->min_lod = sampler->min_lod; jit_tex->max_lod = sampler->max_lod; jit_tex->lod_bias = sampler->lod_bias; - COPY_4V(jit_tex->border_color, sampler->border_color); + COPY_4V(jit_tex->border_color, sampler->border_color.f); } } diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index 49ea646c77c..0e08b096f58 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -508,10 +508,10 @@ nv50_sampler_state_create(struct pipe_context *pipe, so->tsc[2] |= (((int)(f[1] * 256.0f) & 0xfff) << 12) | ((int)(f[0] * 256.0f) & 0xfff); - so->tsc[4] = fui(cso->border_color[0]); - so->tsc[5] = fui(cso->border_color[1]); - so->tsc[6] = fui(cso->border_color[2]); - so->tsc[7] = fui(cso->border_color[3]); + so->tsc[4] = fui(cso->border_color.f[0]); + so->tsc[5] = fui(cso->border_color.f[1]); + so->tsc[6] = fui(cso->border_color.f[2]); + so->tsc[7] = fui(cso->border_color.f[3]); return (void *)so; } diff --git a/src/gallium/drivers/nvfx/nvfx_fragtex.c b/src/gallium/drivers/nvfx/nvfx_fragtex.c index 1c4901df0e2..3ef9fcce347 100644 --- a/src/gallium/drivers/nvfx/nvfx_fragtex.c +++ b/src/gallium/drivers/nvfx/nvfx_fragtex.c @@ -25,7 +25,7 @@ nvfx_sampler_state_create(struct pipe_context *pipe, ps->wrap |= nvfx_tex_wrap_compare_mode(cso->compare_func); ps->compare = TRUE; } - ps->bcol = nvfx_tex_border_color(cso->border_color); + ps->bcol = nvfx_tex_border_color(cso->border_color.f); if(nvfx->is_nv4x) nv40_sampler_state_init(pipe, ps, cso); diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 45c11fce1fe..daeb4d716d0 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -762,7 +762,7 @@ static void r300_merge_textures_and_samplers(struct r300_context* r300) /* Set the border color. */ texstate->border_color = r300_get_border_color(view->base.format, - sampler->state.border_color, + sampler->state.border_color.f, r300->screen->caps.is_r500); /* determine min/max levels */ diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 3b7844f0fa4..875c806b0a4 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -938,7 +938,7 @@ static void *evergreen_create_sampler_state(struct pipe_context *ctx, } rstate->id = R600_PIPE_STATE_SAMPLER; - util_pack_color(state->border_color, PIPE_FORMAT_B8G8R8A8_UNORM, &uc); + util_pack_color(state->border_color.f, PIPE_FORMAT_B8G8R8A8_UNORM, &uc); r600_pipe_state_add_reg_noblock(rstate, R_03C000_SQ_TEX_SAMPLER_WORD0_0, S_03C000_CLAMP_X(r600_tex_wrap(state->wrap_s)) | S_03C000_CLAMP_Y(r600_tex_wrap(state->wrap_t)) | @@ -960,10 +960,10 @@ static void *evergreen_create_sampler_state(struct pipe_context *ctx, 0xFFFFFFFF, NULL, 0); if (uc.ui) { - r600_pipe_state_add_reg_noblock(rstate, R_00A404_TD_PS_SAMPLER0_BORDER_RED, fui(state->border_color[0]), 0xFFFFFFFF, NULL, 0); - r600_pipe_state_add_reg_noblock(rstate, R_00A408_TD_PS_SAMPLER0_BORDER_GREEN, fui(state->border_color[1]), 0xFFFFFFFF, NULL, 0); - r600_pipe_state_add_reg_noblock(rstate, R_00A40C_TD_PS_SAMPLER0_BORDER_BLUE, fui(state->border_color[2]), 0xFFFFFFFF, NULL, 0); - r600_pipe_state_add_reg_noblock(rstate, R_00A410_TD_PS_SAMPLER0_BORDER_ALPHA, fui(state->border_color[3]), 0xFFFFFFFF, NULL, 0); + r600_pipe_state_add_reg_noblock(rstate, R_00A404_TD_PS_SAMPLER0_BORDER_RED, fui(state->border_color.f[0]), 0xFFFFFFFF, NULL, 0); + r600_pipe_state_add_reg_noblock(rstate, R_00A408_TD_PS_SAMPLER0_BORDER_GREEN, fui(state->border_color.f[1]), 0xFFFFFFFF, NULL, 0); + r600_pipe_state_add_reg_noblock(rstate, R_00A40C_TD_PS_SAMPLER0_BORDER_BLUE, fui(state->border_color.f[2]), 0xFFFFFFFF, NULL, 0); + r600_pipe_state_add_reg_noblock(rstate, R_00A410_TD_PS_SAMPLER0_BORDER_ALPHA, fui(state->border_color.f[3]), 0xFFFFFFFF, NULL, 0); } return rstate; } diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index 2e2ce40d447..6edf3857d92 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -981,7 +981,7 @@ static void *r600_create_sampler_state(struct pipe_context *ctx, ss->seamless_cube_map = state->seamless_cube_map; rstate = &ss->rstate; rstate->id = R600_PIPE_STATE_SAMPLER; - util_pack_color(state->border_color, PIPE_FORMAT_B8G8R8A8_UNORM, &uc); + util_pack_color(state->border_color.f, PIPE_FORMAT_B8G8R8A8_UNORM, &uc); r600_pipe_state_add_reg_noblock(rstate, R_03C000_SQ_TEX_SAMPLER_WORD0_0, S_03C000_CLAMP_X(r600_tex_wrap(state->wrap_s)) | S_03C000_CLAMP_Y(r600_tex_wrap(state->wrap_t)) | @@ -998,10 +998,10 @@ static void *r600_create_sampler_state(struct pipe_context *ctx, S_03C004_LOD_BIAS(S_FIXED(CLAMP(state->lod_bias, -16, 16), 6)), 0xFFFFFFFF, NULL, 0); r600_pipe_state_add_reg_noblock(rstate, R_03C008_SQ_TEX_SAMPLER_WORD2_0, S_03C008_TYPE(1), 0xFFFFFFFF, NULL, 0); if (uc.ui) { - r600_pipe_state_add_reg_noblock(rstate, R_00A400_TD_PS_SAMPLER0_BORDER_RED, fui(state->border_color[0]), 0xFFFFFFFF, NULL, 0); - r600_pipe_state_add_reg_noblock(rstate, R_00A404_TD_PS_SAMPLER0_BORDER_GREEN, fui(state->border_color[1]), 0xFFFFFFFF, NULL, 0); - r600_pipe_state_add_reg_noblock(rstate, R_00A408_TD_PS_SAMPLER0_BORDER_BLUE, fui(state->border_color[2]), 0xFFFFFFFF, NULL, 0); - r600_pipe_state_add_reg_noblock(rstate, R_00A40C_TD_PS_SAMPLER0_BORDER_ALPHA, fui(state->border_color[3]), 0xFFFFFFFF, NULL, 0); + r600_pipe_state_add_reg_noblock(rstate, R_00A400_TD_PS_SAMPLER0_BORDER_RED, fui(state->border_color.f[0]), 0xFFFFFFFF, NULL, 0); + r600_pipe_state_add_reg_noblock(rstate, R_00A404_TD_PS_SAMPLER0_BORDER_GREEN, fui(state->border_color.f[1]), 0xFFFFFFFF, NULL, 0); + r600_pipe_state_add_reg_noblock(rstate, R_00A408_TD_PS_SAMPLER0_BORDER_BLUE, fui(state->border_color.f[2]), 0xFFFFFFFF, NULL, 0); + r600_pipe_state_add_reg_noblock(rstate, R_00A40C_TD_PS_SAMPLER0_BORDER_ALPHA, fui(state->border_color.f[3]), 0xFFFFFFFF, NULL, 0); } return rstate; } diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c index 2e91a709fe0..72629a0bcac 100644 --- a/src/gallium/drivers/softpipe/sp_tex_sample.c +++ b/src/gallium/drivers/softpipe/sp_tex_sample.c @@ -672,7 +672,7 @@ get_texel_2d(const struct sp_sampler_variant *samp, if (x < 0 || x >= (int) u_minify(texture->width0, level) || y < 0 || y >= (int) u_minify(texture->height0, level)) { - return samp->sampler->border_color; + return samp->sampler->border_color.f; } else { return get_texel_2d_no_border( samp, addr, x, y ); @@ -766,7 +766,7 @@ get_texel_3d(const struct sp_sampler_variant *samp, if (x < 0 || x >= (int) u_minify(texture->width0, level) || y < 0 || y >= (int) u_minify(texture->height0, level) || z < 0 || z >= (int) u_minify(texture->depth0, level)) { - return samp->sampler->border_color; + return samp->sampler->border_color.f; } else { return get_texel_3d_no_border( samp, addr, x, y, z ); @@ -783,7 +783,7 @@ get_texel_1d_array(const struct sp_sampler_variant *samp, unsigned level = addr.bits.level; if (x < 0 || x >= (int) u_minify(texture->width0, level)) { - return samp->sampler->border_color; + return samp->sampler->border_color.f; } else { return get_texel_2d_no_border(samp, addr, x, y); @@ -803,7 +803,7 @@ get_texel_2d_array(const struct sp_sampler_variant *samp, if (x < 0 || x >= (int) u_minify(texture->width0, level) || y < 0 || y >= (int) u_minify(texture->height0, level)) { - return samp->sampler->border_color; + return samp->sampler->border_color.f; } else { return get_texel_3d_no_border(samp, addr, x, y, layer); diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c b/src/gallium/drivers/svga/svga_pipe_sampler.c index dcfeaacbef1..4885d200584 100644 --- a/src/gallium/drivers/svga/svga_pipe_sampler.c +++ b/src/gallium/drivers/svga/svga_pipe_sampler.c @@ -113,10 +113,10 @@ svga_create_sampler_state(struct pipe_context *pipe, cso->compare_func = sampler->compare_func; { - uint32 r = float_to_ubyte(sampler->border_color[0]); - uint32 g = float_to_ubyte(sampler->border_color[1]); - uint32 b = float_to_ubyte(sampler->border_color[2]); - uint32 a = float_to_ubyte(sampler->border_color[3]); + uint32 r = float_to_ubyte(sampler->border_color.f[0]); + uint32 g = float_to_ubyte(sampler->border_color.f[1]); + uint32 b = float_to_ubyte(sampler->border_color.f[2]); + uint32 a = float_to_ubyte(sampler->border_color.f[3]); cso->bordercolor = (a << 24) | (r << 16) | (g << 8) | b; } diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c index 291a6a29ca5..652ffa7a94b 100644 --- a/src/gallium/drivers/trace/tr_dump_state.c +++ b/src/gallium/drivers/trace/tr_dump_state.c @@ -447,7 +447,7 @@ void trace_dump_sampler_state(const struct pipe_sampler_state *state) trace_dump_member(float, state, lod_bias); trace_dump_member(float, state, min_lod); trace_dump_member(float, state, max_lod); - trace_dump_member_array(float, state, border_color); + trace_dump_member_array(float, state, border_color.f); trace_dump_struct_end(); } |