PDA

View Full Version : Another problem of multisample, about blit of GL_DEPTH24_STENCIL8_EXT.



newbiecow
12-11-2012, 07:51 AM
Hi, All

Things go that I'm using multisample with GL_DEPTH24_STENCIL8_EXT and blitting between framebuffers. The source framebuffer's code runs:



...
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,renderbu ffer[DepthAndStencil]);
glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFE R_EXT,samples,GL_DEPTH24_STENCIL8_EXT,width,height );
glFramebufferRenderbufferEXT(GL_DRAW_FRAMEBUFFER_E XT,GL_DEPTH_ATTACHMENT_EXT,GL_RENDERBUFFER_EXT,ren derbuffer[DepthAndStencil]);
glFramebufferRenderbufferEXT(GL_DRAW_FRAMEBUFFER_E XT,GL_STENCIL_ATTACHMENT_EXT,GL_RENDERBUFFER_EXT,r enderbuffer[DepthAndStencil]);
...


Another framebuffer that is the target framebuffer goes the same way. But when I try to blit between them as following



glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT,srcfr amebuffer);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT,targe tframebuffer);

glBlitFramebufferEXT(0,0,width,height,0,0,width,he ight,GL_DEPTH_BUFFER_BIT,GL_NEAREST); // *


the line * cause a memory access fault.

So how to modify the code to fulfill the task of this blit? Anyone can help me?

Dark Photon, can you help me?


Best Regards,

newbiecow

newbiecow
12-11-2012, 09:21 PM
Hi, All

Things go that I'm using multisample with GL_DEPTH24_STENCIL8_EXT and blitting between framebuffers. The source framebuffer's code runs:



...
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,renderbu ffer[DepthAndStencil]);
glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFE R_EXT,samples,GL_DEPTH24_STENCIL8_EXT,width,height );
glFramebufferRenderbufferEXT(GL_DRAW_FRAMEBUFFER_E XT,GL_DEPTH_ATTACHMENT_EXT,GL_RENDERBUFFER_EXT,ren derbuffer[DepthAndStencil]);
glFramebufferRenderbufferEXT(GL_DRAW_FRAMEBUFFER_E XT,GL_STENCIL_ATTACHMENT_EXT,GL_RENDERBUFFER_EXT,r enderbuffer[DepthAndStencil]);
...


Another framebuffer that is the target framebuffer goes the same way. But when I try to blit between them as following



glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT,srcfr amebuffer);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT,targe tframebuffer);

glBlitFramebufferEXT(0,0,width,height,0,0,width,he ight,GL_DEPTH_BUFFER_BIT,GL_NEAREST); // *


the line * cause a memory access fault.

So how to modify the code to fulfill the task of this blit? Anyone can help me?

Dark Photon, can you help me?


Best Regards,

newbiecow


Anyone can give any advice?

Thanks in advance!

thokra
12-12-2012, 12:52 AM
What GPU do you have, what is your GL target version? Is GL_EXT_framebuffer_blit or GL_ARB_framebuffer_object supported by your current GPU and driver?

Dark Photon
12-12-2012, 05:54 AM
Need some more code. A small stand-alone test program that illustrates your problem would be good.

newbiecow
12-12-2012, 10:54 PM
Need some more code. A small stand-alone test program that illustrates your problem would be good.

Thanks for your help, Dark Photon.
It seems an implemention-dependent problem. I decided to try other ways to evade this one.
Thank you all the same.


Best Regards,

newbiecow