After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 744212 - gdk_gl_context_set_required_version() interprets requests for 4.0 and 4.1 contexts as requests for 4.2 contexts
gdk_gl_context_set_required_version() interprets requests for 4.0 and 4.1 con...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.15.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-02-10 06:04 UTC by Niels Nesse
Modified: 2015-02-10 10:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allow OpenGL 4.0 and 4.1 contexts to be created (901 bytes, patch)
2015-02-10 06:04 UTC, Niels Nesse
none Details | Review

Description Niels Nesse 2015-02-10 06:04:30 UTC
Created attachment 296438 [details] [review]
Allow OpenGL 4.0 and 4.1 contexts to be created

Simple logic error while trying to set 3.2 as a minimum GL version.
Comment 1 Emmanuele Bassi (:ebassi) 2015-02-10 10:22:37 UTC
the second branch is not really needed:

 else if (major < 3)
    priv->minor = 2;

since we don't allow the major version to be less than 3; if you specify (0,0) then we simply set the version to (3,2).

I pushed a different patch, but thanks!
Comment 2 Niels Nesse 2015-02-10 10:33:24 UTC
It seems like it's still wrong to me. If someone misguidedly requests version 2.1 then they will get version 3.1. With my original patch they would still get the minimum 3.2.
Comment 3 Niels Nesse 2015-02-10 10:39:13 UTC
Perhaps a more elegant solution would be to simply convert the version to a single number, perform a simple minimum, then convert back to a major/minor pair

int version = MAX (major * 100 + minor, 320);
prev->major = version / 100;
prev->minor = version % 100;

It would break if we see more than 100 minor revisions I suppose but I think we can rule that out.
Comment 4 Niels Nesse 2015-02-10 10:53:02 UTC
(In reply to Niels Nesse from comment #2)
> It seems like it's still wrong to me. If someone misguidedly requests
> version 2.1 then they will get version 3.1. With my original patch they
> would still get the minimum 3.2.

Nevermind it's correct. I didn't notice at first that you checked "priv->major" and not "major". Thanks.