r200: fix some cube map issues
[mesa.git] / src / mesa / drivers / dri / savage / savagespan.c
index 606c7d50c7e47f3534e3bf87915ec46de7e1f024..9615e34013ce8ac6553832ffd7dd09efead26f11 100644 (file)
@@ -22,7 +22,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "mtypes.h"
+#include "main/mtypes.h"
 #include "savagedd.h"
 #include "savagespan.h"
 #include "savageioctl.h"
@@ -33,9 +33,8 @@
 #define DBG 0
 
 #define LOCAL_VARS                                             \
-   savageContextPtr imesa = SAVAGE_CONTEXT(ctx);               \
-   __DRIdrawablePrivate *dPriv = imesa->driDrawable;           \
    driRenderbuffer *drb = (driRenderbuffer *) rb;              \
+   __DRIdrawablePrivate *const dPriv = drb->dPriv;             \
    GLuint cpp   = drb->cpp;                                    \
    GLuint pitch = drb->pitch;                                  \
    GLuint height = dPriv->h;                                   \
@@ -44,9 +43,8 @@
    (void) p
 
 #define LOCAL_DEPTH_VARS                                       \
-   savageContextPtr imesa = SAVAGE_CONTEXT(ctx);               \
-   __DRIdrawablePrivate *dPriv = imesa->driDrawable;           \
    driRenderbuffer *drb = (driRenderbuffer *) rb;              \
+   __DRIdrawablePrivate *const dPriv = drb->dPriv;             \
    GLuint zpp   = drb->cpp;                                    \
    GLuint pitch = drb->pitch;                                  \
    GLuint height = dPriv->h;                                   \
@@ -95,6 +93,8 @@
 /* 16 bit integer depthbuffer functions
  * Depth range is reversed. See also savageCalcViewport.
  */
+#define VALUE_TYPE GLushort
+
 #define WRITE_DEPTH( _x, _y, d ) \
     *(GLushort *)(buf + ((_x)<<1) + (_y)*pitch) = 0xFFFF - d
 
 
 /* 16 bit float depthbuffer functions
  */
+#define VALUE_TYPE GLushort
+
 #define WRITE_DEPTH( _x, _y, d ) \
     *(GLushort *)(buf + ((_x)<<1) + (_y)*pitch) = \
         savageEncodeFloat16( 1.0 - (GLfloat)d/65535.0 )
 /* 8-bit stencil /24-bit integer depth depthbuffer functions.
  * Depth range is reversed. See also savageCalcViewport.
  */
+#define VALUE_TYPE GLuint
+
 #define WRITE_DEPTH( _x, _y, d ) do {                          \
    GLuint tmp = *(GLuint *)(buf + ((_x)<<2) + (_y)*pitch);     \
    tmp &= 0xFF000000;                                          \
 
 /* 24 bit float depthbuffer functions
  */
+#define VALUE_TYPE GLuint
+
 #define WRITE_DEPTH( _x, _y, d ) do {                          \
     GLuint tmp = *(GLuint *)(buf + ((_x)<<2) + (_y)*pitch);    \
     tmp &= 0xFF000000;                                         \
@@ -234,10 +240,7 @@ void savageDDInitSpanFuncs( GLcontext *ctx )
    struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
    swdd->SpanRenderStart = savageSpanRenderStart;
 
-   /* Pixel path fallbacks.
-    */
-   ctx->Driver.Accum = _swrast_Accum;
-   ctx->Driver.Bitmap = _swrast_Bitmap;
+   /* XXX these should probably be plugged in elsewhere */
    ctx->Driver.CopyPixels = savageCopyPixels;
    ctx->Driver.DrawPixels = savageDrawPixels;
    ctx->Driver.ReadPixels = savageReadPixels;