Revert "frontend/dri: allow swapped BGR->RGB channel order for MSAA color buffers"

This reverts commit cfec9a55ea.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16524>
This commit is contained in:
Marek Olšák 2022-05-16 08:16:02 -04:00 committed by Marge Bot
parent ad50daa982
commit 265c9af69e
2 changed files with 4 additions and 25 deletions

View File

@ -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

View File

@ -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) {