From b73f428739fd2954a9eef3f4640e494120463540 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 29 Jun 2019 11:49:52 +0200 Subject: [PATCH] Add DXT1 div table generator. --- extra/dxt1divtable.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 extra/dxt1divtable.c 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 +#include + +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; +}