mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
st/mesa: return appropriate mesa format for ETC texture formats
Even when the backend driver does not support ETC formats, we handle the
decoding into an uncompressed backing texture. However as far as core
mesa is concerned, it's an ETC texture and we should return the relevant
ETC mesa format. This condition can get hit when using glTexStorage to
create the texture object.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 00d4315d37)
This commit is contained in:
parent
e7de53fefd
commit
1ed8237b1a
1 changed files with 7 additions and 0 deletions
|
|
@ -37,6 +37,7 @@
|
|||
#include "main/enums.h"
|
||||
#include "main/formats.h"
|
||||
#include "main/glformats.h"
|
||||
#include "main/texcompress.h"
|
||||
#include "main/texgetimage.h"
|
||||
#include "main/teximage.h"
|
||||
#include "main/texstore.h"
|
||||
|
|
@ -2282,6 +2283,12 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
|
|||
}
|
||||
|
||||
if (pFormat == PIPE_FORMAT_NONE) {
|
||||
/* lie about using etc1/etc2 natively if we do decoding tricks */
|
||||
mFormat = _mesa_glenum_to_compressed_format(internalFormat);
|
||||
if ((mFormat == MESA_FORMAT_ETC1_RGB8 && !st->has_etc1) ||
|
||||
(_mesa_is_format_etc2(mFormat) && !st->has_etc2))
|
||||
return mFormat;
|
||||
|
||||
/* no luck at all */
|
||||
return MESA_FORMAT_NONE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue