On Thu, Sep 24, 2009 at 9:24 PM, tom fogal <tfo...@alumni.unh.edu> wrote:
> I'm trying to debug a strange readback issue in a large software
> system.
>
> I find it quite useful to dump an image of what's in the framebuffer at
> various points in the process.  I've grabbed a write_ppm method out of
> an (OS?)Mesa demo, and I call it periodically to see what I've got in
> the buffer.  There's a point in time where I have a good buffer, and
> then there's a point in time where, if I had to guess, I'd say some
> code is interpreting the buffer as `GRB' data.
>
> I'd like to dump the buffer while I'm in Mesa at this point -- e.g.
> every time _swrast_ReadPixels gets called, write out an image with what
> Mesa would return.
>
> Seems like someone else might have found a use for something similar
> before.  Is there anything in Mesa to help me out here, or should I
> just ad hoc hack in the image dump myself?

In main/debug.c there's functions for dumping texture images as ppm
files.  You could easily add a similar function for dumping
color/renderbuffers.  Basically malloc a buffer and call
_mesa_ReadPixels() (but be careful of pixelstore state) then
write_ppm().

-Brian

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to