i965: Add support for non-color render target write data to new FS backend.
[mesa.git] / src / mesa / drivers / dri / unichrome / via_span.c
index b908f0fb23a93a774c8d491d4be74471cb6750c2..fa3cbf7a79e30c0e172eca72c6b149db386d5b86 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 #include "main/glheader.h"
+#include "main/formats.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/colormac.h"
@@ -42,7 +43,7 @@
 #undef LOCAL_VARS
 #define LOCAL_VARS                                                     \
     struct via_renderbuffer *vrb = (struct via_renderbuffer *) rb;     \
-    __DRIdrawablePrivate *dPriv = vrb->dPriv;                           \
+    __DRIdrawable *dPriv = vrb->dPriv;                           \
     GLuint pitch = vrb->pitch;                                          \
     GLuint height = dPriv->h;                                          \
     GLint p = 0;                                                       \
@@ -79,7 +80,7 @@
  */
 #define LOCAL_DEPTH_VARS                                            \
     struct via_renderbuffer *vrb = (struct via_renderbuffer *) rb;  \
-    __DRIdrawablePrivate *dPriv = vrb->dPriv;                       \
+    __DRIdrawable *dPriv = vrb->dPriv;                       \
     GLuint depth_pitch = vrb->pitch;                                \
     GLuint height = dPriv->h;                                       \
     char *buf = (char *)(vrb->map)
@@ -177,24 +178,22 @@ void viaInitSpanFuncs(GLcontext *ctx)
 void
 viaSetSpanFunctions(struct via_renderbuffer *vrb, const GLvisual *vis)
 {
-   if (vrb->Base.InternalFormat == GL_RGBA) {
-      if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
-         viaInitPointers_565(&vrb->Base);
-      }
-      else {
-         viaInitPointers_8888(&vrb->Base);
-      }
+   if (vrb->Base.Format == MESA_FORMAT_RGB565) {
+      viaInitPointers_565(&vrb->Base);
    }
-   else if (vrb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
+   else if (vrb->Base.Format == MESA_FORMAT_ARGB8888) {
+      viaInitPointers_8888(&vrb->Base);
+   }
+   else if (vrb->Base.Format == MESA_FORMAT_Z16) {
       viaInitDepthPointers_z16(&vrb->Base);
    }
-   else if (vrb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
+   else if (vrb->Base.Format == MESA_FORMAT_Z24_S8) {
       viaInitDepthPointers_z24_s8(&vrb->Base);
    }
-   else if (vrb->Base.InternalFormat == GL_DEPTH_COMPONENT32) {
+   else if (vrb->Base.Format == MESA_FORMAT_Z32) {
       viaInitDepthPointers_z32(&vrb->Base);
    }
-   else if (vrb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
+   else if (vrb->Base.Format == MESA_FORMAT_S8) {
       viaInitStencilPointers_z24_s8(&vrb->Base);
    }
 }