summaryrefslogtreecommitdiffstats
path: root/thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp
diff options
context:
space:
mode:
authorK. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>2022-03-24 12:39:24 -0700
committerK. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>2022-03-24 22:41:23 -0700
commit3529141b4bf548218f70a713b4328220a566802d (patch)
treea9e0ba416efc19eda40193522f52659feb865256 /thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp
parentd250f12243a74fd36905f46b983e3c142e3b2e67 (diff)
downloadredot-engine-3529141b4bf548218f70a713b4328220a566802d.tar.gz
Update basis universal to version 1.16.3.
Enable basis universal uastc internal storage instead of etc1s for better quality.
Diffstat (limited to 'thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp')
-rw-r--r--thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp b/thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp
index 3f9fb67bdd..dec769d5ac 100644
--- a/thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp
+++ b/thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp
@@ -15,7 +15,9 @@
#include "basisu_gpu_texture.h"
#include "basisu_enc.h"
#include "basisu_pvrtc1_4.h"
+#if BASISU_USE_ASTC_DECOMPRESS
#include "basisu_astc_decomp.h"
+#endif
#include "basisu_bc7enc.h"
namespace basisu
@@ -1150,8 +1152,12 @@ namespace basisu
}
case texture_format::cASTC4x4:
{
+#if BASISU_USE_ASTC_DECOMPRESS
const bool astc_srgb = false;
basisu_astc::astc::decompress(reinterpret_cast<uint8_t*>(pPixels), static_cast<const uint8_t*>(pBlock), astc_srgb, 4, 4);
+#else
+ memset(pPixels, 255, 16 * sizeof(color_rgba));
+#endif
break;
}
case texture_format::cATC_RGB:
@@ -1498,6 +1504,8 @@ namespace basisu
header.m_pixelWidth = width;
header.m_pixelHeight = height;
+
+ header.m_glTypeSize = 1;
header.m_glInternalFormat = internal_fmt;
header.m_glBaseInternalFormat = base_internal_fmt;