summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanley Chery <nanley.g.chery@intel.com>2015-06-15 14:42:24 -0700
committerNanley Chery <nanley.g.chery@intel.com>2015-06-15 14:44:06 -0700
commit0309386e1dd8f89db8febd308dc8663edef4cecc (patch)
tree10ba8c1ab2dcf13d973f59a2b28262970ecb47d7
parent71502b9bab14f784c93f3350ce390ccf06c2cc3b (diff)
Improve cleanup of failed mipmap gen and add correct sRGBs
-rw-r--r--fix_mali_ktx.c1
-rwxr-xr-xmake_ktxes.sh19
2 files changed, 14 insertions, 6 deletions
diff --git a/fix_mali_ktx.c b/fix_mali_ktx.c
index 4fbb45d..812b8f6 100644
--- a/fix_mali_ktx.c
+++ b/fix_mali_ktx.c
@@ -28,6 +28,7 @@ main(int argc, char* argv[])
#define GL_RGBA16F 0x881A
#define GL_RGB16F 0x881B
#define GL_SRGB8_ALPHA8 0x8C43
+#define GL_SRGB8 0x8C41
uint32_t d_hdr[5] = {GL_HALF_FLOAT,
2,
diff --git a/make_ktxes.sh b/make_ktxes.sh
index c967d9a..da1f706 100755
--- a/make_ktxes.sh
+++ b/make_ktxes.sh
@@ -200,11 +200,6 @@ function create_ktx_for_fmt {
break
fi
- # Mali-decompressed HDR ASTCs have the wrong glInternalFormat; correct this.
- if [ "$i" = "hdr" ]; then
- $ktx_fix $outFileK > /dev/null
- fi
-
# Wrap the compressed ASTC in a KTX.
$ktx_gen $outFileA $outFileCK ${ASTC_2D_Enum[($n + $astc_fmt_array_offset)]} > /dev/null
if [ ! -e "$outFileCK" ]; then
@@ -221,9 +216,21 @@ function create_ktx_for_fmt {
# Generate a mipmap from all the miplevel KTXs.
if [ $failed -eq 0 ]; then
$mip_gen $outDirC/ ../${outFileHead}.ktx
- $mip_gen $outDirD/ ../${outFileHead}.ktx
if [ ! -e "$outDirC/../${outFileHead}.ktx" ]; then
echo "$mip_gen $outDirC/ ${inFileHead}.ktx"
+ rm $outDirC/${outFileHead}.ktx
+ fi
+
+ $mip_gen $outDirD/ ../${outFileHead}.ktx
+ if [ ! -e "$outDirD/../${outFileHead}.ktx" ]; then
+ echo "$mip_gen $outDirD/ ${inFileHead}.ktx"
+ rm $outDirD/${outFileHead}.ktx
+ fi
+
+ # Mali-decompressed sRGB & HDR ASTCs have the wrong glInternalFormat; correct this.
+ if [ "$i" = "hdr" -o "$i" = "ldrs" ]; then
+ $ktx_fix $outDirD/../${outFileHead}.ktx > /dev/null
+ #echo "$ktx_fix $outDirD/../${outFileHead}.ktx"
fi
# Delete the miplevels KTXs.