Does openGL 3.3 code run under 4.1 - opengl

in my computer science course we're working with openGL this term. Our teacher said we need openGL 3.3 (also 3.3 for the shader language), but on my laptop is 4.1 already installed.
OpenGL vendor string: nouveau
OpenGL renderer string: Gallium 0.4 on NVCE
OpenGL core profile version string: 4.1 (Core Profile) Mesa 11.1.2
OpenGL core profile shading language version string: 4.10
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 11.1.2
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 11.1.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:
Is there a way to downgrade openGL or will the code we're programming work on my version too?
I am using a kali linux (debian) laptop with a nvidia GPU by the way.

OpenGL 4.1 is completely backwards compatible with any 3.3 code. So yes, you should be able to run your 3.3 code.

Related

Why won't MESA let me use OpenGL 4.5 (or anything but 3.0)?

I have installed the newest version of MESA (17.0.3), which should allow me to use OpenGL higher than 3.0 (right?)
The problem: I am stuck at version 3.0. (and by that I mean I don't know how to make MESA use a higher version, or even if I can) I know my computer (Chromebook running crouton for linux) has OpenGL 4.5 capability... But I also know nothing about MESA :\.
I do know that you can get info about OpenGL and such using glxinfo, so here's my best info I can give at the moment.
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 400 (Braswell)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.0.3
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 17.0.3
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 17.0.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:
Thanks in advance and any help is appreciated :)
Also, for bonus marks, if anybody knows what a 'Core Profile Version' is, I would love to know :)
Note that the version string appears three times (we ignore the shading language version string):
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.0.3
...
OpenGL version string: 3.0 Mesa 17.0.3
...
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 17.0.3
So if you create a core context, you get 4.5. If you create a non-core (compatibility) context, you get 3.0. If you create an ES context, you get 3.1.
So if you want to use OpenGL 4.5 you have to request a core context. The compatibility context is the default. Information on how to create a core context will be in the documentation for whatever API you use to create an OpenGL context (GLFW, SDL, or whatever).
The (non-Mesa) vendor drivers do not behave the same way, they make the latest version available even if you select a compatibility context. However, Mesa and macOS drivers will only give you newer versions for core contexts.

How to run OpenGL version 3.3 (with Intel HD 4000) on Ubuntu 15.04

Running the command glxinfo | grep OpenGL shows
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on SVGA3D; build: RELEASE;
OpenGL version string: 2.1 Mesa 10.7.0-devel
OpenGL shading language version string: 1.20
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 10.7.0-devel
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
I have the Intel HD 4000 graphic card which can support OpenGL 3.3 according to the sources on internet.
Simply, what should I do so that glxinfo shows version 3.3 so that I may proceed to learn modern graphics programming?
You're running in a VM. GPUs usually are not passed through to the VM and all you get is a shim-driver supporting only a lower OpenGL version, which commands are passed through the VM to the host.
Solution: Run Linux natively on your box.

Fedora 20, HD4400 OpenGL version

My problem is updating Core and GLSL version of OpenGL. I installed newest Intel drivers for my HD 4400 and still got GLSL 1.30. Thing is, this GPU should support OpenGL/GLSL 4.0. No matter what I do, it seems it can't be upgraded and glxinfo still displays 1.30 GLSL. Any help with this from anyone who had similar problem?
glxinfo reporting GL 3.0/GLSL1.30 is fine for this GPU. You are using the Mesa3D open source OpenGL implementation. This does currently support OpenGL up to version 3.3. However, it only does support modern GL for core profiles only (and which is the only profile they are required to proovide, as by the spec). In compatibiliy mode, it is limited to GL 3.0 / GLSL 1.30 - and that is what you see here.
Old versions of glxinfo do not know about core profiles at all, and are limited to compatibility/legacy contexts. More recent versions of glxinfo will report both. So for an Intel HDxxxx GPU on Linux, you will get an output similiar to
$ glxinfo | grep -i opengl
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.0.1
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.0.1
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:

OpenGL GLSL 3.30 in Ubuntu 14.10 mesa 10.1.3

when I try to compile a glsl shader with OpenGL in Ubuntu I get the following error:
- 0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, and 1.00 ES
But when I do a "glxinfo | grep OpenGL" it says:
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD JUNIPER
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.1.3
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.1.3
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
It appears that the glsl version is right, so I don't know what am I doing wrong
I am developing with lwjgl and Java
This is basically telling you that you don't have a core profile context. Mesa is giving you a 3.0 context since it does not support compatibility profiles, and I imagine this is because you did not explicitly ask the framework you used to create your context for a core profile.
Update:
Given lwjgl, when you create your context you need to request a 3.3 core profile.
You can do that like this:
PixelFormat pixelFormat = new PixelFormat ();
ContextAttribs contextAtrributes = new ContextAttribs (3, 3).withProfileCore (true);
[...]
Display.create (pixelFormat, contextAtrributes);

Core profile vs version string? Only getting GLSL 1.3/OGL 3.0 in mesa 10.0.1

In theory, mesa 10.0.1 should support OpenGL 3.3 but currently I'm only getting 3.0 support.
glxinfo gives some confusing results...
[pdel#architect build]$ glxinfo | grep -i opengl
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.0.1
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.0.1
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
(currently running Intel HD Graphics 4000)
Can anyone explain the difference between the "core profile version string" and the "version string" and why they're different?
It's right there in the release notes:
OpenGL 3.3 is only available if requested at context creation because compatibility contexts not supported.
It looks like glxinfo first tries to grab the highest supported core profile information and then drops back to non-core.
So you get two sets of versions, one for a core profile and another for a non-core profile.
If you want OpenGL 3.3 under Mesa you must create a core profile.