On 19 June 2015 at 00:07, Matteo Bruni mbruni@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.
@@ -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.
2015-06-19 11:06 GMT+02:00 Henri Verbeet hverbeet@gmail.com:
On 19 June 2015 at 00:07, Matteo Bruni mbruni@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.
On 19 June 2015 at 21:10, Matteo Bruni matteo.mystral@gmail.com wrote:
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.
The way I had imagined the different context versions working was that we'd essentially end up with an ordered list of versions to try. E.g. "4.0, 3.3, 3.2, 1.0". In that case you could just compare the versions in the list against the limit from the registry and skip them. So e.g. someone setting "2.1" would end up passing 1.0 to CreateContextAttribs(). (Note how that also works when adding support for newer context versions. You initially just add support and have to enable it in the registry. After a while you just bump the default value.) I guess passing the value directly to CreateContextAttribs() would also work, but I'm not sure I see what advantage that would have, and it may not end up being any less code. We'll probably want a winediag message in either scenario.