From 858ad38f8ba5810f5e4267fcbf2e6fdbc669a30d Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Fri, 28 Jul 2023 16:51:33 +0100 Subject: [PATCH] st/dri: Reuse stored renderbuffer format When we create a renderbuffer, we allocate a pipe_resource for it with a given format. When we export the renderbuffer to an EGLImage, we go look up what the GL format was and try to re-derive the pipe_format back again. Instead of doing that, just immediately reuse the pipe_format for the image's format. Signed-off-by: Daniel Stone Part-of: --- src/gallium/frontends/dri/dri_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/frontends/dri/dri_helpers.c b/src/gallium/frontends/dri/dri_helpers.c index 4c10e6f3d6c..82c77bc9693 100644 --- a/src/gallium/frontends/dri/dri_helpers.c +++ b/src/gallium/frontends/dri/dri_helpers.c @@ -334,7 +334,7 @@ dri2_create_image_from_renderbuffer2(__DRIcontext *context, return NULL; } - img->dri_format = driGLFormatToImageFormat(rb->Format); + img->dri_format = tex->format; img->internal_format = rb->InternalFormat; img->loader_private = loaderPrivate; img->screen = dri_ctx->screen;