i965: Emit zero initialization for NV VP temporaries as required.
[mesa.git] / src / mesa / drivers / dri / unichrome / via_span.c
index 5bffade9408995bb87da1e7498a9c14fce1f64d5..b908f0fb23a93a774c8d491d4be74471cb6750c2 100644 (file)
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
 #include "via_context.h"
 #include "via_span.h"
 #include "via_ioctl.h"
 
 #undef LOCAL_VARS
 #define LOCAL_VARS                                                     \
-    struct via_context *vmesa = VIA_CONTEXT(ctx);                      \
-    __DRIdrawablePrivate *dPriv = vmesa->driDrawable;                  \
     struct via_renderbuffer *vrb = (struct via_renderbuffer *) rb;     \
+    __DRIdrawablePrivate *dPriv = vrb->dPriv;                           \
     GLuint pitch = vrb->pitch;                                          \
     GLuint height = dPriv->h;                                          \
     GLint p = 0;                                                       \
-    char *buf = (char *)(vrb->origMap + vmesa->drawXoff * vrb->bpp);    \
+    char *buf = (char *)(vrb->origMap);                                        \
     (void) p;
 
 /* ================================================================
@@ -56,8 +55,7 @@
 
 /* 16 bit, RGB565 color spanline and pixel functions
  */
-#define GET_SRC_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
-#define GET_DST_PTR(_x, _y) GET_SRC_PTR(_x, _y);
+#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
 #define SPANTMP_PIXEL_FMT GL_RGB
 #define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
 
@@ -68,8 +66,7 @@
 
 /* 32 bit, ARGB8888 color spanline and pixel functions
  */
-#define GET_SRC_PTR(_x, _y) (buf + (_x) * 4 + (_y) * pitch)
-#define GET_DST_PTR(_x, _y) GET_SRC_PTR(_x, _y);
+#define GET_PTR(_x, _y) (buf + (_x) * 4 + (_y) * pitch)
 #define SPANTMP_PIXEL_FMT GL_BGRA
 #define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
 
 /* 16 bit depthbuffer functions.
  */
 #define LOCAL_DEPTH_VARS                                            \
-    struct via_context *vmesa = VIA_CONTEXT(ctx);                   \
-    __DRIdrawablePrivate *dPriv = vmesa->driDrawable;               \
     struct via_renderbuffer *vrb = (struct via_renderbuffer *) rb;  \
+    __DRIdrawablePrivate *dPriv = vrb->dPriv;                       \
     GLuint depth_pitch = vrb->pitch;                                \
     GLuint height = dPriv->h;                                       \
-    char *buf = (char *)(vrb->map + (vmesa->drawXoff * vrb->bpp/8))
+    char *buf = (char *)(vrb->map)
 
 #define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS 
 
+#define VALUE_TYPE GLushort
 
 #define WRITE_DEPTH(_x, _y, d)                      \
     *(GLushort *)(buf + (_x) * 2 + (_y) * depth_pitch) = d;
 
 /* 32 bit depthbuffer functions.
  */
+#define VALUE_TYPE GLuint
+
 #define WRITE_DEPTH(_x, _y, d)                      \
     *(GLuint *)(buf + (_x) * 4 + (_y) * depth_pitch) = d;
 
 
 /* 24/8 bit interleaved depth/stencil functions
  */
+#define VALUE_TYPE GLuint
+
 #define WRITE_DEPTH( _x, _y, d ) {                     \
    GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*depth_pitch);  \
    tmp &= 0x000000ff;                                  \
 void viaSpanRenderStart( GLcontext *ctx )
 {
    struct via_context *vmesa = VIA_CONTEXT(ctx);     
-   viaWaitIdle(vmesa);
+   viaWaitIdle(vmesa, GL_FALSE);
    LOCK_HARDWARE(vmesa);
 }