mesa: use gl_buffer_index in a few places

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
Brian Paul 2016-02-23 13:24:11 -07:00
parent 363019e17a
commit c8fdb42c91
3 changed files with 6 additions and 5 deletions

View File

@ -174,7 +174,7 @@ draw_buffer_enum_to_bitmask(const struct gl_context *ctx, GLenum buffer)
* renderbuffer (a BUFFER_* value).
* return -1 for an invalid buffer.
*/
static GLint
static gl_buffer_index
read_buffer_enum_to_index(GLenum buffer)
{
switch (buffer) {
@ -675,7 +675,7 @@ _mesa_update_draw_buffers(struct gl_context *ctx)
*/
void
_mesa_readbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
GLenum buffer, GLint bufferIndex)
GLenum buffer, gl_buffer_index bufferIndex)
{
if ((fb == ctx->ReadBuffer) && _mesa_is_winsys_fbo(fb)) {
/* Only update the per-context READ_BUFFER state if we're bound to
@ -701,7 +701,7 @@ _mesa_read_buffer(struct gl_context *ctx, struct gl_framebuffer *fb,
GLenum buffer, const char *caller)
{
GLbitfield supportedMask;
GLint srcBuffer;
gl_buffer_index srcBuffer;
FLUSH_VERTICES(ctx, 0);

View File

@ -34,6 +34,7 @@
#include "glheader.h"
#include "mtypes.h"
struct gl_context;
struct gl_framebuffer;
@ -66,7 +67,7 @@ _mesa_drawbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
extern void
_mesa_readbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
GLenum buffer, GLint bufferIndex);
GLenum buffer, gl_buffer_index bufferIndex);
extern void
_mesa_update_draw_buffers(struct gl_context *ctx);

View File

@ -1601,7 +1601,6 @@ static void
handle_first_current(struct gl_context *ctx)
{
GLenum buffer;
GLint bufferIndex;
if (ctx->Version == 0) {
/* probably in the process of tearing down the context */
@ -1627,6 +1626,7 @@ handle_first_current(struct gl_context *ctx)
}
if (ctx->ReadBuffer != _mesa_get_incomplete_framebuffer()) {
gl_buffer_index bufferIndex;
if (ctx->ReadBuffer->Visual.doubleBufferMode) {
buffer = GL_BACK;
bufferIndex = BUFFER_BACK_LEFT;