git.s-ol.nu ~forks/DiligentTools / 4052c2c
ImGui renderer: fixed GL shaders to support non-separable programs assiduous 6 months ago
1 changed file(s) with 8 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
8383 static const char* VertexShaderGLSL = R"(
8484 #ifdef VULKAN
8585 # define BINDING(X) layout(binding=X)
86 # define OUT_LOCATION(X) layout(location=X) // Requires separable programs
8687 #else
8788 # define BINDING(X)
89 # define OUT_LOCATION(X)
8890 #endif
8991 BINDING(0) uniform Constants
9092 {
9597 layout(location = 1) in vec2 in_uv;
9698 layout(location = 2) in vec4 in_col;
9799
98 layout(location = 0) out vec4 vsout_col;
99 layout(location = 1) out vec2 vsout_uv;
100 OUT_LOCATION(0) out vec4 vsout_col;
101 OUT_LOCATION(1) out vec2 vsout_uv;
100102
101103 #ifndef GL_ES
102104 out gl_PerVertex
116118 static const char* PixelShaderGLSL = R"(
117119 #ifdef VULKAN
118120 # define BINDING(X) layout(binding=X)
121 # define IN_LOCATION(X) layout(location=X) // Requires separable programs
119122 #else
120123 # define BINDING(X)
124 # define IN_LOCATION(X)
121125 #endif
122126 BINDING(0) uniform sampler2D Texture;
123127
124 layout(location = 0) in vec4 vsout_col;
125 layout(location = 1) in vec2 vsout_uv;
128 IN_LOCATION(0) in vec4 vsout_col;
129 IN_LOCATION(1) in vec2 vsout_uv;
126130
127131 layout(location = 0) out vec4 psout_col;
128132