[Mesa-dev] [PATCH 12/12] st/mesa: compute supported GL versions at DRIscreen creation

Marek Olšák maraeo at gmail.com
Sun Aug 3 09:31:59 PDT 2014


On Sun, Aug 3, 2014 at 6:23 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> On Sun, Aug 3, 2014 at 11:18 AM, Marek Olšák <maraeo at gmail.com> wrote:
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> This computes all GL versions before any context is created.
>> It's a requirement for GLX_MESA_query_renderer.
>> ---
>>  src/mesa/state_tracker/st_manager.c | 31 +++++++++++++++++++++++++++----
>>  1 file changed, 27 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
>> index 0985422..7bc3326 100644
>> --- a/src/mesa/state_tracker/st_manager.c
>> +++ b/src/mesa/state_tracker/st_manager.c
>> @@ -26,6 +26,7 @@
>>   */
>>
>>  #include "main/mtypes.h"
>> +#include "main/extensions.h"
>>  #include "main/context.h"
>>  #include "main/texobj.h"
>>  #include "main/teximage.h"
>> @@ -38,6 +39,7 @@
>>  #include "st_texture.h"
>>
>>  #include "st_context.h"
>> +#include "st_extensions.h"
>>  #include "st_format.h"
>>  #include "st_cb_fbo.h"
>>  #include "st_cb_flush.h"
>> @@ -910,6 +912,27 @@ st_manager_add_color_renderbuffer(struct st_context *st,
>>     return TRUE;
>>  }
>>
>> +static unsigned get_version(struct pipe_screen *screen,
>> +                            struct st_config_options *options, gl_api api)
>> +{
>> +   struct gl_constants consts = {0};
>> +   struct gl_extensions extensions = {0};
>> +   GLuint version;
>> +
>> +   if ((api == API_OPENGL_COMPAT || api == API_OPENGL_CORE) &&
>> +       _mesa_override_gl_version_contextless(&consts, &api, &version)) {
>
> This could end up changing api to COMPAT from CORE... should you check for that?

I don't think so. It's exactly what core Mesa is doing and it's also
what you will get if you create a context.

Marek


More information about the mesa-dev mailing list