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 6 of 6

Thread: Some stencil fbo code runs on ati but not on nvidia

  1. #1
    Intern Contributor
    Join Date
    Dec 2012
    Posts
    74

    Angry Some stencil fbo code runs on ati but not on nvidia

    I have written a very simple program but with fbos.
    That program can run smoothly under ati card pcs but report error on nvidia card pcs.

    I have tested it on several nvidia cards installed machines. The cause of the program seems to be the blit between stencil buffers.

    The following code is the creation of this fbo.
    Code :
           enum {Color,Depth,Stencil,NumRenderbuffers};
     
           GLuint framebuffer,screenImageFramebuffer, renderbuffer[NumRenderbuffers], screenImageRenderbuffer[NumRenderbuffers];
     
    	glGenRenderbuffersEXT(NumRenderbuffers,renderbuffer);
    	CHECK_ERR;
     
    	glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,renderbuffer[Color]);
    	CHECK_ERR;
     
    	glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,GL_RGBA8,256,256);
    	CHECK_ERR;
     
    	glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,renderbuffer[Stencil]);
    	CHECK_ERR;
     
    	glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,GL_STENCIL_INDEX8,256,256);
    	CHECK_ERR;
     
    	glGenFramebuffersEXT(1, & framebuffer);
    	CHECK_ERR;
     
    	glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT,framebuffer);
    	value=glExtCheckFramebufferStatus(ErrorMessage);
    	CHECK_ERR;
     
    	glFramebufferRenderbufferEXT(GL_DRAW_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_RENDERBUFFER_EXT,renderbuffer[Color]);
    	CHECK_ERR;
     
    	glFramebufferRenderbufferEXT(GL_DRAW_FRAMEBUFFER_EXT,GL_STENCIL_ATTACHMENT_EXT,GL_RENDERBUFFER_EXT,renderbuffer[Stencil]);
    	value=glExtCheckFramebufferStatus(ErrorMessage);                         //Here reported "GL_FRAMEBUFFER_UNSUPPORTED_EXT" on a GTX 650 Ti card.
    	CHECK_ERR;

    Any one can give any hint or another way to write code about blitting between stencil buffers.
    Thanks in advance and good day!

    p.s.
    Personally I have no bias on any graphics card products or manufactories. I'm just an individual developer and just want my idea and program can run on as many hardwares as possible!

    Best regards,

    newbiecow

  2. #2
    Member Regular Contributor Nowhere-01's Avatar
    Join Date
    Feb 2011
    Location
    Novosibirsk
    Posts
    251
    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,GL_ST ENCIL_INDEX8,256,256); -> glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH24_STENCIL8,256,256);

  3. #3
    Intern Contributor
    Join Date
    Dec 2012
    Posts
    74
    Quote Originally Posted by newbiecow View Post
    I have written a very simple program but with fbos.
    That program can run smoothly under ati card pcs but report error on nvidia card pcs.

    I have tested it on several nvidia cards installed machines. The cause of the program seems to be the blit between stencil buffers.

    The following code is the creation of this fbo.
    Code :
           enum {Color,Depth,Stencil,NumRenderbuffers};
     
           GLuint framebuffer,screenImageFramebuffer, renderbuffer[NumRenderbuffers], screenImageRenderbuffer[NumRenderbuffers];
     
    	glGenRenderbuffersEXT(NumRenderbuffers,renderbuffer);
    	CHECK_ERR;
     
    	glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,renderbuffer[Color]);
    	CHECK_ERR;
     
    	glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,GL_RGBA8,256,256);
    	CHECK_ERR;
     
    	glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,renderbuffer[Stencil]);
    	CHECK_ERR;
     
    	glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,GL_STENCIL_INDEX8,256,256);
    	CHECK_ERR;
     
    	glGenFramebuffersEXT(1, & framebuffer);
    	CHECK_ERR;
     
    	glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT,framebuffer);
    	value=glExtCheckFramebufferStatus(ErrorMessage);
    	CHECK_ERR;
     
    	glFramebufferRenderbufferEXT(GL_DRAW_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_RENDERBUFFER_EXT,renderbuffer[Color]);
    	CHECK_ERR;
     
    	glFramebufferRenderbufferEXT(GL_DRAW_FRAMEBUFFER_EXT,GL_STENCIL_ATTACHMENT_EXT,GL_RENDERBUFFER_EXT,renderbuffer[Stencil]);
    	value=glExtCheckFramebufferStatus(ErrorMessage);                         //Here reported "GL_FRAMEBUFFER_UNSUPPORTED_EXT" on a GTX 650 Ti card.
    	CHECK_ERR;

    Any one can give any hint or another way to write code about blitting between stencil buffers.
    Thanks in advance and good day!

    p.s.
    Personally I have no bias on any graphics card products or manufactories. I'm just an individual developer and just want my idea and program can run on as many hardwares as possible!

    Best regards,

    newbiecow

    p.p.s.
    I forgot to remind, the most important, my question is only relevant to opengl coding skills, perhaps referring some hardware but nothing else such as my program or idea. So if you think my idea or program is nonsense and should be tossed into bin, just send me private message to insult as you wish. But as for the question in this thread, please observe the forum guidelines and save the manners.


    Best regards,

    newbiecow

  4. #4
    Member Regular Contributor Nowhere-01's Avatar
    Join Date
    Feb 2011
    Location
    Novosibirsk
    Posts
    251
    that's not the first time here then you get a suggestion, and instead of checking it and reporting result(my post points at exact line containing mistake and the line you should use instead), you posting some irrelevant rubbish. your questions are easy to answer and could be solved with search queries like "opengl stencil fbo". and i could post exact code for blitting stencil between FBO's with some guidelines. but i don't see any point. everyone will just ignore your topics.

  5. #5
    Intern Contributor
    Join Date
    Dec 2012
    Posts
    74

    Talking

    Quote Originally Posted by Nowhere-01 View Post
    that's not the first time here then you get a suggestion, and instead of checking it and reporting result(my post points at exact line containing mistake and the line you should use instead), you posting some irrelevant rubbish. your questions are easy to answer and could be solved with search queries like "opengl stencil fbo". and i could post exact code for blitting stencil between FBO's with some guidelines. but i don't see any point. everyone will just ignore your topics.

    Well. I'm very gratitude to you for your help. After I checked your answer and modified it to something like GL_DEPTH24_STENCIL8, I get my code run smoothly again. But this is not wholy my fault at all. I have an ATI version of such code where if you want to blit between stencil buffers, you have no way of using GL_DEPTH24_STENCIL8 but have to use GL_STENCIL_ATTACHMENT.

    Obviously, I can guess out you are an nvidia developer or at least not tried to do blitting stencil buffers on ATI card. So you know your way but I just the inverse.


    Best regards,

    newbiecow

  6. #6
    Member Regular Contributor Nowhere-01's Avatar
    Join Date
    Feb 2011
    Location
    Novosibirsk
    Posts
    251
    yes, it looks like it is a remaining problem. these topics have some info on how it is usually handled;

    https://www.opengl.org/discussion_bo...BUG-on-ATI-AMD
    https://www.opengl.org/discussion_bo...g-depth-buffer

    according to second topic, method of blitting i supplied to you here should work

    also, just blitting stencil buffer doesn't work for you? you may report it to amd, to remind them.
    you can send a test case to devrel@amd.com (with pierre.boudier@amd.com in CC)
    Last edited by Nowhere-01; 02-07-2013 at 05:45 AM.

Tags for this Thread

Posting Permissions

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