PDA

View Full Version : solution for deprecated glPushAttrib/glPopAttrib ...



lzheng
10-04-2017, 05:34 PM
With NVidia's driver, it deals well with the legacy opengl code like:
glPushAttrib/glPopAttrib,
glPushClientAttrib/glPopClientAttrib,
glBegin(GL_TRIANGLES);
...
glEnd();

But with ATI's driver, all these kind of functions do not work in default mode.
I wonder if there is a way to enable them or I have to rewrite all these code in modern gl if I want it run on an ATI graphics card.

Thank you so much!

Silence
10-05-2017, 07:32 AM
What kind of context do you create ? What OpenGL version do you request ?

lzheng
10-05-2017, 12:10 PM
glGetString(GL_VERSION) gives me,
OpenGL version: 4.3.13085 Core Profile Forward-Compatible Context FireGL 10.143.2.1

mhagain
10-05-2017, 12:16 PM
How do you create your context? What OS is the ATI card on?

The issue here is that the default context type should be compatibility, unless you explicitly request a core context at creation time, which means that the deprecated functions (and any legacy programs that may use other deprecated functions) will continue to work.

However, drivers on some operating systems don't give you this behaviour; IIRC under MacOS if you create a 3.x or better context you get core and core only; there is no compatibility option. So the solution if you wish to use deprecated features is to create a 2.1 or 2.0 context.

lzheng
10-05-2017, 04:15 PM
How do you create your context? What OS is the ATI card on?

The issue here is that the default context type should be compatibility, unless you explicitly request a core context at creation time, which means that the deprecated functions (and any legacy programs that may use other deprecated functions) will continue to work.

However, drivers on some operating systems don't give you this behaviour; IIRC under MacOS if you create a 3.x or better context you get core and core only; there is no compatibility option. So the solution if you wish to use deprecated features is to create a 2.1 or 2.0 context.

I figure out that I need to set 2.1 context to make ATI driver work in 4.4 Compatibility Profile.
I set the context in Qt
QSurfaceFormat fmt;
fmt.setVersion(2, 1);
fmt.setProfile(QSurfaceFormat::CompatibilityProfil e);
fmt.setSamples(4);
......

Used GLView to check the GL version of this driver. (http://realtech-vr.com/admin/glview)
It starts from 3.0. Latest one is OpenGL 4.4.
But when I set it to be 4.4 or 4.3, the OpenGL version I get during rendering is always "4.4.13085 Core Profile Forward-Compatible Context FireGL 10.143.2.1"
Only when I set it to be 2.1, the version becomes "4.4 Compatibility Profile FireGL ..."
Will it really support 2.1 ? Or it's an invalid version and only with this version number, ATI driver knows it needs turn back to compatibility profile?

Thank you for all the help!

lzheng
10-09-2017, 12:06 PM
How can I mark this topic as solved?

GClements
10-10-2017, 05:04 AM
How can I mark this topic as solved?

You just have ;)

lzheng
10-11-2017, 03:36 PM
Thank you!