summaryrefslogtreecommitdiffstats
path: root/externals/stb/stb_dxt.h
diff options
context:
space:
mode:
authorFernando S <fsahmkow27@gmail.com>2023-05-24 03:55:45 +0200
committerGitHub <noreply@github.com>2023-05-24 03:55:45 +0200
commit76f63889692a0836dafd626841aa050ef26b407b (patch)
tree442b586dc2ead257e4411101b05a06298c97e423 /externals/stb/stb_dxt.h
parentMerge pull request #10388 from GPUCode/fence-wait (diff)
parenttextures: add BC1 and BC3 compressors and recompression setting (diff)
downloadyuzu-76f63889692a0836dafd626841aa050ef26b407b.tar
yuzu-76f63889692a0836dafd626841aa050ef26b407b.tar.gz
yuzu-76f63889692a0836dafd626841aa050ef26b407b.tar.bz2
yuzu-76f63889692a0836dafd626841aa050ef26b407b.tar.lz
yuzu-76f63889692a0836dafd626841aa050ef26b407b.tar.xz
yuzu-76f63889692a0836dafd626841aa050ef26b407b.tar.zst
yuzu-76f63889692a0836dafd626841aa050ef26b407b.zip
Diffstat (limited to 'externals/stb/stb_dxt.h')
-rw-r--r--externals/stb/stb_dxt.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/externals/stb/stb_dxt.h b/externals/stb/stb_dxt.h
new file mode 100644
index 000000000..07d1d1de4
--- /dev/null
+++ b/externals/stb/stb_dxt.h
@@ -0,0 +1,36 @@
+// SPDX-FileCopyrightText: fabian "ryg" giesen
+// SPDX-License-Identifier: MIT
+
+// stb_dxt.h - v1.12 - DXT1/DXT5 compressor
+
+#ifndef STB_INCLUDE_STB_DXT_H
+#define STB_INCLUDE_STB_DXT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef STB_DXT_STATIC
+#define STBDDEF static
+#else
+#define STBDDEF extern
+#endif
+
+// compression mode (bitflags)
+#define STB_DXT_NORMAL 0
+#define STB_DXT_DITHER 1 // use dithering. was always dubious, now deprecated. does nothing!
+#define STB_DXT_HIGHQUAL \
+ 2 // high quality mode, does two refinement steps instead of 1. ~30-40% slower.
+
+STBDDEF void stb_compress_bc1_block(unsigned char* dest,
+ const unsigned char* src_rgba_four_bytes_per_pixel, int alpha,
+ int mode);
+
+STBDDEF void stb_compress_bc3_block(unsigned char* dest, const unsigned char* src, int mode);
+
+#define STB_COMPRESS_DXT_BLOCK
+
+#ifdef __cplusplus
+}
+#endif
+#endif // STB_INCLUDE_STB_DXT_H