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:
@@ -174,7 +174,7 @@ draw_buffer_enum_to_bitmask(const struct gl_context *ctx, GLenum buffer)
|
|||||||
* renderbuffer (a BUFFER_* value).
|
* renderbuffer (a BUFFER_* value).
|
||||||
* return -1 for an invalid buffer.
|
* return -1 for an invalid buffer.
|
||||||
*/
|
*/
|
||||||
static GLint
|
static gl_buffer_index
|
||||||
read_buffer_enum_to_index(GLenum buffer)
|
read_buffer_enum_to_index(GLenum buffer)
|
||||||
{
|
{
|
||||||
switch (buffer) {
|
switch (buffer) {
|
||||||
@@ -675,7 +675,7 @@ _mesa_update_draw_buffers(struct gl_context *ctx)
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_mesa_readbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
|
_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)) {
|
if ((fb == ctx->ReadBuffer) && _mesa_is_winsys_fbo(fb)) {
|
||||||
/* Only update the per-context READ_BUFFER state if we're bound to
|
/* 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)
|
GLenum buffer, const char *caller)
|
||||||
{
|
{
|
||||||
GLbitfield supportedMask;
|
GLbitfield supportedMask;
|
||||||
GLint srcBuffer;
|
gl_buffer_index srcBuffer;
|
||||||
|
|
||||||
FLUSH_VERTICES(ctx, 0);
|
FLUSH_VERTICES(ctx, 0);
|
||||||
|
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "glheader.h"
|
#include "glheader.h"
|
||||||
|
#include "mtypes.h"
|
||||||
|
|
||||||
struct gl_context;
|
struct gl_context;
|
||||||
struct gl_framebuffer;
|
struct gl_framebuffer;
|
||||||
@@ -66,7 +67,7 @@ _mesa_drawbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
|
|||||||
|
|
||||||
extern void
|
extern void
|
||||||
_mesa_readbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
|
_mesa_readbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
|
||||||
GLenum buffer, GLint bufferIndex);
|
GLenum buffer, gl_buffer_index bufferIndex);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
_mesa_update_draw_buffers(struct gl_context *ctx);
|
_mesa_update_draw_buffers(struct gl_context *ctx);
|
||||||
|
@@ -1601,7 +1601,6 @@ static void
|
|||||||
handle_first_current(struct gl_context *ctx)
|
handle_first_current(struct gl_context *ctx)
|
||||||
{
|
{
|
||||||
GLenum buffer;
|
GLenum buffer;
|
||||||
GLint bufferIndex;
|
|
||||||
|
|
||||||
if (ctx->Version == 0) {
|
if (ctx->Version == 0) {
|
||||||
/* probably in the process of tearing down the context */
|
/* 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()) {
|
if (ctx->ReadBuffer != _mesa_get_incomplete_framebuffer()) {
|
||||||
|
gl_buffer_index bufferIndex;
|
||||||
if (ctx->ReadBuffer->Visual.doubleBufferMode) {
|
if (ctx->ReadBuffer->Visual.doubleBufferMode) {
|
||||||
buffer = GL_BACK;
|
buffer = GL_BACK;
|
||||||
bufferIndex = BUFFER_BACK_LEFT;
|
bufferIndex = BUFFER_BACK_LEFT;
|
||||||
|
Reference in New Issue
Block a user