summaryrefslogtreecommitdiffstats
path: root/Imgui/src/ImGuiDiligentRenderer.cpp
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-08-05 17:17:44 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-08-05 17:17:44 +0000
commit0cfecc591ea5a9d2fa0e18106b6c66148270b346 (patch)
treee2407526fbf04637e8df4790f4968d466f3e66d0 /Imgui/src/ImGuiDiligentRenderer.cpp
parentImGui renderer: updated shaders for Vulkan and OpenGL (diff)
downloadDiligentTools-0cfecc591ea5a9d2fa0e18106b6c66148270b346.tar.gz
DiligentTools-0cfecc591ea5a9d2fa0e18106b6c66148270b346.zip
Fixed Imgui shader issue in MacOS (fixed https://github.com/DiligentGraphics/DiligentCore/issues/152)
Diffstat (limited to 'Imgui/src/ImGuiDiligentRenderer.cpp')
-rw-r--r--Imgui/src/ImGuiDiligentRenderer.cpp14
1 files changed, 12 insertions, 2 deletions
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;