From a8cb490193d4011d47f8c1f00702cc05f75a4347 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Fri, 28 Jul 2023 16:54:43 +0100 Subject: [PATCH] st/dri: Reuse stored texture format When we create a texture, we allocate a pipe_resource for it with a given format. When we export the texture 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 82c77bc9693..1c6baa1f98e 100644 --- a/src/gallium/frontends/dri/dri_helpers.c +++ b/src/gallium/frontends/dri/dri_helpers.c @@ -443,7 +443,7 @@ dri2_create_from_texture(__DRIcontext *context, int target, unsigned texture, img->level = level; img->layer = depth; img->in_fence_fd = -1; - img->dri_format = driGLFormatToImageFormat(glimg->TexFormat); + img->dri_format = glimg->pt->format; img->internal_format = glimg->InternalFormat; img->loader_private = loaderPrivate;