Browse Source

more fixes from update_texture() changes

David Rose 17 years ago
parent
commit
7cb642fc2f

+ 4 - 2
panda/src/glstuff/glGraphicsBuffer_src.cxx

@@ -315,7 +315,7 @@ bind_slot(bool rb_resize, Texture **attach, RenderTexturePlane slot, GLenum atta
       TextureContext *tc = tex->prepare_now(glgsg->get_prepared_objects(), glgsg);
       TextureContext *tc = tex->prepare_now(glgsg->get_prepared_objects(), glgsg);
       nassertv(tc != (TextureContext *)NULL);
       nassertv(tc != (TextureContext *)NULL);
       CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc);
       CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc);
-      glgsg->apply_texture(tc);
+      glgsg->update_texture(tc, true);
       if (tex->get_texture_type() == Texture::TT_2d_texture) {
       if (tex->get_texture_type() == Texture::TT_2d_texture) {
         glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
         glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
                                        GL_TEXTURE_2D, gtc->_index, 0);
                                        GL_TEXTURE_2D, gtc->_index, 0);
@@ -339,7 +339,7 @@ bind_slot(bool rb_resize, Texture **attach, RenderTexturePlane slot, GLenum atta
       TextureContext *tc = tex->prepare_now(glgsg->get_prepared_objects(), glgsg);
       TextureContext *tc = tex->prepare_now(glgsg->get_prepared_objects(), glgsg);
       nassertv(tc != (TextureContext *)NULL);
       nassertv(tc != (TextureContext *)NULL);
       CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc);
       CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc);
-      glgsg->apply_texture(tc);
+      glgsg->update_texture(tc, true);
       if (tex->get_texture_type() == Texture::TT_2d_texture) {
       if (tex->get_texture_type() == Texture::TT_2d_texture) {
         glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, attachpoint,
         glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, attachpoint,
                                        GL_TEXTURE_2D, gtc->_index, 0);
                                        GL_TEXTURE_2D, gtc->_index, 0);
@@ -442,6 +442,7 @@ generate_mipmaps() {
       TextureContext *tc = tex->prepare_now(glgsg->get_prepared_objects(), glgsg);
       TextureContext *tc = tex->prepare_now(glgsg->get_prepared_objects(), glgsg);
       nassertv(tc != (TextureContext *)NULL);
       nassertv(tc != (TextureContext *)NULL);
       CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc);
       CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc);
+      glgsg->update_texture(tc, true);
       GLenum target = glgsg->get_texture_target(tex->get_texture_type());
       GLenum target = glgsg->get_texture_target(tex->get_texture_type());
       GLP(BindTexture)(target, gtc->_index);
       GLP(BindTexture)(target, gtc->_index);
       glgsg->_glGenerateMipmap(target);
       glgsg->_glGenerateMipmap(target);
@@ -516,6 +517,7 @@ select_cube_map(int cube_map_index) {
     TextureContext *tc = tex->prepare_now(glgsg->get_prepared_objects(), glgsg);
     TextureContext *tc = tex->prepare_now(glgsg->get_prepared_objects(), glgsg);
     nassertv(tc != (TextureContext *)NULL);
     nassertv(tc != (TextureContext *)NULL);
     CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc);
     CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc);
+    glgsg->update_texture(tc, true);
     glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, _attach_point[i],
     glgsg->_glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, _attach_point[i],
                                    GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + cube_map_index,
                                    GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + cube_map_index,
                                    gtc->_index, 0);
                                    gtc->_index, 0);

+ 0 - 1
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -7061,7 +7061,6 @@ upload_texture(CLP(TextureContext) *gtc, bool force) {
   return false;
   return false;
 }
 }
 
 
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: GLGraphicsStateGuardian::upload_texture_image
 //     Function: GLGraphicsStateGuardian::upload_texture_image
 //       Access: Protected
 //       Access: Protected