diff options
author | Nanley Chery <nanley.g.chery@intel.com> | 2016-02-08 14:20:03 -0800 |
---|---|---|
committer | Nanley Chery <nanley.g.chery@intel.com> | 2016-02-08 14:26:02 -0800 |
commit | 0b6e493d0b3027947d695ced835bd16933856a3e (patch) | |
tree | 0cc298b4c49489114ae8088d7e79b5db897ae24f | |
parent | 37ddeac9ae7ff5fd83fd3112566b651f12817e73 (diff) |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |