Erunehtar
Erunehtar

Reputation: 1703

glClearBuffer* clarification

I currently use glClearBuffer* functions to clear draw buffers in a project running in OpenGL ES 3.0. The glClearBuffer documentation states the following:

The glClearBufferfv, glClearBufferiv, and glClearBufferuiv commands should be used to clear fixed-point, signed integer, and unsigned integer color buffers respectively.

Am I right to understand it as follow:

Use glClearBufferfv if draw buffer is GL_FLOAT type
Use glClearBufferiv if draw buffer is GL_INT type
Use glClearBufferuiv if draw buffer is GL_UNSIGNED_INT type

Is that correct? I'm asking because there is no mention (from what I can tell) about the proper way to clear a draw buffer of other types, such as GL_BYTE and GL_UNSIGNED_BYTE.

Thanks!

Upvotes: 2

Views: 1363

Answers (1)

Nicol Bolas
Nicol Bolas

Reputation: 473457

The fv version should be used for buffers with normalized or floating-point image formats. The iv and uiv versions should be used for buffers with signed and unsigned integer formats.

This does not restrict them to a specific format, but general categories of formats. GL_RGBA8UI is an unsigned integer format, as is GL_R32UI.

GL_INT is not any kind of image format.

Upvotes: 2

Related Questions