[fixed] OpenGL3 Render system context creation regression.

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
User avatar
altren
Gnome
Posts: 329
Joined: Tue Oct 24, 2006 9:02 am
Location: Moscow, Russa
x 24
Contact:

[fixed] OpenGL3 Render system context creation regression.

Post by altren »

I've bisected, that this commit cause troubles creating OpenGL3 render system inside SDL2 window: use CreateContextAttribs for context ceation https://github.com/OGRECave/ogre/commit ... 800e84b893

Without this commit my RenderSystem::mDriverVersion is 4.6, and with it it is only 3.0, thus now I'm crashing on this assert (this is old assert):

Code: Select all

OgreAssert(hasMinGLVersion(3, 3), "OpenGL 3.3 is not supported");
Last edited by altren on Sun Feb 07, 2021 3:07 am, edited 1 time in total.
Image
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: OpenGL3 Render system context creation regression.

Post by paroj »

what if you use maxVersion = 4 instead of maxVersion = 5?
User avatar
altren
Gnome
Posts: 329
Joined: Tue Oct 24, 2006 9:02 am
Location: Moscow, Russa
x 24
Contact:

Re: OpenGL3 Render system context creation regression.

Post by altren »

Changing to `int maxVersion = 4;` fixed the issue. Thank you. I'm too lazy to make a pull request with a single character, though :)
EDIT: oh wait, this line was removed in latest master.
Image
User avatar
altren
Gnome
Posts: 329
Joined: Tue Oct 24, 2006 9:02 am
Location: Moscow, Russa
x 24
Contact:

Re: OpenGL3 Render system context creation regression.

Post by altren »

Here is working solution for master. I don't know if this is correct for every uses, so I'm rather post it here.
I've added minorVersion variable that is set to 3 in default block.

Code: Select all

        int majorVersion;
        int minorVersion = 0;

        switch(mContextProfile) {
        case CONTEXT_COMPATIBILITY:
            profile = WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
            majorVersion = 1;
            break;
        case CONTEXT_ES:
            profile = WGL_CONTEXT_ES2_PROFILE_BIT_EXT;
            majorVersion = 2;
            break;
        default:
            profile = WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
            majorVersion = 3;
            minorVersion = 3;
            break;
        }

        int context_attribs[] = {
            WGL_CONTEXT_MAJOR_VERSION_ARB, majorVersion,
            WGL_CONTEXT_MINOR_VERSION_ARB, minorVersion,
            WGL_CONTEXT_PROFILE_MASK_ARB, profile,
            0
        };
Image
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: OpenGL3 Render system context creation regression.

Post by paroj »

does that give you exactly a 3.3 context or larger one (e.g. 4.6 as before)?
User avatar
altren
Gnome
Posts: 329
Joined: Tue Oct 24, 2006 9:02 am
Location: Moscow, Russa
x 24
Contact:

Re: OpenGL3 Render system context creation regression.

Post by altren »

3.3
Image
User avatar
altren
Gnome
Posts: 329
Joined: Tue Oct 24, 2006 9:02 am
Location: Moscow, Russa
x 24
Contact:

Re: OpenGL3 Render system context creation regression.

Post by altren »

And just in case, there is exactly same code and same issue in the `GLXGLSupport::createNewContext`. Setting 3.3 there helps as well.
Image
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: OpenGL3 Render system context creation regression.

Post by paroj »

fixed in https://github.com/OGRECave/ogre/pull/1882

being nailed at 3.3 is actually a AMD driver issue, but that should be ok for now.
User avatar
altren
Gnome
Posts: 329
Joined: Tue Oct 24, 2006 9:02 am
Location: Moscow, Russa
x 24
Contact:

Re: OpenGL3 Render system context creation regression.

Post by altren »

Thank you!
Image
Post Reply