summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanley Chery <nanley.g.chery@intel.com>2016-02-08 14:20:03 -0800
committerNanley Chery <nanley.g.chery@intel.com>2016-02-08 14:26:02 -0800
commit0b6e493d0b3027947d695ced835bd16933856a3e (patch)
tree0cc298b4c49489114ae8088d7e79b5db897ae24f
parent37ddeac9ae7ff5fd83fd3112566b651f12817e73 (diff)
gen_ktx: Fix pixelDepth value for 3D texturesHEADmaster
The former formula was hard-coded to handle 2D textures, which should have a depth value of 0. 3D textures, however, should have a pixelDepth value equal to the actual depth of the texture. Reported-by: Anuj Phogat <anuj.phogat@gmail.com> Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
-rw-r--r--gen_ktx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gen_ktx.c b/gen_ktx.c
index dac7a53..6cc8743 100644
--- a/gen_ktx.c
+++ b/gen_ktx.c
@@ -28,7 +28,7 @@ format_ktx_header(astc_header* header, GLenum format, KTX_texture_info * kti)
kti->glBaseInternalFormat = GL_RGBA;
kti->pixelWidth = get_val(header->xsize);
kti->pixelHeight = get_val(header->ysize);
- kti->pixelDepth = get_val(header->zsize) - 1;
+ kti->pixelDepth = get_val(header->zsize) > 1 ? get_val(header->zsize) : 0;
kti->numberOfArrayElements = 0; // assuming array texture
kti->numberOfFaces = 1; // assuming not cubemap or cubemap array
kti->numberOfMipmapLevels = 1; // assuming only 1 miplevel