Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2019-06-29 12:49:52 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2019-06-29 12:49:52 +0300
commitb73f428739fd2954a9eef3f4640e494120463540 (patch)
tree985df9c8100d036570fa170891f3e4e77fbc9a85 /extra
parent370fead4b2f33d6dd7a690dc506d1a611eb0c798 (diff)
Add DXT1 div table generator.
Diffstat (limited to 'extra')
-rw-r--r--extra/dxt1divtable.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/extra/dxt1divtable.c b/extra/dxt1divtable.c
new file mode 100644
index 00000000..756bc4e1
--- /dev/null
+++ b/extra/dxt1divtable.c
@@ -0,0 +1,22 @@
+#include <stdint.h>
+#include <stdio.h>
+
+int main()
+{
+ for( int i=0; i<255*3; i++ )
+ {
+ // replace 4 with 2 for ARM NEON table
+ uint32_t range = ( 4 << 16 ) / ( 1+i );
+ if( range > 0xFFFF ) range = 0xFFFF;
+ if( i % 16 == 15 )
+ {
+ printf( "0x%04x,\n", range );
+ }
+ else
+ {
+ printf( "0x%04x, ", range );
+ }
+ }
+ printf( "\n" );
+ return 0;
+}