GLRENDERBUFFERSTORAG(3G)
π GLRENDERBUFFERSTORAG(3G) π
okay so this is from the 3G manual section, and it's literally the whole glow-up guide for glRenderbufferStorageMultisample and glNamedRenderbufferStorageMultisample β two functions that set up the storage, format, dimensions and sample count for a renderbuffer object's image. bestie, this is the "give your renderbuffer a body" page. let's get into it π«Ά
β¨ NAME β¨
glRenderbufferStorageMultisample, glNamedRenderbufferStorageMultisample β establish data storage, format, dimensions and sample count of a renderbuffer object's image π
πΈ C SPECIFICATION πΈ
look at these signatures, they ate:
void glRenderbufferStorageMultisample(GLenum target, GLsizei samples,
GLenum internalformat,
GLsizei width, GLsizei height);
void glNamedRenderbufferStorageMultisample(GLuint renderbuffer,
GLsizei samples,
GLenum internalformat,
GLsizei width,
GLsizei height);
π PARAMETERS π
targetβ this is the binding target of the allocation for theglRenderbufferStorageMultisamplefunction. it must beGL_RENDERBUFFER, no cap, that's the only vibe allowed here β¨renderbufferβ the name of the renderbuffer object, for theglNamedRenderbufferStorageMultisamplefunction. this is the DSA version's way of saying "this one right here, by name" π«Άsamplesβ how many samples you want used for the renderbuffer object's storage. the more the merrier (until the caps say otherwise, we'll get there) πinternalformatβ the internal format to use for the renderbuffer object's image. this is the personality of the storage, basically πwidthβ the width of the renderbuffer, in pixels πheightβ the height of the renderbuffer, in pixels π
π¦ DESCRIPTION π¦
so glRenderbufferStorageMultisample and glNamedRenderbufferStorageMultisample establish the data storage, format, dimensions and number of samples of a renderbuffer object's image. all four things at once, icon behavior honestly π
for glRenderbufferStorageMultisample, the target of the operation β that's the target param β must be GL_RENDERBUFFER. that's non-negotiable bestie. for glNamedRenderbufferStorageMultisample, renderbuffer must be an ID of an existing renderbuffer object (like, an actual one that exists, not a made-up name, we'll get to that in ERRORS and it's giving π).
internalformat specifies the internal format to be used for the renderbuffer object's storage, and it must be a color-renderable, depth-renderable, or stencil-renderable format. one of those three, pick a lane.
width and height are the dimensions, in pixels, of the renderbuffer. both width and height must be less than or equal to the value of GL_MAX_RENDERBUFFER_SIZE. do not test that limit, it will not go well for u π
samples specifies the number of samples to be used for the renderbuffer object's image, and it must be less than or equal to the value of GL_MAX_SAMPLES. and here's the spicy caveat β if internalformat is a signed or unsigned integer format then samples must be less than or equal to the value of GL_MAX_INTEGER_SAMPLES. integer formats get their own, smaller ceiling. iykyk π₯
β οΈ okay this part is important: upon success,glRenderbufferStorageMultisampleandglNamedRenderbufferStorageMultisampledelete any existing data store for the renderbuffer image, and the contents of the data store after calling either of the functions are undefined. undefined!! not zeroed, not preserved, not "probably fine" β undefined. so don't be out here reading old pixels and expecting them to still be there π
π ERRORS π
every way to get yelled at, listed out:
GL_INVALID_ENUMis generated by theglRenderbufferStorageMultisamplefunction iftargetis notGL_RENDERBUFFER.GL_INVALID_OPERATIONis generated by theglNamedRenderbufferStorageMultisamplefunction ifrenderbufferis not the name of an existing renderbuffer object.GL_INVALID_OPERATIONis generated ifsamplesis greater than the maximum number of samples supported forinternalformat.GL_INVALID_ENUMis generated ifinternalformatis not a color-renderable, depth-renderable, or stencil-renderable format.GL_INVALID_OPERATIONis generated ifinternalformatis a signed or unsigned integer format andsamplesis greater than the value ofGL_MAX_INTEGER_SAMPLESGL_INVALID_VALUEis generated if either ofwidthorheightis negative, or greater than the value ofGL_MAX_RENDERBUFFER_SIZE.GL_OUT_OF_MEMORYis generated if the GL is unable to create a data store of the requested size. (the GL said "bestie, i simply cannot" π)
β VERSION SUPPORT β
the original puts this in a big grid, so here's the same tea in list form β every version, every checkmark, nothing skipped π
the columns are OpenGL Version 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, and the cells are either - or β:
glNamedRenderbufferStorageMultisampleβ2.0:-,2.1:-,3.0:-,3.1:-,3.2:-,3.3:-,4.0:-,4.1:-,4.2:-,4.3:-,4.4:-,4.5:βglRenderbufferStorageMultisampleβ2.0:-,2.1:-,3.0:β,3.1:β,3.2:β,3.3:β,4.0:β,4.1:β,4.2:β,4.3:β,4.4:β,4.5:β
so yeah, the named/DSA one is a 4.5-only king π and the classic one showed up in 3.0 and never left. main character energy since 3.0 fr fr π
π SEE ALSO π
go read these next, they're all right there:
glGenRenderbuffers()glBindRenderbuffer()glNamedRenderbufferStorageglRenderbufferStorage()glFramebufferRenderbuffer()glDeleteRenderbuffers()
π COPYRIGHT π
Copyright Β© 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
Copyright Β© 2010-2014 Khronos Group
and that's the page bestie π§β¨ tiny sign-off from the footer: the source is literally listed as [FIXME: source], the date on this one is 08/09/2021, and it goes out as GLRENDERBUFFERSTORAG(3G). go forth and allocate responsibly ππ¦
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms