2 Replies Latest reply on Jun 16, 2010 7:42 AM by deathgate

    FBO dimensions restriction on radeons 1800 and 1900 ?

    dar1243

      Hi

      I have some strange issue with FBO on ATI radeon 1900 and 1800
      (i'v tested under catalyst 9.4, 9.5 and 9.6 under vista x64 and xp sp3 on radeon 1800 and 1900XT)

      the max num of color attachments for that cards is 4 - and i need'em all

      so the code
      int FBOSizeX = 1024;
      int FBOSizeY = 768;

      GLuint ColorTextures[4];
      glGenTextures(4, ColorTextures);

      GLuint FBO;
      glGenFramebuffersEXT(1, &FBO);

      glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBO);

      for (int i = 0; i < 4; i++)
      {
      glBindTexture(GL_TEXTURE_2D, ColorTextures);
      glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, FBOSizeX, FBOSizeY, 0, GL_RGBA, GL_FLOAT, NULL);
      glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
      GL_COLOR_ATTACHMENT0_EXT+i,
      GL_TEXTURE_2D,
      ColorTextures
      ,
      0);
      }

      GLenum Status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);

      // Status == GL_FRAMEBUFFER_COMPLETE_EXT

      GLuint Depth;
      glGenRenderbuffersEXT(1, &Depth);
      glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, Depth);
      glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH24_STENCIL8_EXT, FBOSizeX, FBOSizeY);
      glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);

      //
      // Now bind depth
      //
      glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, Depth);
      glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, Depth);

      GLenum Status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);

      // Status == GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT



      so i cannot render to this fbo
      strangelly on all radeons HD and nvidias this works just fine

      and now more mystery ... if i change FBOSizeY from 768 to 512 ... all works fine
      is there any restrictions on radeons 1800 and 1900 so the depth and color attachments could only be pow(2) ?
      IF i do not bind depth/stencil attachments only 4 color attachments all works perfect
      but if i olso want to bind depth/stencil the dimensions must be pow(2) or error is generated ... what is going on here ?

        • FBO dimensions restriction on radeons 1800 and 1900 ?
          Nillmo

          Hello,

          I'm experiencing the same problem on a X1600 card.

          Except in my case, I can bin a renderbuffer as depth target with NPOT dimension, but not a NPOT depth texture.

          Since I need the depth buffer as texture this is quite anoying. Is there any solution to this?

          I'm using the latest Legacy Catalyst (9.8) on this machine.

            • FBO dimensions restriction on radeons 1800 and 1900 ?
              deathgate

              I am having the same issue... Pls, is there any option how to solve it ? I have X1600 card as well, at first, we thought it's only some notebook driver related stuff, but it behaves the same on Desktop version. What's wrong, I 've spend long time already with googling this one.. and this is only place, where I found something. It would be great to know how to get rid of it. What's the best, .. if I turn off all my OpenGL error checking in app, It renders normally, with function stenciling, shadow maps... etc. no bad visuals... Just a bad behaviour of error reporting ? or something is really wrong ? Pls help!