summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanley Chery <nanley.g.chery@intel.com>2015-07-23 10:29:43 -0700
committerNanley Chery <nanley.g.chery@intel.com>2015-07-23 10:38:23 -0700
commit21ab5a30c8d769b01d08e0a5ff300010da0f7cb0 (patch)
treeeba38e7f8a2c38366024a7da7cde397840e18e7a
parent4d556c1b03c98f39aabaf6e50a2c0d2aef02520e (diff)
include 2d texture array generation in main script
-rw-r--r--gen_array.c4
-rwxr-xr-xmake_ktxes.sh7
2 files changed, 9 insertions, 2 deletions
diff --git a/gen_array.c b/gen_array.c
index 0ecc5b5..81e3a7f 100644
--- a/gen_array.c
+++ b/gen_array.c
@@ -80,7 +80,7 @@ main(int argc, char *argv[])
{
/* Get arguments */
char * filename = argv[1];
- int miplevels = atoi(argv[2]);
+ int miplevels = atoi(argv[2]) + 1;
int arg_offset = 3;
unsigned imgs = argc - arg_offset;
@@ -127,10 +127,10 @@ main(int argc, char *argv[])
for (cur_img = 0; cur_img < imgs; ++cur_img) {
char * cur_file = argv[cur_img+arg_offset];
- printf("%s\n", cur_file);
/* Read in the files into memory */
if (cur_lev == 0) {
+ printf("%s\n", cur_file);
GLenum my_gl_error;
files[cur_img] = piglit_ktx_read_file(cur_file);
piglit_ktx_load_texture(files[cur_img], &tex[cur_img], &my_gl_error);
diff --git a/make_ktxes.sh b/make_ktxes.sh
index 14f8940..2bccd51 100755
--- a/make_ktxes.sh
+++ b/make_ktxes.sh
@@ -115,6 +115,7 @@ encoder=./astc-encoder/Source/astcenc
ktx_fix=./fix_mali_ktx
ktx_gen=./gen_ktx
mip_gen=./gen_mipmaps
+arr_gen=./gen_array
# Global variables
compressed_dir=../compressed
@@ -237,6 +238,12 @@ function create_ktx_for_fmt {
rm -rf $outDirC $outDirD
fi
done
+
+ # Generate the 2D texture array
+ run_cmd "$arr_gen $decompressed_dir/$i/${inFileHead}.ktx $MAX_LEVEL `ls -vd $decompressed_dir/$i/* | grep ktx`" $decompressed_dir/$i/${inFileHead}.ktx
+ if [ $failed -eq 1 ]; then
+ rm $outDirD/${inFileHead}.ktx
+ fi
}