radeonsi: use all built-in border colors
authorMarek Olšák <marek.olsak@amd.com>
Sun, 30 Aug 2015 11:17:15 +0000 (13:17 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 1 Sep 2015 19:51:15 +0000 (21:51 +0200)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
src/gallium/drivers/radeonsi/si_state.c

index 7f4e846cd16c0c7f37f3745d602da6833c1a7f1f..52fa8fec033664ae2c14c8661431a9a34fa7ea5d 100644 (file)
@@ -2709,10 +2709,25 @@ static void *si_create_sampler_state(struct pipe_context *ctx,
                return NULL;
        }
 
-       if (sampler_state_needs_border_color(state))
-               border_color_type = V_008F3C_SQ_TEX_BORDER_COLOR_REGISTER;
-       else
+       if (!sampler_state_needs_border_color(state))
+               border_color_type = V_008F3C_SQ_TEX_BORDER_COLOR_TRANS_BLACK;
+       else if (state->border_color.f[0] == 0 &&
+                state->border_color.f[1] == 0 &&
+                state->border_color.f[2] == 0 &&
+                state->border_color.f[3] == 0)
                border_color_type = V_008F3C_SQ_TEX_BORDER_COLOR_TRANS_BLACK;
+       else if (state->border_color.f[0] == 0 &&
+                state->border_color.f[1] == 0 &&
+                state->border_color.f[2] == 0 &&
+                state->border_color.f[3] == 1)
+               border_color_type = V_008F3C_SQ_TEX_BORDER_COLOR_OPAQUE_BLACK;
+       else if (state->border_color.f[0] == 1 &&
+                state->border_color.f[1] == 1 &&
+                state->border_color.f[2] == 1 &&
+                state->border_color.f[3] == 1)
+               border_color_type = V_008F3C_SQ_TEX_BORDER_COLOR_OPAQUE_WHITE;
+       else
+               border_color_type = V_008F3C_SQ_TEX_BORDER_COLOR_REGISTER;
 
        rstate->val[0] = (S_008F30_CLAMP_X(si_tex_wrap(state->wrap_s)) |
                          S_008F30_CLAMP_Y(si_tex_wrap(state->wrap_t)) |