-#define READ_STENCIL( d, _x, _y ) \
-do { \
- GLuint offset = (_x + xo)*4 + (_y + yo)*pitch; \
- GLuint tmp = *(GLuint *)(buf + offset); \
- tmp &= 0xff000000; \
- d = tmp >> 24; \
-} while (0)
-
-#define TAG(x) radeon##x##_24_8_LINEAR
-#include "stenciltmp.h"
-
-/*
- * 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 radeonSetBuffer(GLcontext * ctx,
- GLframebuffer * colorBuffer, GLuint bufferBit)
-{
- radeonContextPtr radeon = RADEON_CONTEXT(ctx);
- int buffer;
-
- switch (bufferBit) {
- case DD_FRONT_LEFT_BIT:
- buffer = 0;
- break;
-
- case DD_BACK_LEFT_BIT:
- buffer = 1;
- break;
-
- default:
- _mesa_problem(ctx, "Bad bufferBit in %s", __FUNCTION__);
- return;
- }
-
- if (radeon->doPageFlip && radeon->sarea->pfCurrentPage == 1)
- buffer ^= 1;
-
- #if 0
- fprintf(stderr, "%s: using %s buffer\n", __FUNCTION__,
- buffer ? "back" : "front");
- #endif
-
- if (buffer) {
- radeon->state.pixel.readOffset =
- radeon->radeonScreen->backOffset;
- radeon->state.pixel.readPitch =
- radeon->radeonScreen->backPitch;
- radeon->state.color.drawOffset =
- radeon->radeonScreen->backOffset;
- radeon->state.color.drawPitch =
- radeon->radeonScreen->backPitch;
- } else {
- radeon->state.pixel.readOffset =
- radeon->radeonScreen->frontOffset;
- radeon->state.pixel.readPitch =
- radeon->radeonScreen->frontPitch;
- radeon->state.color.drawOffset =
- radeon->radeonScreen->frontOffset;
- radeon->state.color.drawPitch =
- radeon->radeonScreen->frontPitch;
- }
-}