openglsuperbible / sb7code

Source code and supporting material for the 7th Edition of OpenGL SuperBible
727 stars 251 forks source link

layout(binding=0) uniform sampler2D requires `#version 420 core` #48

Open solosnake opened 1 year ago

solosnake commented 1 year ago

Problem: I got this when running the bumpmapping example:

VERSION: 4.6 (Core Profile) Mesa 21.2.6
RENDERER: Mesa Intel(R) UHD Graphics (CML GT2)
media/shaders/bumpmapping/bumpmapping.fs.glsl: 0:6(9): error: unrecognized layout identifier `binding'

The example application does not render correctly.


Fix: The bumpmapping.fs.glsl shader has #version 410 core. Changing this to #version 420 core will fix this issue, and the example appears correct.

binding was made core in 4.2 and so may not work as expected in 4.1. Some drivers may have not enforced this.


I would have opened a pull request to address this, but was not able to. Thanks.