mesa/st: implement fallback for rgtc
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Acked-by: Eric Engestrom <eric@igalia.com> Tested-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18248>
This commit is contained in:
committed by
Marge Bot
parent
091e6e37c2
commit
1735053de5
@@ -46,6 +46,7 @@
|
||||
#include "main/texcompress_astc.h"
|
||||
#include "main/texcompress_bptc.h"
|
||||
#include "main/texcompress_etc.h"
|
||||
#include "main/texcompress_rgtc.h"
|
||||
#include "main/texcompress_s3tc.h"
|
||||
#include "main/texgetimage.h"
|
||||
#include "main/teximage.h"
|
||||
@@ -442,6 +443,8 @@ st_compressed_format_fallback(struct st_context *st, mesa_format format)
|
||||
return !st->has_etc2;
|
||||
case MESA_FORMAT_LAYOUT_S3TC:
|
||||
return !st->has_s3tc;
|
||||
case MESA_FORMAT_LAYOUT_RGTC:
|
||||
return !st->has_rgtc;
|
||||
case MESA_FORMAT_LAYOUT_BPTC:
|
||||
return !st->has_bptc;
|
||||
case MESA_FORMAT_LAYOUT_ASTC:
|
||||
@@ -644,6 +647,12 @@ st_UnmapTextureImage(struct gl_context *ctx,
|
||||
itransfer->temp_stride,
|
||||
transfer->box.width, transfer->box.height,
|
||||
texImage->TexFormat);
|
||||
} else if (_mesa_is_format_rgtc(texImage->TexFormat)) {
|
||||
_mesa_unpack_rgtc(map, transfer->stride,
|
||||
itransfer->temp_data,
|
||||
itransfer->temp_stride,
|
||||
transfer->box.width, transfer->box.height,
|
||||
texImage->TexFormat);
|
||||
} else if (_mesa_is_format_bptc(texImage->TexFormat)) {
|
||||
_mesa_unpack_bptc(map, transfer->stride,
|
||||
itransfer->temp_data,
|
||||
|
||||
@@ -124,6 +124,21 @@ st_mesa_format_to_pipe_format(const struct st_context *st,
|
||||
PIPE_FORMAT_R8G8B8A8_UNORM;
|
||||
}
|
||||
|
||||
if ((_mesa_is_format_rgtc(mesaFormat) && !st->has_rgtc)) {
|
||||
switch (mesaFormat) {
|
||||
case MESA_FORMAT_R_RGTC1_UNORM:
|
||||
return PIPE_FORMAT_R8_UNORM;
|
||||
case MESA_FORMAT_R_RGTC1_SNORM:
|
||||
return PIPE_FORMAT_R8_SNORM;
|
||||
case MESA_FORMAT_RG_RGTC2_UNORM:
|
||||
return PIPE_FORMAT_R8G8_UNORM;
|
||||
case MESA_FORMAT_RG_RGTC2_SNORM:
|
||||
return PIPE_FORMAT_R8G8_SNORM;
|
||||
default:
|
||||
unreachable("Unknown RGTC format");
|
||||
}
|
||||
}
|
||||
|
||||
if (_mesa_is_format_bptc(mesaFormat) && !st->has_bptc) {
|
||||
switch (mesaFormat) {
|
||||
case MESA_FORMAT_BPTC_RGB_SIGNED_FLOAT:
|
||||
|
||||
Reference in New Issue
Block a user