Remove last remnants of pre-renderbuffer code.
This commit is contained in:
@@ -138,8 +138,8 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
|||||||
driver->ColorMask = NULL;
|
driver->ColorMask = NULL;
|
||||||
driver->ColorMaterial = NULL;
|
driver->ColorMaterial = NULL;
|
||||||
driver->CullFace = NULL;
|
driver->CullFace = NULL;
|
||||||
driver->DrawBuffer = _swrast_DrawBuffer;
|
driver->DrawBuffer = NULL;
|
||||||
driver->DrawBuffers = NULL; /***_swrast_DrawBuffers;***/
|
driver->DrawBuffers = NULL;
|
||||||
driver->FrontFace = NULL;
|
driver->FrontFace = NULL;
|
||||||
driver->DepthFunc = NULL;
|
driver->DepthFunc = NULL;
|
||||||
driver->DepthMask = NULL;
|
driver->DepthMask = NULL;
|
||||||
|
@@ -317,8 +317,4 @@
|
|||||||
#define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1)
|
#define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1)
|
||||||
|
|
||||||
|
|
||||||
/* XXX everything marked with OLD_RENDERBUFFER will be going away... */
|
|
||||||
#define OLD_RENDERBUFFER 1
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CONFIG_H */
|
#endif /* CONFIG_H */
|
||||||
|
@@ -462,7 +462,6 @@ get_renderbuffer(struct gl_framebuffer *fb, GLuint bufferBit)
|
|||||||
* Update state related to the current draw/read framebuffers.
|
* Update state related to the current draw/read framebuffers.
|
||||||
* Specifically, update these framebuffer fields:
|
* Specifically, update these framebuffer fields:
|
||||||
* _ColorDrawBuffers
|
* _ColorDrawBuffers
|
||||||
* _ColorDrawBit
|
|
||||||
* _NumColorDrawBuffers
|
* _NumColorDrawBuffers
|
||||||
* _ColorReadBuffer
|
* _ColorReadBuffer
|
||||||
* If the current framebuffer is user-created, make sure it's complete.
|
* If the current framebuffer is user-created, make sure it's complete.
|
||||||
@@ -495,7 +494,6 @@ _mesa_update_framebuffer(GLcontext *ctx)
|
|||||||
struct gl_renderbuffer *rb = get_renderbuffer(fb, bufferBit);
|
struct gl_renderbuffer *rb = get_renderbuffer(fb, bufferBit);
|
||||||
if (rb) {
|
if (rb) {
|
||||||
fb->_ColorDrawBuffers[output][count] = rb;
|
fb->_ColorDrawBuffers[output][count] = rb;
|
||||||
fb->_ColorDrawBit[output][count] = bufferBit;
|
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -2211,11 +2211,6 @@ struct gl_framebuffer
|
|||||||
struct gl_renderbuffer *_ColorDrawBuffers[MAX_DRAW_BUFFERS][4];
|
struct gl_renderbuffer *_ColorDrawBuffers[MAX_DRAW_BUFFERS][4];
|
||||||
struct gl_renderbuffer *_ColorReadBuffer;
|
struct gl_renderbuffer *_ColorReadBuffer;
|
||||||
|
|
||||||
#if OLD_RENDERBUFFER
|
|
||||||
/* XXX THIS IS TEMPORARY */
|
|
||||||
GLuint _ColorDrawBit[MAX_DRAW_BUFFERS][4];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Delete this framebuffer */
|
/** Delete this framebuffer */
|
||||||
void (*Delete)(struct gl_framebuffer *fb);
|
void (*Delete)(struct gl_framebuffer *fb);
|
||||||
};
|
};
|
||||||
|
@@ -1845,8 +1845,10 @@ _mesa_add_renderbuffer(struct gl_framebuffer *fb,
|
|||||||
{
|
{
|
||||||
assert(fb);
|
assert(fb);
|
||||||
assert(rb);
|
assert(rb);
|
||||||
|
#if 00
|
||||||
/* there should be no previous renderbuffer on this attachment point! */
|
/* there should be no previous renderbuffer on this attachment point! */
|
||||||
assert(fb->Attachment[bufferName].Renderbuffer == NULL);
|
assert(fb->Attachment[bufferName].Renderbuffer == NULL);
|
||||||
|
#endif
|
||||||
assert(bufferName < BUFFER_COUNT);
|
assert(bufferName < BUFFER_COUNT);
|
||||||
|
|
||||||
/* winsys vs. user-created buffer cross check */
|
/* winsys vs. user-created buffer cross check */
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
* Version: 6.3
|
* Version: 6.5
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||||
*
|
*
|
||||||
@@ -286,8 +286,6 @@ accum_accum(GLcontext *ctx, GLfloat value,
|
|||||||
if (swrast->_IntegerAccumMode && value != swrast->_IntegerAccumScaler)
|
if (swrast->_IntegerAccumMode && value != swrast->_IntegerAccumScaler)
|
||||||
rescale_accum(ctx);
|
rescale_accum(ctx);
|
||||||
|
|
||||||
_swrast_use_read_buffer(ctx);
|
|
||||||
|
|
||||||
if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
|
if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
|
||||||
const GLfloat scale = value * ACCUM_SCALE16 / CHAN_MAXF;
|
const GLfloat scale = value * ACCUM_SCALE16 / CHAN_MAXF;
|
||||||
GLshort accumRow[4 * MAX_WIDTH];
|
GLshort accumRow[4 * MAX_WIDTH];
|
||||||
@@ -338,8 +336,6 @@ accum_accum(GLcontext *ctx, GLfloat value,
|
|||||||
else {
|
else {
|
||||||
/* other types someday */
|
/* other types someday */
|
||||||
}
|
}
|
||||||
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -374,8 +370,6 @@ accum_load(GLcontext *ctx, GLfloat value,
|
|||||||
swrast->_IntegerAccumScaler = 0.0;
|
swrast->_IntegerAccumScaler = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_swrast_use_read_buffer(ctx);
|
|
||||||
|
|
||||||
if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
|
if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
|
||||||
const GLfloat scale = value * ACCUM_SCALE16 / CHAN_MAXF;
|
const GLfloat scale = value * ACCUM_SCALE16 / CHAN_MAXF;
|
||||||
GLshort accumRow[4 * MAX_WIDTH];
|
GLshort accumRow[4 * MAX_WIDTH];
|
||||||
@@ -428,8 +422,6 @@ accum_load(GLcontext *ctx, GLfloat value,
|
|||||||
else {
|
else {
|
||||||
/* other types someday */
|
/* other types someday */
|
||||||
}
|
}
|
||||||
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -234,13 +234,6 @@ clear_color_buffers(GLcontext *ctx)
|
|||||||
|
|
||||||
for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers[0]; i++) {
|
for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers[0]; i++) {
|
||||||
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][i];
|
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][i];
|
||||||
#if OLD_RENDERBUFFER
|
|
||||||
/* SetBuffer will go away */
|
|
||||||
if (swrast->Driver.SetBuffer)
|
|
||||||
swrast->Driver.SetBuffer(ctx, ctx->DrawBuffer,
|
|
||||||
ctx->DrawBuffer->_ColorDrawBit[0][i]);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (ctx->Visual.rgbMode) {
|
if (ctx->Visual.rgbMode) {
|
||||||
if (masking) {
|
if (masking) {
|
||||||
clear_rgba_buffer_with_masking(ctx, rb);
|
clear_rgba_buffer_with_masking(ctx, rb);
|
||||||
@@ -258,9 +251,6 @@ clear_color_buffers(GLcontext *ctx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* restore default read/draw buffer */
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -322,93 +312,3 @@ _swrast_Clear(GLcontext *ctx, GLbitfield mask,
|
|||||||
|
|
||||||
RENDER_FINISH(swrast,ctx);
|
RENDER_FINISH(swrast,ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Fallback for ctx->Driver.DrawBuffer()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
_swrast_DrawBuffer( GLcontext *ctx, GLenum mode )
|
|
||||||
{
|
|
||||||
(void) mode;
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Fallback for ctx->Driver.DrawBuffers()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
_swrast_DrawBuffers( GLcontext *ctx, GLsizei n, const GLenum *buffers )
|
|
||||||
{
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Setup things so that we read/write spans from the user-designated
|
|
||||||
* read buffer (set via glReadPixels). We usually just have to call
|
|
||||||
* this for glReadPixels, glCopyPixels, etc.
|
|
||||||
*
|
|
||||||
* XXX this will go away when the last OLD_RENDERBUFFER code is removed.
|
|
||||||
* The swrast->CurrentBufferBit var can be totally removed then too.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
_swrast_use_read_buffer( GLcontext *ctx )
|
|
||||||
{
|
|
||||||
SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
|
||||||
|
|
||||||
/* Do this so the software-emulated alpha plane span functions work! */
|
|
||||||
swrast->CurrentBufferBit = ctx->ReadBuffer->_ColorReadBufferMask;
|
|
||||||
/* Tell the device driver where to read/write spans */
|
|
||||||
if (swrast->Driver.SetBuffer)
|
|
||||||
swrast->Driver.SetBuffer(ctx, ctx->ReadBuffer, swrast->CurrentBufferBit);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Setup things so that we read/write spans from the default draw buffer.
|
|
||||||
* This is the usual mode that Mesa's software rasterizer operates in.
|
|
||||||
*
|
|
||||||
* XXX this will go away when the last OLD_RENDERBUFFER code is removed.
|
|
||||||
* The swrast->CurrentBufferBit var can be totally removed then too.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
_swrast_use_draw_buffer( GLcontext *ctx )
|
|
||||||
{
|
|
||||||
SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
|
||||||
|
|
||||||
/* The user can specify rendering to zero, one, two, or four color
|
|
||||||
* buffers simultaneously with glDrawBuffer()!
|
|
||||||
* We don't expect the span/point/line/triangle functions to deal with
|
|
||||||
* that mess so we'll iterate over the multiple buffers as needed.
|
|
||||||
* But usually we only render to one color buffer at a time.
|
|
||||||
* We set ctx->Color._DriverDrawBuffer to that buffer and tell the
|
|
||||||
* device driver to use that buffer.
|
|
||||||
* Look in s_span.c's multi_write_rgba_span() function to see how
|
|
||||||
* we loop over multiple color buffers when needed.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_FRONT_LEFT)
|
|
||||||
swrast->CurrentBufferBit = BUFFER_BIT_FRONT_LEFT;
|
|
||||||
else if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_BACK_LEFT)
|
|
||||||
swrast->CurrentBufferBit = BUFFER_BIT_BACK_LEFT;
|
|
||||||
else if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_FRONT_RIGHT)
|
|
||||||
swrast->CurrentBufferBit = BUFFER_BIT_FRONT_RIGHT;
|
|
||||||
else if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_BACK_RIGHT)
|
|
||||||
swrast->CurrentBufferBit = BUFFER_BIT_BACK_RIGHT;
|
|
||||||
else if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_AUX0)
|
|
||||||
swrast->CurrentBufferBit = BUFFER_BIT_AUX0;
|
|
||||||
else if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_AUX1)
|
|
||||||
swrast->CurrentBufferBit = BUFFER_BIT_AUX1;
|
|
||||||
else if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_AUX2)
|
|
||||||
swrast->CurrentBufferBit = BUFFER_BIT_AUX2;
|
|
||||||
else if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_AUX3)
|
|
||||||
swrast->CurrentBufferBit = BUFFER_BIT_AUX3;
|
|
||||||
else
|
|
||||||
/* glDrawBuffer(GL_NONE) */
|
|
||||||
swrast->CurrentBufferBit = BUFFER_BIT_FRONT_LEFT; /* we always have this buffer */
|
|
||||||
|
|
||||||
if (swrast->Driver.SetBuffer)
|
|
||||||
swrast->Driver.SetBuffer(ctx, ctx->DrawBuffer, swrast->CurrentBufferBit);
|
|
||||||
}
|
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
* Version: 6.1
|
* Version: 6.5
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
* Version: 6.3
|
* Version: 6.5
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||||
*
|
*
|
||||||
@@ -133,7 +133,6 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
|
|||||||
struct gl_renderbuffer *drawRb = NULL;
|
struct gl_renderbuffer *drawRb = NULL;
|
||||||
GLboolean quick_draw;
|
GLboolean quick_draw;
|
||||||
GLint row;
|
GLint row;
|
||||||
GLboolean changeBuffer;
|
|
||||||
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
|
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
|
||||||
const GLuint transferOps = ctx->_ImageTransferState;
|
const GLuint transferOps = ctx->_ImageTransferState;
|
||||||
GLfloat *dest, *tmpImage, *convImage;
|
GLfloat *dest, *tmpImage, *convImage;
|
||||||
@@ -158,11 +157,6 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
|
|||||||
quick_draw = GL_FALSE;
|
quick_draw = GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If read and draw buffer are different we must do buffer switching */
|
|
||||||
changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer[0]
|
|
||||||
|| ctx->DrawBuffer != ctx->ReadBuffer;
|
|
||||||
|
|
||||||
|
|
||||||
/* allocate space for GLfloat image */
|
/* allocate space for GLfloat image */
|
||||||
tmpImage = (GLfloat *) MALLOC(width * height * 4 * sizeof(GLfloat));
|
tmpImage = (GLfloat *) MALLOC(width * height * 4 * sizeof(GLfloat));
|
||||||
if (!tmpImage) {
|
if (!tmpImage) {
|
||||||
@@ -176,11 +170,6 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changeBuffer) {
|
|
||||||
/* choose the read buffer */
|
|
||||||
_swrast_use_read_buffer(ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* read source image */
|
/* read source image */
|
||||||
dest = tmpImage;
|
dest = tmpImage;
|
||||||
for (row = 0; row < height; row++) {
|
for (row = 0; row < height; row++) {
|
||||||
@@ -193,11 +182,6 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
|
|||||||
dest += 4 * width;
|
dest += 4 * width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changeBuffer) {
|
|
||||||
/* restore default src/dst buffer */
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* do the image transfer ops which preceed convolution */
|
/* do the image transfer ops which preceed convolution */
|
||||||
for (row = 0; row < height; row++) {
|
for (row = 0; row < height; row++) {
|
||||||
GLfloat (*rgba)[4] = (GLfloat (*)[4]) (tmpImage + row * width * 4);
|
GLfloat (*rgba)[4] = (GLfloat (*)[4]) (tmpImage + row * width * 4);
|
||||||
@@ -274,7 +258,6 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
|
|||||||
GLchan *tmpImage,*p;
|
GLchan *tmpImage,*p;
|
||||||
GLboolean quick_draw;
|
GLboolean quick_draw;
|
||||||
GLint sy, dy, stepy, j;
|
GLint sy, dy, stepy, j;
|
||||||
GLboolean changeBuffer;
|
|
||||||
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
|
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
|
||||||
GLint overlapping;
|
GLint overlapping;
|
||||||
const GLuint transferOps = ctx->_ImageTransferState;
|
const GLuint transferOps = ctx->_ImageTransferState;
|
||||||
@@ -331,10 +314,6 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
|
|||||||
drawRb = NULL;
|
drawRb = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If read and draw buffer are different we must do buffer switching */
|
|
||||||
changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer[0]
|
|
||||||
|| ctx->DrawBuffer != ctx->ReadBuffer;
|
|
||||||
|
|
||||||
if (overlapping) {
|
if (overlapping) {
|
||||||
GLint ssy = sy;
|
GLint ssy = sy;
|
||||||
tmpImage = (GLchan *) MALLOC(width * height * sizeof(GLchan) * 4);
|
tmpImage = (GLchan *) MALLOC(width * height * sizeof(GLchan) * 4);
|
||||||
@@ -342,9 +321,6 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
|
|||||||
_mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
|
_mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* setup source */
|
|
||||||
if (changeBuffer)
|
|
||||||
_swrast_use_read_buffer(ctx);
|
|
||||||
/* read the source image */
|
/* read the source image */
|
||||||
p = tmpImage;
|
p = tmpImage;
|
||||||
for (j = 0; j < height; j++, ssy += stepy) {
|
for (j = 0; j < height; j++, ssy += stepy) {
|
||||||
@@ -353,11 +329,6 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
|
|||||||
p += width * 4;
|
p += width * 4;
|
||||||
}
|
}
|
||||||
p = tmpImage;
|
p = tmpImage;
|
||||||
/* restore dest */
|
|
||||||
if (changeBuffer) {
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
changeBuffer = GL_FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tmpImage = NULL; /* silence compiler warnings */
|
tmpImage = NULL; /* silence compiler warnings */
|
||||||
@@ -374,13 +345,9 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* get from framebuffer */
|
/* get from framebuffer */
|
||||||
if (changeBuffer)
|
|
||||||
_swrast_use_read_buffer(ctx);
|
|
||||||
ASSERT(width < MAX_WIDTH);
|
ASSERT(width < MAX_WIDTH);
|
||||||
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
|
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
|
||||||
width, srcx, sy, span.array->rgba );
|
width, srcx, sy, span.array->rgba );
|
||||||
if (changeBuffer)
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transferOps) {
|
if (transferOps) {
|
||||||
@@ -435,7 +402,6 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
|
|||||||
GLuint *tmpImage,*p;
|
GLuint *tmpImage,*p;
|
||||||
GLint sy, dy, stepy;
|
GLint sy, dy, stepy;
|
||||||
GLint j;
|
GLint j;
|
||||||
GLboolean changeBuffer;
|
|
||||||
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
|
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
|
||||||
const GLboolean shift_or_offset = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset;
|
const GLboolean shift_or_offset = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset;
|
||||||
GLint overlapping;
|
GLint overlapping;
|
||||||
@@ -475,10 +441,6 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
|
|||||||
if (ctx->Fog.Enabled)
|
if (ctx->Fog.Enabled)
|
||||||
_swrast_span_default_fog(ctx, &span);
|
_swrast_span_default_fog(ctx, &span);
|
||||||
|
|
||||||
/* If read and draw buffer are different we must do buffer switching */
|
|
||||||
changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer[0]
|
|
||||||
|| ctx->DrawBuffer != ctx->ReadBuffer;
|
|
||||||
|
|
||||||
if (overlapping) {
|
if (overlapping) {
|
||||||
GLint ssy = sy;
|
GLint ssy = sy;
|
||||||
tmpImage = (GLuint *) MALLOC(width * height * sizeof(GLuint));
|
tmpImage = (GLuint *) MALLOC(width * height * sizeof(GLuint));
|
||||||
@@ -486,9 +448,6 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
|
|||||||
_mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
|
_mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* setup source */
|
|
||||||
if (changeBuffer)
|
|
||||||
_swrast_use_read_buffer(ctx);
|
|
||||||
/* read the image */
|
/* read the image */
|
||||||
p = tmpImage;
|
p = tmpImage;
|
||||||
for (j = 0; j < height; j++, ssy += stepy) {
|
for (j = 0; j < height; j++, ssy += stepy) {
|
||||||
@@ -497,11 +456,6 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
|
|||||||
p += width;
|
p += width;
|
||||||
}
|
}
|
||||||
p = tmpImage;
|
p = tmpImage;
|
||||||
/* restore to draw buffer */
|
|
||||||
if (changeBuffer) {
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
changeBuffer = GL_FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tmpImage = NULL; /* silence compiler warning */
|
tmpImage = NULL; /* silence compiler warning */
|
||||||
@@ -515,12 +469,8 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
|
|||||||
p += width;
|
p += width;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (changeBuffer)
|
|
||||||
_swrast_use_read_buffer(ctx);
|
|
||||||
_swrast_read_index_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
|
_swrast_read_index_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
|
||||||
width, srcx, sy, span.array->index );
|
width, srcx, sy, span.array->index );
|
||||||
if (changeBuffer)
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Apply shift, offset, look-up table */
|
/* Apply shift, offset, look-up table */
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
* Version: 6.3
|
* Version: 6.5
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@@ -46,9 +46,6 @@ _swrast_CopyColorTable( GLcontext *ctx,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Select buffer to read from */
|
|
||||||
_swrast_use_read_buffer(ctx);
|
|
||||||
|
|
||||||
if (width > MAX_WIDTH)
|
if (width > MAX_WIDTH)
|
||||||
width = MAX_WIDTH;
|
width = MAX_WIDTH;
|
||||||
|
|
||||||
@@ -56,9 +53,6 @@ _swrast_CopyColorTable( GLcontext *ctx,
|
|||||||
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
|
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
|
||||||
width, x, y, data );
|
width, x, y, data );
|
||||||
|
|
||||||
/* Restore reading from draw buffer (the default) */
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
|
|
||||||
/* save PBO binding */
|
/* save PBO binding */
|
||||||
bufferSave = ctx->Unpack.BufferObj;
|
bufferSave = ctx->Unpack.BufferObj;
|
||||||
ctx->Unpack.BufferObj = ctx->Array.NullBufferObj;
|
ctx->Unpack.BufferObj = ctx->Array.NullBufferObj;
|
||||||
@@ -82,9 +76,6 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Select buffer to read from */
|
|
||||||
_swrast_use_read_buffer(ctx);
|
|
||||||
|
|
||||||
if (width > MAX_WIDTH)
|
if (width > MAX_WIDTH)
|
||||||
width = MAX_WIDTH;
|
width = MAX_WIDTH;
|
||||||
|
|
||||||
@@ -92,9 +83,6 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start,
|
|||||||
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
|
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
|
||||||
width, x, y, data );
|
width, x, y, data );
|
||||||
|
|
||||||
/* Restore reading from draw buffer (the default) */
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
|
|
||||||
/* save PBO binding */
|
/* save PBO binding */
|
||||||
bufferSave = ctx->Unpack.BufferObj;
|
bufferSave = ctx->Unpack.BufferObj;
|
||||||
ctx->Unpack.BufferObj = ctx->Array.NullBufferObj;
|
ctx->Unpack.BufferObj = ctx->Array.NullBufferObj;
|
||||||
@@ -120,9 +108,6 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Select buffer to read from */
|
|
||||||
_swrast_use_read_buffer(ctx);
|
|
||||||
|
|
||||||
RENDER_START( swrast, ctx );
|
RENDER_START( swrast, ctx );
|
||||||
|
|
||||||
/* read the data from framebuffer */
|
/* read the data from framebuffer */
|
||||||
@@ -131,9 +116,6 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
|
|||||||
|
|
||||||
RENDER_FINISH( swrast, ctx );
|
RENDER_FINISH( swrast, ctx );
|
||||||
|
|
||||||
/* Restore reading from draw buffer (the default) */
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
|
|
||||||
/* save PBO binding */
|
/* save PBO binding */
|
||||||
bufferSave = ctx->Unpack.BufferObj;
|
bufferSave = ctx->Unpack.BufferObj;
|
||||||
ctx->Unpack.BufferObj = ctx->Array.NullBufferObj;
|
ctx->Unpack.BufferObj = ctx->Array.NullBufferObj;
|
||||||
@@ -163,9 +145,6 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Select buffer to read from */
|
|
||||||
_swrast_use_read_buffer(ctx);
|
|
||||||
|
|
||||||
RENDER_START(swrast,ctx);
|
RENDER_START(swrast,ctx);
|
||||||
|
|
||||||
/* read pixels from framebuffer */
|
/* read pixels from framebuffer */
|
||||||
@@ -176,9 +155,6 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
|
|||||||
|
|
||||||
RENDER_FINISH(swrast,ctx);
|
RENDER_FINISH(swrast,ctx);
|
||||||
|
|
||||||
/* Restore reading from draw buffer (the default) */
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* HACK: save & restore context state so we can store this as a
|
* HACK: save & restore context state so we can store this as a
|
||||||
* convolution filter via the GL api. Doesn't call any callbacks
|
* convolution filter via the GL api. Doesn't call any callbacks
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
* Version: 6.3
|
* Version: 6.5
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@@ -74,8 +74,6 @@ read_index_pixels( GLcontext *ctx,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_swrast_use_read_buffer(ctx);
|
|
||||||
|
|
||||||
/* XXX: width should never be > MAX_WIDTH since we did clipping earlier */
|
/* XXX: width should never be > MAX_WIDTH since we did clipping earlier */
|
||||||
readWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;
|
readWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;
|
||||||
|
|
||||||
@@ -92,8 +90,6 @@ read_index_pixels( GLcontext *ctx,
|
|||||||
_mesa_pack_index_span(ctx, readWidth, type, dest, index,
|
_mesa_pack_index_span(ctx, readWidth, type, dest, index,
|
||||||
&ctx->Pack, ctx->_ImageTransferState);
|
&ctx->Pack, ctx->_ImageTransferState);
|
||||||
}
|
}
|
||||||
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -378,13 +374,9 @@ read_rgba_pixels( GLcontext *ctx,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_swrast_use_read_buffer(ctx);
|
|
||||||
|
|
||||||
/* Try optimized path first */
|
/* Try optimized path first */
|
||||||
if (read_fast_rgba_pixels( ctx, x, y, width, height,
|
if (read_fast_rgba_pixels( ctx, x, y, width, height,
|
||||||
format, type, pixels, packing )) {
|
format, type, pixels, packing )) {
|
||||||
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
return; /* done! */
|
return; /* done! */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -499,8 +491,6 @@ read_rgba_pixels( GLcontext *ctx,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -983,11 +983,6 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OLD_RENDERBUFFER
|
|
||||||
/* restore default dest buffer */
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
span->interpMask = origInterpMask;
|
span->interpMask = origInterpMask;
|
||||||
span->arrayMask = origArrayMask;
|
span->arrayMask = origArrayMask;
|
||||||
}
|
}
|
||||||
@@ -1029,9 +1024,6 @@ add_colors(GLuint n, GLchan rgba[][4], GLchan specular[][4] )
|
|||||||
static void
|
static void
|
||||||
multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
|
multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
|
||||||
{
|
{
|
||||||
#if OLD_RENDERBUFFER
|
|
||||||
SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
|
||||||
#endif
|
|
||||||
const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
|
const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
|
||||||
struct gl_framebuffer *fb = ctx->DrawBuffer;
|
struct gl_framebuffer *fb = ctx->DrawBuffer;
|
||||||
const GLuint output = 0;
|
const GLuint output = 0;
|
||||||
@@ -1044,15 +1036,6 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
|
|||||||
struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[output][i];
|
struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[output][i];
|
||||||
GLchan rgbaTmp[MAX_WIDTH][4];
|
GLchan rgbaTmp[MAX_WIDTH][4];
|
||||||
|
|
||||||
#if OLD_RENDERBUFFER
|
|
||||||
/* obsolete code */
|
|
||||||
GLuint bufferBit = fb->_ColorDrawBit[output][i];
|
|
||||||
/* Set the current read/draw buffer */
|
|
||||||
swrast->CurrentBufferBit = bufferBit;
|
|
||||||
if (swrast->Driver.SetBuffer)
|
|
||||||
(*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* make copy of incoming colors */
|
/* make copy of incoming colors */
|
||||||
MEMCPY( rgbaTmp, span->array->rgba, 4 * span->end * sizeof(GLchan) );
|
MEMCPY( rgbaTmp, span->array->rgba, 4 * span->end * sizeof(GLchan) );
|
||||||
|
|
||||||
@@ -1080,11 +1063,6 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
|
|||||||
span->array->mask);
|
span->array->mask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OLD_RENDERBUFFER
|
|
||||||
/* restore default dest buffer */
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
* Version: 6.1
|
* Version: 6.5
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@@ -71,9 +71,6 @@ read_color_image( GLcontext *ctx, GLint x, GLint y,
|
|||||||
if (!image)
|
if (!image)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Select buffer to read from */
|
|
||||||
_swrast_use_read_buffer(ctx);
|
|
||||||
|
|
||||||
RENDER_START(swrast,ctx);
|
RENDER_START(swrast,ctx);
|
||||||
|
|
||||||
dst = image;
|
dst = image;
|
||||||
@@ -86,9 +83,6 @@ read_color_image( GLcontext *ctx, GLint x, GLint y,
|
|||||||
|
|
||||||
RENDER_FINISH(swrast,ctx);
|
RENDER_FINISH(swrast,ctx);
|
||||||
|
|
||||||
/* Read from draw buffer (the default) */
|
|
||||||
_swrast_use_draw_buffer(ctx);
|
|
||||||
|
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
* Version: 6.3
|
* Version: 6.5
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||||
*
|
*
|
||||||
@@ -81,11 +81,6 @@ struct swrast_device_driver;
|
|||||||
|
|
||||||
/* These are the public-access functions exported from swrast.
|
/* These are the public-access functions exported from swrast.
|
||||||
*/
|
*/
|
||||||
extern void
|
|
||||||
_swrast_use_read_buffer( GLcontext *ctx );
|
|
||||||
|
|
||||||
extern void
|
|
||||||
_swrast_use_draw_buffer( GLcontext *ctx );
|
|
||||||
|
|
||||||
extern GLboolean
|
extern GLboolean
|
||||||
_swrast_CreateContext( GLcontext *ctx );
|
_swrast_CreateContext( GLcontext *ctx );
|
||||||
@@ -137,13 +132,6 @@ _swrast_Accum( GLcontext *ctx, GLenum op,
|
|||||||
GLint width, GLint height );
|
GLint width, GLint height );
|
||||||
|
|
||||||
|
|
||||||
extern void
|
|
||||||
_swrast_DrawBuffer( GLcontext *ctx, GLenum mode );
|
|
||||||
|
|
||||||
|
|
||||||
extern void
|
|
||||||
_swrast_DrawBuffers( GLcontext *ctx, GLsizei n, const GLenum *buffers );
|
|
||||||
|
|
||||||
|
|
||||||
/* Reset the stipple counter
|
/* Reset the stipple counter
|
||||||
*/
|
*/
|
||||||
@@ -260,22 +248,6 @@ _swrast_copy_texsubimage3d(GLcontext *ctx,
|
|||||||
* Unless otherwise noted, all functions are mandatory.
|
* Unless otherwise noted, all functions are mandatory.
|
||||||
*/
|
*/
|
||||||
struct swrast_device_driver {
|
struct swrast_device_driver {
|
||||||
#if OLD_RENDERBUFFER
|
|
||||||
void (*SetBuffer)(GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit);
|
|
||||||
/*
|
|
||||||
* Specifies the current color buffer for span/pixel writing/reading.
|
|
||||||
* buffer indicates which window to write to / read from. Normally,
|
|
||||||
* this'll be the buffer currently bound to the context, but it doesn't
|
|
||||||
* have to be!
|
|
||||||
* bufferBit indicates which color buffer, exactly one of:
|
|
||||||
* DD_FRONT_LEFT_BIT - this buffer always exists
|
|
||||||
* DD_BACK_LEFT_BIT - when double buffering
|
|
||||||
* DD_FRONT_RIGHT_BIT - when using stereo
|
|
||||||
* DD_BACK_RIGHT_BIT - when using stereo and double buffering
|
|
||||||
* DD_AUXn_BIT - if aux buffers are implemented
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
*** Functions for synchronizing access to the framebuffer:
|
*** Functions for synchronizing access to the framebuffer:
|
||||||
***/
|
***/
|
||||||
|
Reference in New Issue
Block a user