[Mesa-dev] Advice for implementing KHR_debug state structs

Timothy Arceri t_arceri at yahoo.com.au
Tue Jul 23 06:38:32 PDT 2013


I've done a bit more work and I think I have answered my own question. 

mesa_debug_type, mesa_debug_severity can be extended and used by both extensions as long as the correct validation is done in the functions.
Then I can create a second struct gl_khr_debug_state (which is a KHR_debug version of gl_debug_state) in the gl_context and that way both extensions can be used at the same time not sure why you would want to but it would be possible. Does this sound like I'm heading in the right direction?

Tim

>Hi All,

>
>I've been stalking this list for a while now and I thought I'd finally make an attempt to contribute something. I've decided the KHR_debug extension is a good place to start as >the ARB_debug_output provideds a great starting point. However I've hit my first road block.
>
>I'm ready to setup a struct to hold the state information in mtypes.h for this extension but unsure how to continue. The ARBdebug_output extension already has a struct >gl_debug_state, my question is how should I go about implementing one for KHR_debug should I implement a separate struct for each extension and duplicate a small >amount of code but keep things self contained or should I try refactor things to reuse as much code as possible and risk tying the code up to tightly? How is this sutuation >normally handled in Mesa? I guess my question should be seen as a general question of how to proceed with the rest of the code also functions, etc, do I aim to keep things >self contained or is it safe enough to just aim to reduce duplication? 
>
>Maybe someone can point me to an example of how other simialar extensions are handled?
>
>Thanks,
>Tim



More information about the mesa-dev mailing list