AMD_debug_output support added

Started by spasi, May 28, 2010, 00:00:12

Previous topic - Next topic

spasi

The next nightly is going to have support for this sweet new extension: AMD_debug_output. I haven't done too many tests, but on API errors it reports the function, the parameter and the value that was wrong, how cool is that? :) The types of messages supported (quote from the spec):

QuoteDEBUG_CATEGORY_API_ERROR_AMD - GL errors caused by invalid API use
DEBUG_CATEGORY_WINDOW_SYSTEM_AMD - Errors and notices from the windowing layer
DEBUG_CATEGORY_DEPRECATION_AMD - Use of functionality that is either deprecated or marked for future deprecation
DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD - Behavior undefined according to specification
DEBUG_CATEGORY_PERFORMANCE_AMD - Implementation-dependent performance warnings
DEBUG_CATEGORY_SHADER_COMPILER_AMD - Information from the GLSL or ARB shader compiler and linker
DEBUG_CATEGORY_APPLICATION_AMD - Application-generated messages
DEBUG_CATEGORY_OTHER_AMD - Messages that do not fit in any of the other categories

Looks extremely useful if they've implemented (or will in the near future) all of the above. To use, you'll need a debug context (a new ContextAttribs().withDebug(true) will do) and then you have 2 options for how to receive messages. The first requires you to query with glGetDebugMessageLogAMD, but there's a chance you'll miss messages if too many are generated. The second requires you to register a callback function that will be called whenever a new message is generated. I have implemented this with the AMDDebugOutputCallback class, you pass an instance to glDebugMessageCallbackAMD and all messages go there. You may implement AMDDebugOutputCallback.Handler interface to do your own handling, the default implementation dumps everything to System.err.

Other stuff added today:

- Support for framebuffer Coverage Sample Anti-Aliasing (NV_multisample_coverage). PixelFormat has been modified accordingly, it's currently available on Windows and Linux only.
- Support for AMD_name_gen_delete.
- Support for extension aliases. This allows an extension that exists with 2 different names but has the exact same functionality to be treated as one. On the latest AMD driver (10.5) this allows usage of AMD_debug_output (currently experimental, exposed as AMDX), ARB_texture_buffer_object_rgb32 and ARB_texture_compression_bptc (both exposed as EXT).

Ciardhubh

Ooohh, AMD_debug_output sounds neat. Especially with a callback you can easily hook into an existing logging infrastructure. There doesn't happen to be something similar for Nvidia drivers, does there?

Too bad you always have to wait so long for a reasonable amount of end users to upgrade their drivers.