From f0a24c8c9d842b228d9a01a42ba81835e0bba3f3 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 22 Apr 2021 16:10:32 -0400 Subject: [PATCH] mesa/st: add format-finding capabilities to pbo get_dst_format() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/mesa/state_tracker/st_cb_texture.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 6292d526f6a..d77c578cf30 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -355,26 +355,26 @@ get_dst_format(struct gl_context *ctx, enum pipe_texture_target target, dst_glformat = GL_RGBA32F; break; case PIPE_FORMAT_ETC2_R11_UNORM: - if (!screen->is_format_supported(screen, PIPE_FORMAT_R16_UNORM, - target, 0, 0, bind)) + if (bind && !screen->is_format_supported(screen, PIPE_FORMAT_R16_UNORM, + target, 0, 0, bind)) return PIPE_FORMAT_NONE; dst_glformat = GL_R16; break; case PIPE_FORMAT_ETC2_R11_SNORM: - if (!screen->is_format_supported(screen, PIPE_FORMAT_R16_SNORM, - target, 0, 0, bind)) + if (bind && !screen->is_format_supported(screen, PIPE_FORMAT_R16_SNORM, + target, 0, 0, bind)) return PIPE_FORMAT_NONE; dst_glformat = GL_R16_SNORM; break; case PIPE_FORMAT_ETC2_RG11_UNORM: - if (!screen->is_format_supported(screen, PIPE_FORMAT_R16G16_UNORM, - target, 0, 0, bind)) + if (bind && !screen->is_format_supported(screen, PIPE_FORMAT_R16G16_UNORM, + target, 0, 0, bind)) return PIPE_FORMAT_NONE; dst_glformat = GL_RG16; break; case PIPE_FORMAT_ETC2_RG11_SNORM: - if (!screen->is_format_supported(screen, PIPE_FORMAT_R16G16_SNORM, - target, 0, 0, bind)) + if (bind && !screen->is_format_supported(screen, PIPE_FORMAT_R16G16_SNORM, + target, 0, 0, bind)) return PIPE_FORMAT_NONE; dst_glformat = GL_RG16_SNORM; break;