From 4052c2c9eea6aca18924e1aca5784197c4a4be4f Mon Sep 17 00:00:00 2001 From: assiduous Date: Sat, 21 Nov 2020 18:22:57 -0800 Subject: ImGui renderer: fixed GL shaders to support non-separable programs --- Imgui/src/ImGuiDiligentRenderer.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Imgui/src/ImGuiDiligentRenderer.cpp') diff --git a/Imgui/src/ImGuiDiligentRenderer.cpp b/Imgui/src/ImGuiDiligentRenderer.cpp index 1d31fa4..5286d7f 100644 --- a/Imgui/src/ImGuiDiligentRenderer.cpp +++ b/Imgui/src/ImGuiDiligentRenderer.cpp @@ -84,8 +84,10 @@ float4 main(in PSInput PSIn) : SV_Target static const char* VertexShaderGLSL = R"( #ifdef VULKAN # define BINDING(X) layout(binding=X) +# define OUT_LOCATION(X) layout(location=X) // Requires separable programs #else # define BINDING(X) +# define OUT_LOCATION(X) #endif BINDING(0) uniform Constants { @@ -96,8 +98,8 @@ layout(location = 0) in vec2 in_pos; layout(location = 1) in vec2 in_uv; layout(location = 2) in vec4 in_col; -layout(location = 0) out vec4 vsout_col; -layout(location = 1) out vec2 vsout_uv; +OUT_LOCATION(0) out vec4 vsout_col; +OUT_LOCATION(1) out vec2 vsout_uv; #ifndef GL_ES out gl_PerVertex @@ -117,13 +119,15 @@ void main() static const char* PixelShaderGLSL = R"( #ifdef VULKAN # define BINDING(X) layout(binding=X) +# define IN_LOCATION(X) layout(location=X) // Requires separable programs #else # define BINDING(X) +# define IN_LOCATION(X) #endif BINDING(0) uniform sampler2D Texture; -layout(location = 0) in vec4 vsout_col; -layout(location = 1) in vec2 vsout_uv; +IN_LOCATION(0) in vec4 vsout_col; +IN_LOCATION(1) in vec2 vsout_uv; layout(location = 0) out vec4 psout_col; -- cgit v1.2.3