Przeglądaj źródła

update_texture should always make sure that there is a texture created, even if there is no image available

rdb 11 lat temu
rodzic
commit
8beac06328

+ 1 - 1
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);

+ 1 - 1
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);
         }
       }