mesa/st: add format-finding capabilities to pbo get_dst_format()

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11982>
This commit is contained in:
Mike Blumenkrantz 2021-04-22 16:10:32 -04:00 committed by Marge Bot
parent 25788721c1
commit f0a24c8c9d
1 changed files with 8 additions and 8 deletions

View File

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