summaryrefslogtreecommitdiff
path: root/xc/lib/GL/mesa/src/drv/r200/r200_span.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/lib/GL/mesa/src/drv/r200/r200_span.c')
-rw-r--r--xc/lib/GL/mesa/src/drv/r200/r200_span.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_span.c b/xc/lib/GL/mesa/src/drv/r200/r200_span.c
index d67534794..efbef9894 100644
--- a/xc/lib/GL/mesa/src/drv/r200/r200_span.c
+++ b/xc/lib/GL/mesa/src/drv/r200/r200_span.c
@@ -32,14 +32,16 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell <keith@tungstengraphics.com>
*/
+#include "glheader.h"
+#include "imports.h"
+#include "swrast/swrast.h"
+
#include "r200_context.h"
#include "r200_ioctl.h"
#include "r200_state.h"
#include "r200_span.h"
#include "r200_tex.h"
-#include "swrast/swrast.h"
-
#define DBG 0
#define LOCAL_VARS \
@@ -285,33 +287,46 @@ do { \
#include "stenciltmp.h"
-static void r200SetReadBuffer( GLcontext *ctx,
- GLframebuffer *colorBuffer,
- GLenum mode )
+/*
+ * This function is called to specify which buffer to read and write
+ * for software rasterization (swrast) fallbacks. This doesn't necessarily
+ * correspond to glDrawBuffer() or glReadBuffer() calls.
+ */
+static void r200SetBuffer( GLcontext *ctx,
+ GLframebuffer *colorBuffer,
+ GLuint bufferBit )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
- switch ( mode ) {
- case GL_FRONT_LEFT:
+ switch ( bufferBit ) {
+ case FRONT_LEFT_BIT:
if ( rmesa->doPageFlip && rmesa->sarea->pfCurrentPage == 1 ) {
rmesa->state.pixel.readOffset = rmesa->r200Screen->backOffset;
rmesa->state.pixel.readPitch = rmesa->r200Screen->backPitch;
+ rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset;
+ rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch;
} else {
rmesa->state.pixel.readOffset = rmesa->r200Screen->frontOffset;
rmesa->state.pixel.readPitch = rmesa->r200Screen->frontPitch;
+ rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;
+ rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch;
}
break;
- case GL_BACK_LEFT:
+ case BACK_LEFT_BIT:
if ( rmesa->doPageFlip && rmesa->sarea->pfCurrentPage == 1 ) {
rmesa->state.pixel.readOffset = rmesa->r200Screen->frontOffset;
rmesa->state.pixel.readPitch = rmesa->r200Screen->frontPitch;
+ rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;
+ rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch;
} else {
rmesa->state.pixel.readOffset = rmesa->r200Screen->backOffset;
rmesa->state.pixel.readPitch = rmesa->r200Screen->backPitch;
+ rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset;
+ rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch;
}
break;
default:
- assert(0);
+ _mesa_problem(ctx, "Bad bufferBit in r200SetBuffer()");
break;
}
}
@@ -359,7 +374,7 @@ void r200InitSpanFuncs( GLcontext *ctx )
r200ContextPtr rmesa = R200_CONTEXT(ctx);
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
- swdd->SetReadBuffer = r200SetReadBuffer;
+ swdd->SetBuffer = r200SetBuffer;
switch ( rmesa->r200Screen->cpp ) {
case 2: