renderer: swizzle sampler border color channel if we emulate alpha format

(this got a bit mangled in patchwork, I undid that)
Reviewed-by: Dave Airlie <airlied@redhat.com>
macos/master
Erik Faye-Lund 6 years ago committed by Dave Airlie
parent 0fb73b11e4
commit 6a4ef6d8a2
  1. 12
      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) 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); glTexParameterIuiv(target, GL_TEXTURE_BORDER_COLOR, state->border_color.ui);
}
tex->state = *state; tex->state = *state;
} }

Loading…
Cancel
Save