tiburs

glFramebufferTexture2DEXT OpenGL freeze

Discussion created by tiburs on Feb 25, 2010
glFramebufferTexture2D implementation bug

Detaching an already deleted texture while FBO is not bound make the driver to freeze.

 

  GLuint textureId;
  GLuint fboId;

  glGenFramebuffersEXT(1, &fboId);

  glGenTextures(1, &textureId);
  glBindTexture(GL_TEXTURE_2D, textureId);
  glTexImage2D(GL_TEXTURE_2D, 0, 6408, 512, 2, 0, GL_BGRA, GL_UNSIGNED_BYTE, 00000000);
  glBindTexture(GL_TEXTURE_2D, 0);
  glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboId);
  glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, textureId, 0);
  glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
  glDeleteTextures(1, &textureId);
  glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboId);
  //glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, 0);
  glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, 0, 0);
  glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
  glDeleteFramebuffers(1, &fboId);

Outcomes