0
\$\begingroup\$

I have a question about compute shaders.

My GPU is an AMD mobility Radeon 6490 which as the AMD website says supports OpenGL 4.1. However, when I check for my compatibility version via 'glGetString(GL_VERSION)' I get 4.3.12618 Compatibility Profile Context 13.250.18.0. Does that mean I should be able to use compute shaders as they are introduced in OpenGL 4.3?

If I try to create a compute shader in my program GLenum type GL_COMPUTE_SHADER is unknown but I'm not sure if newest headers are included.

My GPU also supports the 'GL_ARB_compute_shader' extension.

So is there a special way to enable this extension or should I try to somehow include newer headers? Or will I not be able to use compute shaders at all (I don't want to use OpenCL)?

Thanks for answer.

\$\endgroup\$
4
  • \$\begingroup\$ sounds like you have the right hardware level and either you're looking in the wrong place for API stuff or you're missing something so I would go update my drivers (should give you the latest openGL version). \$\endgroup\$
    – War
    Feb 10, 2014 at 13:07
  • \$\begingroup\$ Is your platform Windows ? \$\endgroup\$
    – concept3d
    Feb 10, 2014 at 13:32
  • \$\begingroup\$ yes I'm on Windows 8.1, speaking of drivers I'm using newest drivers included in Catalyst 14.1 beta so I guess I should have latest version of OpenGL but question is if headers are included correctly. I'm not including gl explcitly but using glew. Might that be a problem? \$\endgroup\$
    – user42031
    Feb 10, 2014 at 14:32
  • 1
    \$\begingroup\$ you have to use glew (or get the extensions manually), but the problem is that glew itself might not have support to the specific function yet. \$\endgroup\$
    – concept3d
    Feb 10, 2014 at 15:18

1 Answer 1

3
\$\begingroup\$

Your guess is correct - you need newer headers.

A bit of explanation:

If you use Windows, you don't get new API 'out of the box'. Headers provided with Windows SDK and SDK included in Visual Studio has only standard GL.h, containing only functions present in MS generic implementation (oooold).

Basically, when you create apps using OpenGL, you need to download the newest header from OpenGL site and then query adresses of required functions directly from DLL that contains OpenGL implementation - wglGetProcAddress(). The reason for that, is because GL implementation is provided by GPU vendors and updated automatically when GPU drivers are being installed - that's also the reason, why GPU drivers updating is so important when it comes to OpenGL.

But it's a mess. And that's why various libraries were developed, that allows you to make it in more automated way. The best and most-widely used example is GLEW.

You already use it, so you probably know some of the above.

Now, the problem is probably with version of GLEW you're using now - it simply doesn't define some constants, so you are not able to use them. If I remeber correctly, support for compute shaders was added in version 1.7.0. It IS supported by now, beacause I use it in my project.

Simply go to download page of GLEW and get the newest version. Replace current headers, so new features will be visible.

Also, don't forget to replace .lib files and copy DLL's to Bin folder of your project or system32/SysWOW64 directory. GLEW has recently merged x86 and x64 versions, so both are now in single package.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .