简体   繁体   中英

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?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM