aboutsummaryrefslogtreecommitdiff
path: root/sokol_gfx.h
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2018-10-19 11:21:57 +0200
committerAndre Weissflog <floooh@gmail.com>2018-10-19 11:21:57 +0200
commit3cd74ad851d335c23272fa0e745a9c986f700377 (patch)
tree119a61c53d806483d8864708a9e430ca51dc5c0c /sokol_gfx.h
parent7a8076a1dcb150fcf13e58484fff9f1dbdebd2c1 (diff)
sokol_gfx.h GL: fix mip_depth computation for array textures (fixes #81)
Diffstat (limited to 'sokol_gfx.h')
-rw-r--r--sokol_gfx.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sokol_gfx.h b/sokol_gfx.h
index 85cb77b7..bbcd3677 100644
--- a/sokol_gfx.h
+++ b/sokol_gfx.h
@@ -3007,7 +3007,10 @@ _SOKOL_PRIVATE void _sg_create_image(_sg_image* img, const sg_image_desc* desc)
}
#if !defined(SOKOL_GLES2)
else if (!_sg_gl_gles2 && ((SG_IMAGETYPE_3D == img->type) || (SG_IMAGETYPE_ARRAY == img->type))) {
- int mip_depth = img->depth >> mip_index;
+ int mip_depth = img->depth;
+ if (SG_IMAGETYPE_3D == img->type) {
+ mip_depth >>= mip_index;
+ }
if (mip_depth == 0) {
mip_depth = 1;
}