Search code examples
openglglslvulkan

Vulkan GLSL shaders in OpenGL


I'm using a shader transpiler tool called 'glslcc' and it supports transpiling into glsl. However I think the GLSL outputs are Vulkan GLSL since it contains things like the following but I might be wrong.

layout(std140) uniform u_Test
{
    vec4 test;
} _34;

Will this shader work in OpenGL? If not is there a way to convert from this format to something else so it can be loaded in OpenGL?


Solution

  • This is a Uniform Block that can of course be used with OpenGL (see also Uniform Buffer Object). There is no Vulkan exclusive declaration in this code. The Layout Qualifier std140 was introduced with OpenGL 3.1. See The OpenGL® Shading Language, Version 4.60.7.