From b313f91ab0e6d0a7e5859220a4e6f920f959d631 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 5 Mar 2019 18:55:31 +0100 Subject: [PATCH] - add layout location decl to all postprocess shaders --- src/rendering/gl/shaders/gl_shaderprogram.cpp | 2 +- wadsrc/static/shaders/glsl/bloomcombine.fp | 2 +- wadsrc/static/shaders/glsl/bloomextract.fp | 2 +- wadsrc/static/shaders/glsl/blur.fp | 2 +- wadsrc/static/shaders/glsl/colormap.fp | 2 +- wadsrc/static/shaders/glsl/depthblur.fp | 2 +- wadsrc/static/shaders/glsl/exposureaverage.fp | 2 +- wadsrc/static/shaders/glsl/exposurecombine.fp | 2 +- wadsrc/static/shaders/glsl/exposureextract.fp | 2 +- wadsrc/static/shaders/glsl/fxaa.fp | 2 +- wadsrc/static/shaders/glsl/lensdistortion.fp | 2 +- wadsrc/static/shaders/glsl/lineardepth.fp | 2 +- wadsrc/static/shaders/glsl/present.fp | 2 +- wadsrc/static/shaders/glsl/present_checker3d.fp | 2 +- wadsrc/static/shaders/glsl/present_column3d.fp | 2 +- wadsrc/static/shaders/glsl/present_row3d.fp | 2 +- wadsrc/static/shaders/glsl/screenquad.vp | 6 +++--- wadsrc/static/shaders/glsl/screenquadscale.vp | 6 +++--- wadsrc/static/shaders/glsl/shadowmap.fp | 2 +- wadsrc/static/shaders/glsl/ssao.fp | 2 +- wadsrc/static/shaders/glsl/ssaocombine.fp | 2 +- wadsrc/static/shaders/glsl/tonemap.fp | 2 +- 22 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/rendering/gl/shaders/gl_shaderprogram.cpp b/src/rendering/gl/shaders/gl_shaderprogram.cpp index 8068b3c2c4..83b9ee2278 100644 --- a/src/rendering/gl/shaders/gl_shaderprogram.cpp +++ b/src/rendering/gl/shaders/gl_shaderprogram.cpp @@ -284,7 +284,7 @@ FString FShaderProgram::PatchShader(ShaderType type, const FString &code, const patchedCode << "precision highp float;\n"; patchedCode << "#line 1\n"; - patchedCode << code; + patchedCode << RemoveLayoutLocationDecl(code, type == Vertex ? "out" : "in"); if (maxGlslVersion < 420) { diff --git a/wadsrc/static/shaders/glsl/bloomcombine.fp b/wadsrc/static/shaders/glsl/bloomcombine.fp index 265f8faafb..5b04e2a09f 100644 --- a/wadsrc/static/shaders/glsl/bloomcombine.fp +++ b/wadsrc/static/shaders/glsl/bloomcombine.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D Bloom; diff --git a/wadsrc/static/shaders/glsl/bloomextract.fp b/wadsrc/static/shaders/glsl/bloomextract.fp index c00c92be96..98b6270609 100644 --- a/wadsrc/static/shaders/glsl/bloomextract.fp +++ b/wadsrc/static/shaders/glsl/bloomextract.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D SceneTexture; layout(binding=1) uniform sampler2D ExposureTexture; diff --git a/wadsrc/static/shaders/glsl/blur.fp b/wadsrc/static/shaders/glsl/blur.fp index c3b3492c0f..e4a4a3b18e 100644 --- a/wadsrc/static/shaders/glsl/blur.fp +++ b/wadsrc/static/shaders/glsl/blur.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D SourceTexture; diff --git a/wadsrc/static/shaders/glsl/colormap.fp b/wadsrc/static/shaders/glsl/colormap.fp index a5259b2030..43cc28b25c 100644 --- a/wadsrc/static/shaders/glsl/colormap.fp +++ b/wadsrc/static/shaders/glsl/colormap.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D SceneTexture; diff --git a/wadsrc/static/shaders/glsl/depthblur.fp b/wadsrc/static/shaders/glsl/depthblur.fp index 73a5df170f..b1c0057072 100644 --- a/wadsrc/static/shaders/glsl/depthblur.fp +++ b/wadsrc/static/shaders/glsl/depthblur.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D AODepthTexture; diff --git a/wadsrc/static/shaders/glsl/exposureaverage.fp b/wadsrc/static/shaders/glsl/exposureaverage.fp index f148cca900..57b0ad017c 100644 --- a/wadsrc/static/shaders/glsl/exposureaverage.fp +++ b/wadsrc/static/shaders/glsl/exposureaverage.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D ExposureTexture; diff --git a/wadsrc/static/shaders/glsl/exposurecombine.fp b/wadsrc/static/shaders/glsl/exposurecombine.fp index 447eb7a39a..01ab78b115 100644 --- a/wadsrc/static/shaders/glsl/exposurecombine.fp +++ b/wadsrc/static/shaders/glsl/exposurecombine.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D ExposureTexture; diff --git a/wadsrc/static/shaders/glsl/exposureextract.fp b/wadsrc/static/shaders/glsl/exposureextract.fp index cff729d7c5..d134e8651e 100644 --- a/wadsrc/static/shaders/glsl/exposureextract.fp +++ b/wadsrc/static/shaders/glsl/exposureextract.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D SceneTexture; diff --git a/wadsrc/static/shaders/glsl/fxaa.fp b/wadsrc/static/shaders/glsl/fxaa.fp index 4269426184..ab1d1ad478 100644 --- a/wadsrc/static/shaders/glsl/fxaa.fp +++ b/wadsrc/static/shaders/glsl/fxaa.fp @@ -32,7 +32,7 @@ // //---------------------------------------------------------------------------------- -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D InputTexture; diff --git a/wadsrc/static/shaders/glsl/lensdistortion.fp b/wadsrc/static/shaders/glsl/lensdistortion.fp index 0a87c3897f..1b0d47b4ff 100644 --- a/wadsrc/static/shaders/glsl/lensdistortion.fp +++ b/wadsrc/static/shaders/glsl/lensdistortion.fp @@ -29,7 +29,7 @@ kcube = vec3(0.15, 0.0, 0.0); */ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D InputTexture; diff --git a/wadsrc/static/shaders/glsl/lineardepth.fp b/wadsrc/static/shaders/glsl/lineardepth.fp index 70c41e1c41..7966e310a7 100644 --- a/wadsrc/static/shaders/glsl/lineardepth.fp +++ b/wadsrc/static/shaders/glsl/lineardepth.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; #if defined(MULTISAMPLE) diff --git a/wadsrc/static/shaders/glsl/present.fp b/wadsrc/static/shaders/glsl/present.fp index 6059a66f0a..8a2ca13fa4 100644 --- a/wadsrc/static/shaders/glsl/present.fp +++ b/wadsrc/static/shaders/glsl/present.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D InputTexture; diff --git a/wadsrc/static/shaders/glsl/present_checker3d.fp b/wadsrc/static/shaders/glsl/present_checker3d.fp index cc30adceb9..86842cd660 100644 --- a/wadsrc/static/shaders/glsl/present_checker3d.fp +++ b/wadsrc/static/shaders/glsl/present_checker3d.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D LeftEyeTexture; diff --git a/wadsrc/static/shaders/glsl/present_column3d.fp b/wadsrc/static/shaders/glsl/present_column3d.fp index 11789da107..274a75005c 100644 --- a/wadsrc/static/shaders/glsl/present_column3d.fp +++ b/wadsrc/static/shaders/glsl/present_column3d.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D LeftEyeTexture; diff --git a/wadsrc/static/shaders/glsl/present_row3d.fp b/wadsrc/static/shaders/glsl/present_row3d.fp index e295aa3f8d..c82e2c755a 100644 --- a/wadsrc/static/shaders/glsl/present_row3d.fp +++ b/wadsrc/static/shaders/glsl/present_row3d.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D LeftEyeTexture; diff --git a/wadsrc/static/shaders/glsl/screenquad.vp b/wadsrc/static/shaders/glsl/screenquad.vp index c75f90b7b9..e5e10660f9 100644 --- a/wadsrc/static/shaders/glsl/screenquad.vp +++ b/wadsrc/static/shaders/glsl/screenquad.vp @@ -1,7 +1,7 @@ -layout (location = 0) in vec4 PositionInProjection; -layout (location = 1) in vec2 UV; -out vec2 TexCoord; +layout(location = 0) in vec4 PositionInProjection; +layout(location = 1) in vec2 UV; +layout(location = 0) out vec2 TexCoord; void main() { diff --git a/wadsrc/static/shaders/glsl/screenquadscale.vp b/wadsrc/static/shaders/glsl/screenquadscale.vp index 033a6c0429..3af812a1db 100644 --- a/wadsrc/static/shaders/glsl/screenquadscale.vp +++ b/wadsrc/static/shaders/glsl/screenquadscale.vp @@ -1,7 +1,7 @@ -layout (location = 0) in vec4 PositionInProjection; -layout (location = 1) in vec2 UV; -out vec2 TexCoord; +layout(location = 0) in vec4 PositionInProjection; +layout(location = 1) in vec2 UV; +layout(location = 0) out vec2 TexCoord; void main() { diff --git a/wadsrc/static/shaders/glsl/shadowmap.fp b/wadsrc/static/shaders/glsl/shadowmap.fp index 036ff0836b..6333341246 100644 --- a/wadsrc/static/shaders/glsl/shadowmap.fp +++ b/wadsrc/static/shaders/glsl/shadowmap.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; // A node in an AABB binary tree with lines stored in the leaf nodes diff --git a/wadsrc/static/shaders/glsl/ssao.fp b/wadsrc/static/shaders/glsl/ssao.fp index 8cb2ed61ec..b3ab1178cd 100644 --- a/wadsrc/static/shaders/glsl/ssao.fp +++ b/wadsrc/static/shaders/glsl/ssao.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D DepthTexture; diff --git a/wadsrc/static/shaders/glsl/ssaocombine.fp b/wadsrc/static/shaders/glsl/ssaocombine.fp index 1abc1ad175..f97bb31a69 100644 --- a/wadsrc/static/shaders/glsl/ssaocombine.fp +++ b/wadsrc/static/shaders/glsl/ssaocombine.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D AODepthTexture; diff --git a/wadsrc/static/shaders/glsl/tonemap.fp b/wadsrc/static/shaders/glsl/tonemap.fp index 9e3b35a0ff..e36c4a95ef 100644 --- a/wadsrc/static/shaders/glsl/tonemap.fp +++ b/wadsrc/static/shaders/glsl/tonemap.fp @@ -1,5 +1,5 @@ -in vec2 TexCoord; +layout(location=0) in vec2 TexCoord; layout(location=0) out vec4 FragColor; layout(binding=0) uniform sampler2D InputTexture;