diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 8aec994..2298a59 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -4241,8 +4241,18 @@ static void vrend_apply_sampler_state(struct vrend_context *ctx, } } - if (memcmp(&tex->state.border_color, &state->border_color, 16) || set_all) - glTexParameterIuiv(target, GL_TEXTURE_BORDER_COLOR, state->border_color.ui); + bool is_emulated_alpha = vrend_format_is_emulated_alpha(res->base.format); + if (memcmp(&tex->state.border_color, &state->border_color, 16) || set_all || + is_emulated_alpha) { + if (is_emulated_alpha) { + union pipe_color_union border_color; + border_color = vstate->base.border_color; + border_color.ui[0] = border_color.ui[3]; + border_color.ui[3] = 0; + glTexParameterIuiv(target, GL_TEXTURE_BORDER_COLOR, border_color.ui); + } else + glTexParameterIuiv(target, GL_TEXTURE_BORDER_COLOR, state->border_color.ui); + } tex->state = *state; }