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 <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
This commit is contained in:
Daniel Stone
2023-07-28 16:51:33 +01:00
committed by Marge Bot
parent 303b935dbd
commit 858ad38f8b

View File

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