Handmade Hero»Forums»Code
Shazan Shums
159 posts
Some day I will make quality software. Programming FTW.
[Day 390] Shader Validation error Assert.
Edited by Shazan Shums on
I get an Assert(!"Shader validation failed") in the function OpenglCreateProgram. I know that my hardware supports glsl 1.40 . Can't seem to figure out the problem.
Mārtiņš Možeiko
2559 posts / 2 projects
[Day 390] Shader Validation error Assert.
Edited by Mārtiņš Možeiko on
Check the error messages from shader compiler. That assert is there exactly for reason to stop in debugger. Then it's up to you to check VertexErrors, FragmentErrors and ProgramErrors strings that will contain error messages. You can see Casey doing this in videos multiple times.

AFAIK HH is using OpenGL 3.2 for shaders - GLSL source has "#version 150", so that means GLSL 1.4 (OpenGL 3.1) is not supported.
Shazan Shums
159 posts
Some day I will make quality software. Programming FTW.
[Day 390] Shader Validation error Assert.
FragmentsErrors shows this: ERROR: 2:5: 'GL_ARB_texture_multisample' : extension is disabled
ERROR: 2:6: 'GL_ARB_texture_multisample' : extension is disabled

How to bypass this.
Mārtiņš Možeiko
2559 posts / 2 projects
[Day 390] Shader Validation error Assert.
Does your GPU and driver supports "GL_ARB_texture_multisample" extension?
Can you try to put "#extension GL_ARB_texture_multisample : require" at beginning of fragment shader?

For which shader does it fail with this error? CompileResolveMultisample?
Shazan Shums
159 posts
Some day I will make quality software. Programming FTW.
[Day 390] Shader Validation error Assert.
Edited by Shazan Shums on
No my driver doesn't have texture_multisample support. Does this mean handmade hero will not work on my PC or is there a fix .
Mārtiņš Možeiko
2559 posts / 2 projects
[Day 390] Shader Validation error Assert.
Edited by Mārtiņš Možeiko on
In current state it won't run.

If you would put "#if MultisamplingDebug" / "#endif" around "uniform sampler2DM" lines then it should run as long as you keep MultisamplingDebug setting to false. I believe that's its default value currently.

You'll also probably need to change "150" to "130" in #version line when multi sample is disabled.