[g3dvl] move z-coord generation for multiple render targets into vertex shader
[mesa.git] / src / mesa / drivers / dri / intel / intel_pixel_bitmap.c
index 3ea1d48d7ca9bc9fdf8f8b46cb2bace98ecc3cf4..e7356a6da0d325f41073020fa84e306c8fdfcc5f 100644 (file)
  **************************************************************************/
 
 #include "main/glheader.h"
-#include "main/arbprogram.h"
 #include "main/enums.h"
 #include "main/image.h"
 #include "main/colormac.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "main/bufferobj.h"
-#include "main/polygon.h"
-#include "main/pixelstore.h"
-#include "main/polygon.h"
 #include "main/state.h"
-#include "main/teximage.h"
 #include "main/texobj.h"
-#include "main/texstate.h"
-#include "main/texparam.h"
-#include "main/varray.h"
-#include "main/attrib.h"
-#include "main/enable.h"
-#include "main/viewport.h"
 #include "main/context.h"
 #include "swrast/swrast.h"
+#include "drivers/common/meta.h"
 
 #include "intel_screen.h"
 #include "intel_context.h"
@@ -68,7 +58,7 @@
  * PBO bitmaps.  I think they are probably pretty rare though - I
  * wonder if Xgl uses them?
  */
-static const GLubyte *map_pbo( GLcontext *ctx,
+static const GLubyte *map_pbo( struct gl_context *ctx,
                               GLsizei width, GLsizei height,
                               const struct gl_pixelstore_attrib *unpack,
                               const GLubyte *bitmap )
@@ -123,9 +113,8 @@ static GLuint get_bitmap_rect(GLsizei width, GLsizei height,
    GLint incr;
    GLuint count = 0;
 
-   if (INTEL_DEBUG & DEBUG_PIXEL)
-      printf("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n",
-                  __FUNCTION__, x,y,w,h,width,height,unpack->SkipPixels, src_offset, mask);
+   DBG("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n",
+       __FUNCTION__, x,y,w,h,width,height,unpack->SkipPixels, src_offset, mask);
 
    if (invert) {
       first = h-1;
@@ -177,7 +166,7 @@ y_flip(struct gl_framebuffer *fb, int y, int height)
  * Render a bitmap.
  */
 static GLboolean
-do_blit_bitmap( GLcontext *ctx, 
+do_blit_bitmap( struct gl_context *ctx, 
                GLint dstx, GLint dsty,
                GLsizei width, GLsizei height,
                const struct gl_pixelstore_attrib *unpack,
@@ -295,7 +284,7 @@ do_blit_bitmap( GLcontext *ctx,
    }
 out:
 
-   if (INTEL_DEBUG & DEBUG_SYNC)
+   if (unlikely(INTEL_DEBUG & DEBUG_SYNC))
       intel_batchbuffer_flush(intel->batch);
 
    if (_mesa_is_bufferobj(unpack->BufferObj)) {
@@ -309,6 +298,7 @@ out:
    return GL_TRUE;
 }
 
+
 /* There are a large number of possible ways to implement bitmap on
  * this hardware, most of them have some sort of drawback.  Here are a
  * few that spring to mind:
@@ -330,15 +320,21 @@ out:
  *    - Chop bitmap up into 32x32 squares and render w/polygon stipple.
  */
 void
-intelBitmap(GLcontext * ctx,
+intelBitmap(struct gl_context * ctx,
            GLint x, GLint y,
            GLsizei width, GLsizei height,
            const struct gl_pixelstore_attrib *unpack,
            const GLubyte * pixels)
 {
+   struct intel_context *intel = intel_context(ctx);
+
    if (do_blit_bitmap(ctx, x, y, width, height,
                           unpack, pixels))
       return;
 
+   /* FIXME */
+   if (intel->gen == 6)
+       return _swrast_Bitmap(ctx, x, y, width, height, unpack, pixels);
+
    _mesa_meta_Bitmap(ctx, x, y, width, height, unpack, pixels);
 }