From 0cfecc591ea5a9d2fa0e18106b6c66148270b346 Mon Sep 17 00:00:00 2001 From: assiduous Date: Wed, 5 Aug 2020 10:17:44 -0700 Subject: Fixed Imgui shader issue in MacOS (fixed https://github.com/DiligentGraphics/DiligentCore/issues/152) --- Imgui/src/ImGuiDiligentRenderer.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Imgui/src/ImGuiDiligentRenderer.cpp') diff --git a/Imgui/src/ImGuiDiligentRenderer.cpp b/Imgui/src/ImGuiDiligentRenderer.cpp index f8857cb..a446f5c 100644 --- a/Imgui/src/ImGuiDiligentRenderer.cpp +++ b/Imgui/src/ImGuiDiligentRenderer.cpp @@ -82,7 +82,12 @@ float4 main(in PSInput PSIn) : SV_Target static const char* VertexShaderGLSL = R"( -layout(binding=0) uniform Constants +#ifdef VULKAN +# define BINDING(X) layout(binding=X) +#else +# define BINDING(X) +#endif +BINDING(0) uniform Constants { mat4 ProjectionMatrix; }; @@ -110,7 +115,12 @@ void main() )"; static const char* PixelShaderGLSL = R"( -layout(binding = 0) uniform sampler2D Texture; +#ifdef VULKAN +# define BINDING(X) layout(binding=X) +#else +# define BINDING(X) +#endif +BINDING(0) uniform sampler2D Texture; layout(location = 0) in vec4 vsout_col; layout(location = 1) in vec2 vsout_uv; -- cgit v1.2.3