6

I am working on an OpenGL application on my laptop. My app shows lots of black and white unrecognizable patterns when I try to display a monochrome image (quite large). I have a hunch that it could be that my old Geforce Go 7950 GTX (512 MB) is too old for my app, and thinking the problem was due to framebuffer object size limit - is there a way to find out what the largest FBO can be?

Adam Lee
  • 2,983
  • 7
  • 35
  • 47

2 Answers2

9

There is no maximum limit to framebuffer size in OpenGL. The limit is the largest texture or renderbuffer that you can attach to it.

There is however a maximum viewport size, get it using GL_MAX_VIEWPORT_DIMS, however according to the OpenGL specs, the viewport is silently clamped the max size anyway and shouldn't cause glitches. https://www.opengl.org/sdk/docs/man/html/glViewport.xhtml

Veger
  • 37,240
  • 11
  • 105
  • 116
Hannesh
  • 7,256
  • 7
  • 46
  • 80
  • as a size note: the value of `GL_MAX_VIEWPORT_DIMS` doesn't have to be POT (it usually *is* on desktop devices, but e.g. I got 3839 x 3839 on NVIDIA Tegra 3), yet on some platforms (OpenGL ES on mobiles mostly) using NPOT textures (or even non-square POT textures) can and will cause trouble - as such I'd advise to get the nearest POT value lower than of the bigger of the two (max H/W, e.g. for T3 it'd be 2048) and use it as an upper bound of both H&W of the FBO being created. This fixed an obscure `GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT` error I was getting. –  Jul 07 '15 at 13:10
3
GLuint dims[2];
glGetIntegerv(GL_MAX_VIEWPORT_DIMS, &dims[0]);

That gives you the maximum width/height of a viewport.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982