[g3dvl] move z-coord generation for multiple render targets into vertex shader
[mesa.git] / src / mesa / drivers / dri / intel / intel_pixel_bitmap.c
index c62e16f58783a501fc7348f419a478529bf91290..e7356a6da0d325f41073020fa84e306c8fdfcc5f 100644 (file)
@@ -58,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 )
@@ -113,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;
@@ -167,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,
@@ -285,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)) {
@@ -299,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:
@@ -320,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);
 }