## Name

glInvalidateSubFramebuffer, glInvalidateNamedFramebufferSubData — invalidate the content of a region of some or all of a framebuffer's attachments

## C Specification

`void glInvalidateSubFramebuffer(` | GLenum target,
| GLsizei numAttachments,
| const GLenum * attachments,
| GLint x,
| GLint y,
| GLint width,
| GLint height`)`;

`void glInvalidateNamedFramebufferSubData(` | GLuint framebuffer,
| GLsizei numAttachments,
| const GLenum *attachments,
| GLint x,
| GLint y,
| GLsizei width,
| GLsizei height`)`;

## Parameters

`target`

  Specifies the target to which the framebuffer object is attached for `glInvalidateSubFramebuffer`.

`framebuffer`

  Specifies the name of the framebuffer object for `glInvalidateNamedFramebufferSubData`.

`numAttachments`

  Specifies the number of entries in the `attachments` array.

`attachments`

  Specifies a pointer to an array identifying the attachments to be invalidated.

`x`

  Specifies the X offset of the region to be invalidated.

`y`

  Specifies the Y offset of the region to be invalidated.

`width`

  Specifies the width of the region to be invalidated.

`height`

  Specifies the height of the region to be invalidated.

## Description

`glInvalidateSubFramebuffer` and `glInvalidateNamedFramebufferSubData` invalidate the contents of a specified region of a specified set of attachments of a framebuffer.

For `glInvalidateSubFramebuffer`, the framebuffer object is that bound to `target`, which must be one of `GL_FRAMEBUFFER`, `GL_READ_FRAMEBUFFER` or `GL_DRAW_FRAMEBUFFER`. `GL_FRAMEBUFFER` is equivalent to `GL_DRAW_FRAMEBUFFER`. Default framebuffers may also be invalidated if bound to `target`.

For `glInvalidateNamedFramebufferSubData`, `framebuffer` is the name of the framebuffer object. If `framebuffer` is zero, the default draw framebuffer is affected.

The set of attachments of which a region is to be invalidated are specified in the `attachments` array, which contains `numAttachments` elements.

If the specified framebuffer is a framebuffer object, each element of `attachments` must be one of `GL_DEPTH_ATTACHMENT`, `GL_STENCIL_ATTACHMENT` `GL_DEPTH_STENCIL_ATTACHMENT`, or `GL_COLOR_ATTACHMENT` i, where i is between zero and the value of `GL_MAX_FRAMEBUFFER_ATTACHMENTS` minus one.

If the specified framebuffer is a default framebuffer, each element of `attachments` must be one of `GL_FRONT_LEFT`, `GL_FRONT_RIGHT`, `GL_BACK_LEFT`, `GL_BACK_RIGHT`, `GL_AUX` i, `GL_ACCUM`, `GL_COLOR`, `GL_DEPTH`, or `GL_STENCIL`. `GL_COLOR`, is treated as `GL_BACK_LEFT` for a double-buffered context and `GL_FRONT_LEFT` for a single-buffered context. The other attachments identify the corresponding specific buffer.

The contents of the specified region of each specified attachment become undefined after execution of `glInvalidateSubFramebuffer` or `glInvalidateNamedFramebufferSubData`. The region to be invalidated is specified by `x`, `y`, `width` and `height` where `x` and `y` give the offset from the origin (with lower-left corner at $(0,0)$) and `width` and `height` are the width and height, respectively, of the region. Any pixels lying outside of the window allocated to the current GL context (for the default framebuffer), or outside of the attachments of the framebuffer object, are ignored. If the framebuffer object is not complete, these commands may be ignored.

If the framebuffer object is not complete, `glInvalidateSubFramebuffer` and `glInvalidateNamedFramebufferSubData` may be ignored. This is not an error.

## Errors

`GL_INVALID_ENUM` by `glInvalidateSubFramebuffer` if `target` is not one of the accepted framebuffer targets.

`GL_INVALID_OPERATION` by `glInvalidateNamedFramebufferSubData` if `framebuffer` is not zero of the name of an existing framebuffer object.

`GL_INVALID_VALUE` is generated if `numAttachments`, `width` or `height` is negative.

`GL_INVALID_ENUM` is generated if any element of `attachments` is not one of the accepted framebuffer attachment points, as described above.

`GL_INVALID_OPERATION` is generated if element of `attachments` is `GL_COLOR_ATTACHMENT` m where m is greater than or equal to the value of `GL_MAX_COLOR_ATTACHMENTS`.

## Associated Gets

glGet with argument `GL_MAX_COLOR_ATTACHMENTS`

## Version Support

| OpenGL Version
--- | ---
Function / Feature Name | 2.0 | 2.1 | 3.0 | 3.1 | 3.2 | 3.3 | 4.0 | 4.1 | 4.2 | 4.3 | 4.4 | 4.5
`glInvalidateNamedFramebufferSubData` | - | - | - | - | - | - | - | - | - | - | - | ✔
`glInvalidateSubFramebuffer` | - | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔

## See Also

glInvalidateTexSubImage, glInvalidateTexImage, glInvalidateBufferSubData, glInvalidateBufferData, glInvalidateFramebuffer.

## Copyright

Copyright © 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/.