diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-11-22 02:22:57 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-11-22 02:22:57 +0000 |
| commit | 4052c2c9eea6aca18924e1aca5784197c4a4be4f (patch) | |
| tree | 08343de7ca37f8d790e46aeac63bf3c341784dc6 /Imgui/src/ImGuiDiligentRenderer.cpp | |
| parent | MacOSAppBase: added Metal mode (diff) | |
| download | DiligentTools-4052c2c9eea6aca18924e1aca5784197c4a4be4f.tar.gz DiligentTools-4052c2c9eea6aca18924e1aca5784197c4a4be4f.zip | |
ImGui renderer: fixed GL shaders to support non-separable programs
Diffstat (limited to 'Imgui/src/ImGuiDiligentRenderer.cpp')
| -rw-r--r-- | Imgui/src/ImGuiDiligentRenderer.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
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; |
