Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: glBlitFramebuffer crash with msaa depth -> msaa depth blit on Radeon HD 4800

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2010
    Posts
    4

    glBlitFramebuffer crash with msaa depth -> msaa depth blit on Radeon HD 4800

    The following code crashes on a Radeon HD 4800 (Win7 64-bit, latest drivers)

    Code :
    	GLuint fbo1 = 0;	
     
    	// setup FBO 1
    	{		
    		glGenFramebuffers(1, &fbo1);
    		glBindFramebuffer(GL_FRAMEBUFFER, fbo1);
     
    		GLuint rb1 = 0;
    		glGenRenderbuffers(1, &rb1);
    		glBindRenderbuffer(GL_RENDERBUFFER, rb1);
    		glRenderbufferStorageMultisample(GL_RENDERBUFFER, 4, GL_DEPTH24_STENCIL8, 1024, 1024);
    		//glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 1024, 1024);
     
     
    		glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rb1);
    		glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rb1);
     
     
    		glReadBuffer(GL_NONE);
    		glDrawBuffer(GL_NONE);
     
     
    		GLenum fboStatus1 = glCheckFramebufferStatus(GL_FRAMEBUFFER);
    		assert(fboStatus1 == GL_FRAMEBUFFER_COMPLETE);
     
     
    		check_gl_error();
    	}
     
     
    	GLuint fbo2 = 0;	
     
     
    	// setup FBO 2
    	{		
    		glGenFramebuffers(1, &fbo2);
    		glBindFramebuffer(GL_FRAMEBUFFER, fbo2);
     
     
    		GLuint rb2 = 0;	
    		glGenRenderbuffers(1, &rb2);
    		glBindRenderbuffer(GL_RENDERBUFFER, rb2);
    		glRenderbufferStorageMultisample(GL_RENDERBUFFER, 4, GL_DEPTH24_STENCIL8, 1024, 1024);
    		//glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 1024, 1024);
     
     
    		glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rb2);
    		glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rb2);
     
     
    		glReadBuffer(GL_NONE);
    		glDrawBuffer(GL_NONE);
     
     
    		GLenum fboStatus2 = glCheckFramebufferStatus(GL_FRAMEBUFFER);
    		assert(fboStatus2 == GL_FRAMEBUFFER_COMPLETE);
     
     
    		check_gl_error();
    	}
     
     
    	glBindFramebuffer(GL_FRAMEBUFFER,0);
     
     
    	glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo1);
    	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo2);
     
     
    	GLenum readStatus = glCheckFramebufferStatus(GL_READ_FRAMEBUFFER);
    	assert(readStatus == GL_FRAMEBUFFER_COMPLETE);
     
     
    	GLenum drawStatus = glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);
    	assert(drawStatus == GL_FRAMEBUFFER_COMPLETE);
     
     
    	check_gl_error();
     
     
    	// crash here
    	glBlitFramebuffer(0, 0, 1024, 1024, 0, 0, 1024, 1024, GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_NEAREST);

    Is this code somehow incorrect, or is this probably a bug in AMD's drivers?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,537
    In general, unless you're throwing a pointer at the implementation, a crash is always a driver bug.

  3. #3
    Junior Member Regular Contributor Nowhere-01's Avatar
    Join Date
    Feb 2011
    Location
    Novosibirsk
    Posts
    134
    try blitting depth and stencil separately in two glBlitFramebuffer calls. if it works, report here a driver bug. i've already seen topics mentioning that AMD drivers fail to blit depth and stencil together.
    I am a star's ray through billions of years
    Piercing through the weakness of optic nerve
    I am the blade of sparkling "no"
    Ripping up the pregnancy of joy

  4. #4
    Junior Member Newbie
    Join Date
    Dec 2010
    Posts
    4
    Quote Originally Posted by Nowhere-01 View Post
    try blitting depth and stencil separately in two glBlitFramebuffer calls. if it works, report here a driver bug. i've already seen topics mentioning that AMD drivers fail to blit depth and stencil together.
    It crashes when blitting just depth too. I added the stencil bit thinking maybe the problem was with blitting just one half of the packed depth-stencil buffer. I reported at the AMD forums already, I was just hoping someone here might spot something in my usage that isn't correct.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •