[Mesa-dev] GL_ARB_debug_output from drivers

Ian Romanick idr at freedesktop.org
Mon Feb 25 11:32:30 PST 2013


On 02/22/2013 07:52 PM, Eric Anholt wrote:
> One of the features Valve asked for, that they expected after using other
> drivers, is that they can easily get information about performance traps
> (and other important stuff) from drivers.  We wrote INTEL_DEBUG=perf this
> summer as a quick fix, but it's not how most drivers integrate this sort
> of feedback.  Instead, you make a debug context, and you take a bit of a
> performance hit but you get GL_ARB_debug_output messages from the driver.
>
> I didn't want to just dump the same ID in every message, since that's
> definitely not what the spec intends you to do, so I'd been delaying the
> ARB_debug_output work until I could decide how to make that possible.
> This is what I came up with after a few false starts.  I haven't fixed up
> the current messages to have unique IDs, though.  I'd like to do something
> that doesn't involve spamming a static msg_id into each caller, but to
> avoid that I need a #define with varargs.  Is __VA_ARGS__ or some
> equivalent standard enough that we can rely on it outside of drivers?

It looks like Visual Studio supports it since VS 2005:

http://msdn.microsoft.com/en-us/library/ms177415(v=vs.80).aspx

It looks like clang also supports it, but it may generate an extra warning:

http://stackoverflow.com/questions/4786649/are-variadic-macros-nonstandard

The VS support may only be in C++ mode.  Varargs macros are part of C99 
and C++0x.  We may have to experiment.

> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list