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 <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:54:43 +01:00 committed by Marge Bot
parent 858ad38f8b
commit a8cb490193

View file

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