From 265c9af69e4c77cef9ced8cb3b0f915ffd95b155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 16 May 2022 08:16:02 -0400 Subject: [PATCH] Revert "frontend/dri: allow swapped BGR->RGB channel order for MSAA color buffers" This reverts commit cfec9a55ea6a1cd535ea60aeff7f7bd85dd64bb5. Reviewed-by: Emma Anholt Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/frontends/dri/dri2.c | 17 ++--------------- src/gallium/frontends/dri/dri_screen.c | 12 ++---------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c index fc1fe9328d5..8ddcae04f1b 100644 --- a/src/gallium/frontends/dri/dri2.c +++ b/src/gallium/frontends/dri/dri2.c @@ -627,26 +627,12 @@ dri2_allocate_textures(struct dri_context *ctx, continue; if (drawable->textures[statt]) { - struct pipe_screen *screen = ctx->st->pipe->screen; - templ.format = drawable->textures[statt]->format; templ.bind = drawable->textures[statt]->bind & ~(PIPE_BIND_SCANOUT | PIPE_BIND_SHARED); templ.nr_samples = drawable->stvis.samples; templ.nr_storage_samples = drawable->stvis.samples; - /* The MSAA component order doesn't have to match the single-sample - * one. Allow the DRI frontend to swap channels for MSAA. - */ - if (!screen->is_format_supported(screen, templ.format, - PIPE_TEXTURE_2D, - templ.nr_samples, - templ.nr_storage_samples, - templ.bind)) { - templ.format = util_format_rgb_to_bgr(templ.format); - assert(templ.format); - } - /* Try to reuse the resource. * (the other resource parameters should be constant) */ @@ -657,7 +643,8 @@ dri2_allocate_textures(struct dri_context *ctx, pipe_resource_reference(&drawable->msaa_textures[statt], NULL); drawable->msaa_textures[statt] = - screen->resource_create(screen, &templ); + screen->base.screen->resource_create(screen->base.screen, + &templ); assert(drawable->msaa_textures[statt]); /* If there are any MSAA resources, we should initialize them diff --git a/src/gallium/frontends/dri/dri_screen.c b/src/gallium/frontends/dri/dri_screen.c index d6d5ca2442c..661cea4cca3 100644 --- a/src/gallium/frontends/dri/dri_screen.c +++ b/src/gallium/frontends/dri/dri_screen.c @@ -546,21 +546,13 @@ dri_fill_in_modes(struct dri_screen *screen) continue; for (i = 1; i <= msaa_samples_max; i++) { - /* The MSAA component order doesn't have to match the single-sample - * one. Allow the DRI frontend to swap channels for MSAA. - */ - enum pipe_format swapped_format = - util_format_rgb_to_bgr(pipe_formats[format]); int samples = i > 1 ? i : 0; if (p_screen->is_format_supported(p_screen, pipe_formats[format], PIPE_TEXTURE_2D, samples, samples, - PIPE_BIND_RENDER_TARGET) || - (swapped_format != PIPE_FORMAT_NONE && - p_screen->is_format_supported(p_screen, swapped_format, - PIPE_TEXTURE_2D, samples, samples, - PIPE_BIND_RENDER_TARGET))) + PIPE_BIND_RENDER_TARGET)) { msaa_modes[num_msaa_modes++] = samples; + } } if (num_msaa_modes) {