[PATCH 5/5] wined3d: Add a setting for requesting OpenGL core profile usage.

Matteo Bruni matteo.mystral at gmail.com
Fri Jun 19 14:10:05 CDT 2015


2015-06-19 11:06 GMT+02:00 Henri Verbeet <hverbeet at gmail.com>:
> On 19 June 2015 at 00:07, Matteo Bruni <mbruni at codeweavers.com> wrote:
>> @@ -199,6 +200,14 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL)
>>
>>      if (hkey || appkey)
>>      {
>> +        if (!get_config_key( hkey, appkey, "UseCore", buffer, size))
>> +        {
>> +            if (!strcmp(buffer,"enabled"))
>> +            {
>> +                TRACE("Requested OpenGL Core profile.\n");
>> +                wined3d_settings.use_core = TRUE;
>> +            }
>> +        }
>>          if ( !get_config_key( hkey, appkey, "UseGLSL", buffer, size) )
>>          {
>>              if (!strcmp(buffer,"disabled"))
> Would it make sense to express this in terms of the maximum (desktop)
> GL version to use instead? I imagine that at some point we'll want to
> use GL versions beyond 3.2, at which point it may be useful to have
> something a bit more flexible than just core/classic.

Probably? I can think of two possible variations of the concept:
either just pass the major / minor version pretty much directly to
wglCreateContextAttribs() or make it a sort of a selector between
"supported" GL versions (so it would be just 2.1 and 3.2 initially and
be extended to other options in the future). I think I prefer the
first option even though it gives the users more chance to shoot
themselves in the foot.

>> @@ -1711,6 +1709,7 @@ struct wined3d_gl_limits
>>
>>  struct wined3d_gl_info
>>  {
>> +    BOOL legacy_gl;
>>      DWORD glsl_version;
>>      struct wined3d_gl_limits limits;
>>      DWORD reserved_glsl_constants, reserved_arb_constants;
> This could probably just be an entry in the wined3d_gl_extension enum,
> which I suppose might have advantages if we need this information for
> building e.g. state or format tables.

Yes, that should be doable too. It's a bit of a mess with state /
format tables though, because sometimes you want an entry to be
enabled on core profile, sometimes you want it enabled on legacy
profile, so in the end it will probably require two "extensions". When
you start to consider GLES too it gets even messier since there are
formats valid on desktop GL but not on GLES, others valid only on
GLES, then some more are supported on GLES and legacy desktop GL but
not on core... It's all solvable with a few additional WINED3D_GL_
extension enum values and more table entries but I'm not sure the
"plain" core/legacy extension enums are going to help much there.

I'll give it a try and see how it looks. It's likely to be a net
positive regardless.



More information about the wine-devel mailing list