user1914692
user1914692

Reputation: 3073

Can GPU support and test shader code of an older version?

Say I want to test shader code of an older version, which is GLSL 1.2. The GPU on the machine actually can support GLSL 4.0 (from the hardware specification).

Upvotes: 1

Views: 128

Answers (2)

Gigo
Gigo

Reputation: 3264

Yes, you should be able to run shaders for a lower version.

Just make sure to identify the glsl version the code is written against in the very first line of every shader source, e.g. #version 120

The OpenGL context should also use the compatibility profile, the core profile does not contain deprecated functionality.

Upvotes: 1

lhf
lhf

Reputation: 72392

You need to create an OpenGL context in compatibility mode, which probably is the default.

Upvotes: 0

Related Questions