remove dead code left over after fixing GL_READ/DRAW_BUFFER state issues
This commit is contained in:
@@ -548,53 +548,6 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
GLboolean
|
|
||||||
_mesa_readbuffer_update_fields(GLcontext *ctx, GLenum buffer)
|
|
||||||
{
|
|
||||||
struct gl_framebuffer *fb;
|
|
||||||
GLbitfield supportedMask;
|
|
||||||
GLint srcBuffer;
|
|
||||||
|
|
||||||
fb = ctx->ReadBuffer;
|
|
||||||
|
|
||||||
if (MESA_VERBOSE & VERBOSE_API)
|
|
||||||
_mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(buffer));
|
|
||||||
|
|
||||||
if (fb->Name > 0 && buffer == GL_NONE) {
|
|
||||||
/* This is legal for user-created framebuffer objects */
|
|
||||||
srcBuffer = -1;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* general case / window-system framebuffer */
|
|
||||||
srcBuffer = read_buffer_enum_to_index(buffer);
|
|
||||||
if (srcBuffer == -1) {
|
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glReadBuffer(buffer=0x%x)", buffer);
|
|
||||||
return GL_FALSE;
|
|
||||||
}
|
|
||||||
supportedMask = supported_buffer_bitmask(ctx, fb);
|
|
||||||
if (((1 << srcBuffer) & supportedMask) == 0) {
|
|
||||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glReadBuffer(buffer=0x%x)", buffer);
|
|
||||||
return GL_FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fb->Name == 0) {
|
|
||||||
/* Only update the per-context GL_READ_BUFFER state if we're bound to
|
|
||||||
* a window-system framebuffer.
|
|
||||||
*/
|
|
||||||
ctx->Pixel.ReadBuffer = buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set the FBO's GL_READ_BUFFER state */
|
|
||||||
fb->ColorReadBuffer = buffer;
|
|
||||||
fb->_ColorReadBufferIndex = srcBuffer;
|
|
||||||
|
|
||||||
return GL_TRUE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Like \sa _mesa_drawbuffers(), this is a helper function for setting
|
* Like \sa _mesa_drawbuffers(), this is a helper function for setting
|
||||||
* GL_READ_BUFFER state in the context and current FBO.
|
* GL_READ_BUFFER state in the context and current FBO.
|
||||||
|
@@ -59,11 +59,6 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
|
|||||||
extern void
|
extern void
|
||||||
_mesa_readbuffer(GLcontext *ctx, GLenum buffer, GLint bufferIndex);
|
_mesa_readbuffer(GLcontext *ctx, GLenum buffer, GLint bufferIndex);
|
||||||
|
|
||||||
#if 0
|
|
||||||
extern GLboolean
|
|
||||||
_mesa_readbuffer_update_fields(GLcontext *ctx, GLenum buffer);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern void GLAPIENTRY
|
extern void GLAPIENTRY
|
||||||
_mesa_ReadBuffer( GLenum mode );
|
_mesa_ReadBuffer( GLenum mode );
|
||||||
|
|
||||||
|
@@ -1530,23 +1530,9 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
|
|||||||
*/
|
*/
|
||||||
if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) {
|
if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) {
|
||||||
_mesa_reference_framebuffer(&newCtx->DrawBuffer, drawBuffer);
|
_mesa_reference_framebuffer(&newCtx->DrawBuffer, drawBuffer);
|
||||||
#if 000
|
|
||||||
/* fix up the fb fields - these will end up wrong otherwise
|
|
||||||
if the DRIdrawable changes, and everything relies on them.
|
|
||||||
This is a bit messy (same as needed in _mesa_BindFramebufferEXT) */
|
|
||||||
int i;
|
|
||||||
GLenum buffers[MAX_DRAW_BUFFERS];
|
|
||||||
for(i = 0; i < newCtx->Const.MaxDrawBuffers; i++) {
|
|
||||||
buffers[i] = newCtx->Color.DrawBuffer[i];
|
|
||||||
}
|
|
||||||
_mesa_drawbuffers(newCtx, newCtx->Const.MaxDrawBuffers, buffers, NULL);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) {
|
if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) {
|
||||||
_mesa_reference_framebuffer(&newCtx->ReadBuffer, readBuffer);
|
_mesa_reference_framebuffer(&newCtx->ReadBuffer, readBuffer);
|
||||||
#if 00
|
|
||||||
_mesa_readbuffer_update_fields(newCtx, newCtx->Pixel.ReadBuffer);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX only set this flag if we're really changing the draw/read
|
/* XXX only set this flag if we're really changing the draw/read
|
||||||
|
@@ -1000,20 +1000,8 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
|
|||||||
* XXX check if re-binding same buffer and skip some of this code.
|
* XXX check if re-binding same buffer and skip some of this code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if 000
|
|
||||||
/* for window-framebuffers, re-initialize the fbo values, as they
|
|
||||||
could be wrong (makecurrent with a new drawable while still a fbo
|
|
||||||
was bound will lead to default init fbo values).
|
|
||||||
note that therefore the context ReadBuffer/DrawBuffer values are not
|
|
||||||
valid while fbo's are bound!!! */
|
|
||||||
#endif
|
|
||||||
if (bindReadBuf) {
|
if (bindReadBuf) {
|
||||||
_mesa_reference_framebuffer(&ctx->ReadBuffer, newFbread);
|
_mesa_reference_framebuffer(&ctx->ReadBuffer, newFbread);
|
||||||
#if 000
|
|
||||||
if (!newFbread->Name) {
|
|
||||||
_mesa_readbuffer_update_fields(ctx, ctx->Pixel.ReadBuffer);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bindDrawBuf) {
|
if (bindDrawBuf) {
|
||||||
@@ -1027,17 +1015,6 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
|
|||||||
/* check if newly bound framebuffer has any texture attachments */
|
/* check if newly bound framebuffer has any texture attachments */
|
||||||
check_begin_texture_render(ctx, newFb);
|
check_begin_texture_render(ctx, newFb);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
/* XXX try to remove this: */
|
|
||||||
#if 000
|
|
||||||
GLuint i;
|
|
||||||
GLenum buffers[MAX_DRAW_BUFFERS];
|
|
||||||
for(i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
|
|
||||||
buffers[i] = ctx->Color.DrawBuffer[i];
|
|
||||||
}
|
|
||||||
_mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, buffers, NULL);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->Driver.BindFramebuffer) {
|
if (ctx->Driver.BindFramebuffer) {
|
||||||
|
Reference in New Issue
Block a user