renderer: set emulated alpha based on the texture-view format

Texture views with emulated alpha also needs to get their border-color
swizzled. So let's check the texture-view instead of the resource.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Erik Faye-Lund 6 years ago committed by Dave Airlie
parent 4e5e62daa2
commit e95a540a0e
  1. 2
      src/vrend_renderer.c

@ -4975,7 +4975,7 @@ static void vrend_apply_sampler_state(struct vrend_context *ctx,
* the sampler to use the red channel and not the alpha one * the sampler to use the red channel and not the alpha one
* by swizzling the GL_TEXTURE_BORDER_COLOR parameter. * by swizzling the GL_TEXTURE_BORDER_COLOR parameter.
*/ */
bool is_emulated_alpha = vrend_format_is_emulated_alpha(res->base.format); bool is_emulated_alpha = vrend_format_is_emulated_alpha(tview->format);
if (has_feature(feat_samplers)) { if (has_feature(feat_samplers)) {
int sampler = vstate->ids[tview->srgb_decode == GL_SKIP_DECODE_EXT ? 0 : 1]; int sampler = vstate->ids[tview->srgb_decode == GL_SKIP_DECODE_EXT ? 0 : 1];
if (is_emulated_alpha) { if (is_emulated_alpha) {

Loading…
Cancel
Save