mesa: MESA_VERBOSE logging for glRead/Draw/CopyPixels, glBlitFramebuffer
authorBrian Paul <brianp@vmware.com>
Fri, 18 Feb 2011 16:53:29 +0000 (09:53 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 18 Feb 2011 17:34:25 +0000 (10:34 -0700)
src/mesa/main/drawpix.c
src/mesa/main/fbobject.c
src/mesa/main/readpix.c

index 6fda3c5665c69577a03359485145827a5036fc0b..df4712de894622416c442cd8913a9e7c4cc9addb 100644 (file)
@@ -49,6 +49,17 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
+   if (MESA_VERBOSE & VERBOSE_API)
+      _mesa_debug(ctx, "glDrawPixels(%d, %d, %s, %s, %p) // to %s at %d, %d\n",
+                  width, height,
+                  _mesa_lookup_enum_by_nr(format),
+                  _mesa_lookup_enum_by_nr(type),
+                  pixels,
+                  _mesa_lookup_enum_by_nr(ctx->DrawBuffer->ColorDrawBuffer[0]),
+                  IROUND(ctx->Current.RasterPos[0]),
+                  IROUND(ctx->Current.RasterPos[1]));
+
+
    if (width < 0 || height < 0) {
       _mesa_error( ctx, GL_INVALID_VALUE, "glDrawPixels(width or height < 0" );
       return;
@@ -124,6 +135,18 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
+   _mesa_finish(ctx);
+
+   if (MESA_VERBOSE & VERBOSE_API)
+      _mesa_debug(ctx,
+                  "glCopyPixels(%d, %d, %d, %d, %s) // from %s to %s at %d, %d\n",
+                  srcx, srcy, width, height,
+                  _mesa_lookup_enum_by_nr(type),
+                  _mesa_lookup_enum_by_nr(ctx->ReadBuffer->ColorReadBuffer),
+                  _mesa_lookup_enum_by_nr(ctx->DrawBuffer->ColorDrawBuffer[0]),
+                  IROUND(ctx->Current.RasterPos[0]),
+                  IROUND(ctx->Current.RasterPos[1]));
+
    if (width < 0 || height < 0) {
       _mesa_error(ctx, GL_INVALID_VALUE, "glCopyPixels(width or height < 0)");
       return;
index 97cbd3c614d8feb253ddab1da82db9c3e52b8fa5..ab6b2a9b17bde577918554171938f92d36459dba 100644 (file)
@@ -2310,6 +2310,13 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
    ASSERT_OUTSIDE_BEGIN_END(ctx);
    FLUSH_VERTICES(ctx, _NEW_BUFFERS);
 
+   if (MESA_VERBOSE & VERBOSE_API)
+      _mesa_debug(ctx,
+                  "glBlitFramebuffer(%d, %d, %d, %d,  %d, %d, %d, %d, 0x%x, %s)\n",
+                  srcX0, srcY0, srcX1, srcY1,
+                  dstX0, dstY0, dstX1, dstY1,
+                  mask, _mesa_lookup_enum_by_nr(filter));
+
    if (ctx->NewState) {
       _mesa_update_state(ctx);
    }
index e5b85ca32b47b04643ababcee2250990150fff30..9a4f15f7279645e9bcf3cf6706c659bdd27dbdd9 100644 (file)
@@ -26,6 +26,7 @@
 #include "imports.h"
 #include "bufferobj.h"
 #include "context.h"
+#include "enums.h"
 #include "readpix.h"
 #include "framebuffer.h"
 #include "formats.h"
@@ -173,6 +174,13 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
 
    FLUSH_CURRENT(ctx, 0);
 
+   if (MESA_VERBOSE & VERBOSE_API)
+      _mesa_debug(ctx, "glReadPixels(%d, %d, %s, %s, %p)\n",
+                  width, height,
+                  _mesa_lookup_enum_by_nr(format),
+                  _mesa_lookup_enum_by_nr(type),
+                  pixels);
+
    if (width < 0 || height < 0) {
       _mesa_error( ctx, GL_INVALID_VALUE,
                    "glReadPixels(width=%d height=%d)", width, height );