From 8beac0632808db822a8dd4c8c58652aadd7c27ca Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 20 Jun 2014 15:04:39 +0000 Subject: [PATCH] update_texture should always make sure that there is a texture created, even if there is no image available --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 2 +- panda/src/glstuff/glShaderContext_src.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index cc63b1177e..9d981375ee 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -3690,7 +3690,7 @@ update_texture(TextureContext *tc, bool force) { CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc); - if (gtc->was_image_modified()) { + if (gtc->was_image_modified() || !gtc->_already_applied) { // If the texture image was modified, reload the texture. This // means we also re-specify the properties for good measure. specify_texture(gtc); diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 3bd245c234..54b6fbfcdd 100755 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -1540,7 +1540,7 @@ update_shader_texture_bindings(CLP(ShaderContext) *prev, GSG *gsg) { CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tex->prepare_now(view, gsg->_prepared_objects, gsg)); if (gtc != (TextureContext*)NULL) { gl_tex = gtc->_index; - gsg->update_texture(gtc, false); + gsg->update_texture(gtc, true); } }