From 3b4d4b0804ae7539bd271cbc7812311ee268c12c Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 30 Apr 2018 19:13:54 -0400 Subject: [PATCH] glgsg: fix broken upload of downscaled texture without mipmaps Fixes #306 --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 97917acee0..f5a42e2e45 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -12647,7 +12647,7 @@ upload_texture_image(CLP(TextureContext) *gtc, bool needs_reload, int depth = tex->get_expected_mipmap_z_size(mipmap_bias); // Determine the number of images to upload. - int num_levels = 1; + int num_levels = mipmap_bias + 1; if (uses_mipmaps) { num_levels = tex->get_expected_num_mipmap_levels(); }