Lines Matching refs:buffer

91                                        GLenum buffer)
93 /* If the front buffer is the only buffer, GL_BACK and all other flags
94 * that include BACK select the front buffer for drawing. There are
102 * "When draw buffer zero is BACK, color values are written
103 * into the sole buffer for single-buffered contexts, or into
104 * the back buffer for double-buffered contexts."
107 * concept of selecting the front and back buffer anyway and it's
116 switch (buffer) {
118 buffer = GL_FRONT;
121 buffer = GL_FRONT_RIGHT;
124 buffer = GL_FRONT_LEFT;
129 return buffer;
138 draw_buffer_enum_to_bitmask(const struct gl_context *ctx, GLenum buffer)
140 buffer = _mesa_back_to_front_if_single_buffered(ctx->DrawBuffer, buffer);
142 switch (buffer) {
187 if (buffer >= GL_COLOR_ATTACHMENT8 && buffer <= GL_COLOR_ATTACHMENT31)
197 * Given a GLenum naming a color buffer, return the index of the corresponding
199 * return BUFFER_NONE for an invalid buffer.
202 read_buffer_enum_to_index(const struct gl_context *ctx, GLenum buffer)
204 buffer = _mesa_back_to_front_if_single_buffered(ctx->ReadBuffer, buffer);
206 switch (buffer) {
248 if (buffer >= GL_COLOR_ATTACHMENT8 && buffer <= GL_COLOR_ATTACHMENT31)
265 * <buffer> can name zero, one, two or four renderbuffers!
268 * \param buffer buffer token such as GL_LEFT or GL_FRONT_AND_BACK, etc.
286 GLenum buffer, const char *caller, bool no_error)
293 _mesa_debug(ctx, "%s %s\n", caller, _mesa_enum_to_string(buffer));
296 if (buffer == GL_NONE) {
302 destMask = draw_buffer_enum_to_bitmask(ctx, buffer);
304 /* totally bogus buffer */
305 _mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid buffer %s)", caller,
306 _mesa_enum_to_string(buffer));
312 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid buffer %s)",
313 caller, _mesa_enum_to_string(buffer));
319 const GLenum16 buffer16 = buffer;
322 /* Call device driver function only if fb is the bound draw buffer */
332 GLenum buffer, const char *caller)
334 draw_buffer(ctx, fb, buffer, caller, false);
340 GLenum buffer, const char *caller)
342 draw_buffer(ctx, fb, buffer, caller, true);
347 _mesa_DrawBuffer_no_error(GLenum buffer)
350 draw_buffer_no_error(ctx, ctx->DrawBuffer, buffer, "glDrawBuffer");
355 _mesa_DrawBuffer(GLenum buffer)
358 draw_buffer_error(ctx, ctx->DrawBuffer, buffer, "glDrawBuffer");
422 * names cannot specify more than one buffer. For example,
485 * into the left buffer for single-buffered contexts, or into the back
486 * left buffer for double-buffered contexts."
508 _mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid buffer %s)",
518 * "Each buffer listed in bufs must be one of the values from tables
522 _mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid buffer %s)",
531 * buffer listed in bufs must be COLOR_ATTACHMENTi or NONE .
532 * Specifying a buffer out of order, BACK , or COLOR_ATTACHMENTm
540 _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffers(buffer)");
579 "%s(unsupported buffer %s)",
585 * "If the GL is bound to a framebuffer object, the ith buffer
594 "%s(unsupported buffer %s)",
600 * "Except for NONE, a buffer may not appear more than once in the
601 * array pointed to by bufs. Specifying a buffer more then once
606 "%s(duplicated buffer %s)",
625 * Call device driver function if fb is the bound draw buffer.
750 * \param fb the desired draw buffer
865 * \param buffer GL_FRONT, GL_BACK, GL_COLOR_ATTACHMENT0, etc.
866 * \param bufferIndex the numerical index corresponding to 'buffer'
870 GLenum buffer, gl_buffer_index bufferIndex)
876 ctx->Pixel.ReadBuffer = buffer;
879 fb->ColorReadBuffer = buffer;
890 * \param mode color buffer such as GL_FRONT, GL_BACK, etc.
894 GLenum buffer, const char *caller, bool no_error)
901 _mesa_debug(ctx, "%s %s\n", caller, _mesa_enum_to_string(buffer));
903 if (buffer == GL_NONE) {
904 /* This is legal--it means that no buffer should be bound for reading. */
910 !is_legal_es3_readbuffer_enum(buffer))
913 srcBuffer = read_buffer_enum_to_index(ctx, buffer);
920 "%s(invalid buffer %s)", caller,
921 _mesa_enum_to_string(buffer));
928 "%s(invalid buffer %s)", caller,
929 _mesa_enum_to_string(buffer));
937 _mesa_readbuffer(ctx, fb, buffer, srcBuffer);
939 /* Call the device driver function only if fb is the bound read buffer */
941 /* Check if we need to allocate a front color buffer.
949 /* add the buffer */
960 GLenum buffer, const char *caller)
962 read_buffer(ctx, fb, buffer, caller, false);
968 GLenum buffer, const char *caller)
970 read_buffer(ctx, fb, buffer, caller, true);
975 _mesa_ReadBuffer_no_error(GLenum buffer)
978 read_buffer_no_error(ctx, ctx->ReadBuffer, buffer, "glReadBuffer");
983 _mesa_ReadBuffer(GLenum buffer)
986 read_buffer_err(ctx, ctx->ReadBuffer, buffer, "glReadBuffer");