From ad7aaa8f2acff62bfd9f4cc225e0ffe087aaeea8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 12 Jun 2018 23:52:33 +0200 Subject: [PATCH] - specify fragment output locations in the shader source. OpenGL has been supporting this since version 3.3 and Vulkan requires it so it's the way to go. --- .gitignore | 1 + src/gl/shaders/gl_ambientshader.cpp | 4 ---- src/gl/shaders/gl_bloomshader.cpp | 2 -- src/gl/shaders/gl_blurshader.cpp | 1 - src/gl/shaders/gl_colormapshader.cpp | 1 - src/gl/shaders/gl_fxaashader.cpp | 2 -- src/gl/shaders/gl_lensshader.cpp | 1 - src/gl/shaders/gl_postprocessshader.cpp | 1 - src/gl/shaders/gl_presentshader.cpp | 1 - src/gl/shaders/gl_shader.cpp | 10 +--------- src/gl/shaders/gl_shaderprogram.cpp | 11 ----------- src/gl/shaders/gl_shaderprogram.h | 1 - src/gl/shaders/gl_shadowmapshader.cpp | 1 - src/gl/shaders/gl_tonemapshader.cpp | 4 ---- 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/burn.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/fogboundary.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/main.fp | 6 +++--- 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/shadowmap.fp | 2 +- wadsrc/static/shaders/glsl/ssao.fp | 2 +- wadsrc/static/shaders/glsl/ssaocombine.fp | 2 +- wadsrc/static/shaders/glsl/stencil.fp | 2 +- wadsrc/static/shaders/glsl/swshader.fp | 2 +- wadsrc/static/shaders/glsl/tonemap.fp | 2 +- 38 files changed, 28 insertions(+), 65 deletions(-) diff --git a/.gitignore b/.gitignore index 85af54469..094a390e7 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,4 @@ /src/gl/unused /mapfiles_release/*.map .DS_Store +/build_vc2017-32 diff --git a/src/gl/shaders/gl_ambientshader.cpp b/src/gl/shaders/gl_ambientshader.cpp index 647910766..acebe6ad5 100644 --- a/src/gl/shaders/gl_ambientshader.cpp +++ b/src/gl/shaders/gl_ambientshader.cpp @@ -39,7 +39,6 @@ void FLinearDepthShader::Bind() mShader.reset(new FShaderProgram()); mShader->Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); mShader->Compile(FShaderProgram::Fragment, "shaders/glsl/lineardepth.fp", prolog, 330); - mShader->SetFragDataLocation(0, "FragColor"); mShader->Link("shaders/glsl/lineardepth"); mShader->SetAttribLocation(0, "PositionInProjection"); mShader->SetUniformBufferLocation(Uniforms.BindingPoint(), "Uniforms"); @@ -65,7 +64,6 @@ void FSSAOShader::Bind() mShader.reset(new FShaderProgram()); mShader->Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); mShader->Compile(FShaderProgram::Fragment, "shaders/glsl/ssao.fp", prolog, 330); - mShader->SetFragDataLocation(0, "FragColor"); mShader->Link("shaders/glsl/ssao"); mShader->SetAttribLocation(0, "PositionInProjection"); mShader->SetUniformBufferLocation(Uniforms.BindingPoint(), "Uniforms"); @@ -116,7 +114,6 @@ void FDepthBlurShader::Bind(bool vertical) shader.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); shader.Compile(FShaderProgram::Fragment, "shaders/glsl/depthblur.fp", prolog, 330); - shader.SetFragDataLocation(0, "FragColor"); shader.Link("shaders/glsl/depthblur"); shader.SetAttribLocation(0, "PositionInProjection"); shader.SetUniformBufferLocation(Uniforms[vertical].BindingPoint(), "Uniforms"); @@ -141,7 +138,6 @@ void FSSAOCombineShader::Bind() mShader.reset(new FShaderProgram()); mShader->Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); mShader->Compile(FShaderProgram::Fragment, "shaders/glsl/ssaocombine.fp", prolog, 330); - mShader->SetFragDataLocation(0, "FragColor"); mShader->Link("shaders/glsl/ssaocombine"); mShader->SetAttribLocation(0, "PositionInProjection"); mShader->SetUniformBufferLocation(Uniforms.BindingPoint(), "Uniforms"); diff --git a/src/gl/shaders/gl_bloomshader.cpp b/src/gl/shaders/gl_bloomshader.cpp index 2ab14d3b4..975831c97 100644 --- a/src/gl/shaders/gl_bloomshader.cpp +++ b/src/gl/shaders/gl_bloomshader.cpp @@ -37,7 +37,6 @@ void FBloomExtractShader::Bind() mShader.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); mShader.Compile(FShaderProgram::Fragment, "shaders/glsl/bloomextract.fp", prolog, 330); - mShader.SetFragDataLocation(0, "FragColor"); mShader.Link("shaders/glsl/bloomextract"); mShader.SetAttribLocation(0, "PositionInProjection"); mShader.SetUniformBufferLocation(Uniforms.BindingPoint(), "Uniforms"); @@ -54,7 +53,6 @@ void FBloomCombineShader::Bind() { mShader.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); mShader.Compile(FShaderProgram::Fragment, "shaders/glsl/bloomcombine.fp", "", 330); - mShader.SetFragDataLocation(0, "FragColor"); mShader.Link("shaders/glsl/bloomcombine"); mShader.SetAttribLocation(0, "PositionInProjection"); BloomTexture.Init(mShader, "Bloom"); diff --git a/src/gl/shaders/gl_blurshader.cpp b/src/gl/shaders/gl_blurshader.cpp index 31e54a90a..d35fb0672 100644 --- a/src/gl/shaders/gl_blurshader.cpp +++ b/src/gl/shaders/gl_blurshader.cpp @@ -44,7 +44,6 @@ void FBlurShader::Bind(bool vertical) mShader[vertical].Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); mShader[vertical].Compile(FShaderProgram::Fragment, "shaders/glsl/blur.fp", prolog, 330); - mShader[vertical].SetFragDataLocation(0, "FragColor"); mShader[vertical].Link("shaders/glsl/blur"); mShader[vertical].SetAttribLocation(0, "PositionInProjection"); mShader[vertical].SetUniformBufferLocation(POSTPROCESS_BINDINGPOINT, "Uniforms"); diff --git a/src/gl/shaders/gl_colormapshader.cpp b/src/gl/shaders/gl_colormapshader.cpp index 2a0f9d852..b13c6297a 100644 --- a/src/gl/shaders/gl_colormapshader.cpp +++ b/src/gl/shaders/gl_colormapshader.cpp @@ -38,7 +38,6 @@ void FColormapShader::Bind() shader.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); shader.Compile(FShaderProgram::Fragment, "shaders/glsl/colormap.fp", prolog, 330); - shader.SetFragDataLocation(0, "FragColor"); shader.Link("shaders/glsl/colormap"); shader.SetAttribLocation(0, "PositionInProjection"); shader.SetUniformBufferLocation(Uniforms.BindingPoint(), "Uniforms"); diff --git a/src/gl/shaders/gl_fxaashader.cpp b/src/gl/shaders/gl_fxaashader.cpp index 96fea58f1..b384773a7 100644 --- a/src/gl/shaders/gl_fxaashader.cpp +++ b/src/gl/shaders/gl_fxaashader.cpp @@ -35,7 +35,6 @@ void FFXAALumaShader::Bind() { mShader.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); mShader.Compile(FShaderProgram::Fragment, "shaders/glsl/fxaa.fp", "#define FXAA_LUMA_PASS\n", 330); - mShader.SetFragDataLocation(0, "FragColor"); mShader.Link("shaders/glsl/fxaa"); mShader.SetAttribLocation(0, "PositionInProjection"); InputTexture.Init(mShader, "InputTexture"); @@ -88,7 +87,6 @@ void FFXAAShader::Bind() shader.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); shader.Compile(FShaderProgram::Fragment, "shaders/glsl/fxaa.fp", prolog, maxVersion); - shader.SetFragDataLocation(0, "FragColor"); shader.Link("shaders/glsl/fxaa"); shader.SetAttribLocation(0, "PositionInProjection"); shader.SetUniformBufferLocation(Uniforms.BindingPoint(), "Uniforms"); diff --git a/src/gl/shaders/gl_lensshader.cpp b/src/gl/shaders/gl_lensshader.cpp index f9b733763..e7851fac4 100644 --- a/src/gl/shaders/gl_lensshader.cpp +++ b/src/gl/shaders/gl_lensshader.cpp @@ -37,7 +37,6 @@ void FLensShader::Bind() mShader.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); mShader.Compile(FShaderProgram::Fragment, "shaders/glsl/lensdistortion.fp", prolog, 330); - mShader.SetFragDataLocation(0, "FragColor"); mShader.Link("shaders/glsl/lensdistortion"); mShader.SetAttribLocation(0, "PositionInProjection"); mShader.SetUniformBufferLocation(Uniforms.BindingPoint(), "Uniforms"); diff --git a/src/gl/shaders/gl_postprocessshader.cpp b/src/gl/shaders/gl_postprocessshader.cpp index 7b357dbec..c2874f60f 100644 --- a/src/gl/shaders/gl_postprocessshader.cpp +++ b/src/gl/shaders/gl_postprocessshader.cpp @@ -168,7 +168,6 @@ void PostProcessShaderInstance::CompileShader() mProgram.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", Desc->ShaderVersion); mProgram.Compile(FShaderProgram::Fragment, lumpName, code, prolog.GetChars(), Desc->ShaderVersion); - mProgram.SetFragDataLocation(0, "FragColor"); mProgram.Link(Desc->ShaderLumpName.GetChars()); mProgram.SetAttribLocation(0, "PositionInProjection"); mInputTexture.Init(mProgram, "InputTexture"); diff --git a/src/gl/shaders/gl_presentshader.cpp b/src/gl/shaders/gl_presentshader.cpp index 7ef250cba..586f34708 100644 --- a/src/gl/shaders/gl_presentshader.cpp +++ b/src/gl/shaders/gl_presentshader.cpp @@ -35,7 +35,6 @@ void FPresentShaderBase::Init(const char * vtx_shader_name, const char * program mShader.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquadscale.vp", prolog, 330); mShader.Compile(FShaderProgram::Fragment, vtx_shader_name, prolog, 330); - mShader.SetFragDataLocation(0, "FragColor"); mShader.Link(program_name); mShader.SetAttribLocation(0, "PositionInProjection"); mShader.SetAttribLocation(1, "UV"); diff --git a/src/gl/shaders/gl_shader.cpp b/src/gl/shaders/gl_shader.cpp index 5037b3b0d..aa59de152 100644 --- a/src/gl/shaders/gl_shader.cpp +++ b/src/gl/shaders/gl_shader.cpp @@ -263,13 +263,9 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char * { vp_comb.Format("#version 300 es\n#define NUM_UBO_LIGHTS %d\n", lightbuffersize); } - else if (gl.glslversion < 1.4f) // This differentiation is for some Intel drivers which fail on #extension, so use of #version 140 is necessary - { - vp_comb.Format("#version 130\n#extension GL_ARB_uniform_buffer_object : require\n#define NUM_UBO_LIGHTS %d\n", lightbuffersize); - } else { - vp_comb.Format("#version 140\n#define NUM_UBO_LIGHTS %d\n", lightbuffersize); + vp_comb.Format("#version 330 core\n#define NUM_UBO_LIGHTS %d\n", lightbuffersize); } } else @@ -380,10 +376,6 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char * glBindAttribLocation(hShader, VATTR_VERTEX2, "aVertex2"); glBindAttribLocation(hShader, VATTR_NORMAL, "aNormal"); - glBindFragDataLocation(hShader, 0, "FragColor"); - glBindFragDataLocation(hShader, 1, "FragFog"); - glBindFragDataLocation(hShader, 2, "FragNormal"); - glLinkProgram(hShader); glGetShaderInfoLog(hVertProg, 10000, NULL, buffer); diff --git a/src/gl/shaders/gl_shaderprogram.cpp b/src/gl/shaders/gl_shaderprogram.cpp index 35f4cfef4..17d80a08a 100644 --- a/src/gl/shaders/gl_shaderprogram.cpp +++ b/src/gl/shaders/gl_shaderprogram.cpp @@ -118,17 +118,6 @@ void FShaderProgram::Compile(ShaderType type, const char *name, const FString &c } } -//========================================================================== -// -// Binds a fragment output variable to a frame buffer render target -// -//========================================================================== - -void FShaderProgram::SetFragDataLocation(int index, const char *name) -{ - glBindFragDataLocation(mProgram, index, name); -} - //========================================================================== // // Links a program with the compiled shaders diff --git a/src/gl/shaders/gl_shaderprogram.h b/src/gl/shaders/gl_shaderprogram.h index 05129bb76..1e1cead81 100644 --- a/src/gl/shaders/gl_shaderprogram.h +++ b/src/gl/shaders/gl_shaderprogram.h @@ -20,7 +20,6 @@ public: void Compile(ShaderType type, const char *lumpName, const char *defines, int maxGlslVersion); void Compile(ShaderType type, const char *name, const FString &code, const char *defines, int maxGlslVersion); - void SetFragDataLocation(int index, const char *name); void Link(const char *name); void SetAttribLocation(int index, const char *name); void SetUniformBufferLocation(int index, const char *name); diff --git a/src/gl/shaders/gl_shadowmapshader.cpp b/src/gl/shaders/gl_shadowmapshader.cpp index 0454801f5..23fcf4e48 100644 --- a/src/gl/shaders/gl_shadowmapshader.cpp +++ b/src/gl/shaders/gl_shadowmapshader.cpp @@ -32,7 +32,6 @@ void FShadowMapShader::Bind() mShader.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 430); mShader.Compile(FShaderProgram::Fragment, "shaders/glsl/shadowmap.fp", prolog, 430); - mShader.SetFragDataLocation(0, "FragColor"); mShader.Link("shaders/glsl/shadowmap"); mShader.SetAttribLocation(0, "PositionInProjection"); mShader.SetUniformBufferLocation(Uniforms.BindingPoint(), "Uniforms"); diff --git a/src/gl/shaders/gl_tonemapshader.cpp b/src/gl/shaders/gl_tonemapshader.cpp index ed50dd588..ae721974a 100644 --- a/src/gl/shaders/gl_tonemapshader.cpp +++ b/src/gl/shaders/gl_tonemapshader.cpp @@ -37,7 +37,6 @@ void FTonemapShader::Bind() { shader.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); shader.Compile(FShaderProgram::Fragment, "shaders/glsl/tonemap.fp", GetDefines(gl_tonemap), 330); - shader.SetFragDataLocation(0, "FragColor"); shader.Link("shaders/glsl/tonemap"); shader.SetAttribLocation(0, "PositionInProjection"); SceneTexture.Init(shader, "InputTexture"); @@ -73,7 +72,6 @@ void FExposureExtractShader::Bind() mShader.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); mShader.Compile(FShaderProgram::Fragment, "shaders/glsl/exposureextract.fp", prolog, 330); - mShader.SetFragDataLocation(0, "FragColor"); mShader.Link("shaders/glsl/exposureextract"); mShader.SetAttribLocation(0, "PositionInProjection"); mShader.SetUniformBufferLocation(Uniforms.BindingPoint(), "Uniforms"); @@ -89,7 +87,6 @@ void FExposureAverageShader::Bind() { mShader.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 400); mShader.Compile(FShaderProgram::Fragment, "shaders/glsl/exposureaverage.fp", "", 400); - mShader.SetFragDataLocation(0, "FragColor"); mShader.Link("shaders/glsl/exposureaverage"); mShader.SetAttribLocation(0, "PositionInProjection"); ExposureTexture.Init(mShader, "ExposureTexture"); @@ -105,7 +102,6 @@ void FExposureCombineShader::Bind() mShader.Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330); mShader.Compile(FShaderProgram::Fragment, "shaders/glsl/exposurecombine.fp", prolog, 330); - mShader.SetFragDataLocation(0, "FragColor"); mShader.Link("shaders/glsl/exposurecombine"); mShader.SetAttribLocation(0, "PositionInProjection"); mShader.SetUniformBufferLocation(Uniforms.BindingPoint(), "Uniforms"); diff --git a/wadsrc/static/shaders/glsl/bloomcombine.fp b/wadsrc/static/shaders/glsl/bloomcombine.fp index 57496771c..39db6734c 100644 --- a/wadsrc/static/shaders/glsl/bloomcombine.fp +++ b/wadsrc/static/shaders/glsl/bloomcombine.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D Bloom; diff --git a/wadsrc/static/shaders/glsl/bloomextract.fp b/wadsrc/static/shaders/glsl/bloomextract.fp index ca295500c..8b336ddb9 100644 --- a/wadsrc/static/shaders/glsl/bloomextract.fp +++ b/wadsrc/static/shaders/glsl/bloomextract.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D SceneTexture; uniform sampler2D ExposureTexture; diff --git a/wadsrc/static/shaders/glsl/blur.fp b/wadsrc/static/shaders/glsl/blur.fp index 93232e31a..ee6e057ed 100644 --- a/wadsrc/static/shaders/glsl/blur.fp +++ b/wadsrc/static/shaders/glsl/blur.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D SourceTexture; diff --git a/wadsrc/static/shaders/glsl/burn.fp b/wadsrc/static/shaders/glsl/burn.fp index d3f6f20e9..53a52c2dd 100644 --- a/wadsrc/static/shaders/glsl/burn.fp +++ b/wadsrc/static/shaders/glsl/burn.fp @@ -1,7 +1,7 @@ in vec4 vTexCoord; in vec4 vColor; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; void main() { diff --git a/wadsrc/static/shaders/glsl/colormap.fp b/wadsrc/static/shaders/glsl/colormap.fp index fe1d9ef70..c1f776959 100644 --- a/wadsrc/static/shaders/glsl/colormap.fp +++ b/wadsrc/static/shaders/glsl/colormap.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D tex; diff --git a/wadsrc/static/shaders/glsl/depthblur.fp b/wadsrc/static/shaders/glsl/depthblur.fp index 627014f88..83a03c598 100644 --- a/wadsrc/static/shaders/glsl/depthblur.fp +++ b/wadsrc/static/shaders/glsl/depthblur.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D AODepthTexture; diff --git a/wadsrc/static/shaders/glsl/exposureaverage.fp b/wadsrc/static/shaders/glsl/exposureaverage.fp index 41c0909d2..43da450b2 100644 --- a/wadsrc/static/shaders/glsl/exposureaverage.fp +++ b/wadsrc/static/shaders/glsl/exposureaverage.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D ExposureTexture; diff --git a/wadsrc/static/shaders/glsl/exposurecombine.fp b/wadsrc/static/shaders/glsl/exposurecombine.fp index e4e7126bb..b3d4d64a1 100644 --- a/wadsrc/static/shaders/glsl/exposurecombine.fp +++ b/wadsrc/static/shaders/glsl/exposurecombine.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D ExposureTexture; diff --git a/wadsrc/static/shaders/glsl/exposureextract.fp b/wadsrc/static/shaders/glsl/exposureextract.fp index 7a5b4f7a1..6cf064906 100644 --- a/wadsrc/static/shaders/glsl/exposureextract.fp +++ b/wadsrc/static/shaders/glsl/exposureextract.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D SceneTexture; diff --git a/wadsrc/static/shaders/glsl/fogboundary.fp b/wadsrc/static/shaders/glsl/fogboundary.fp index 52ea9791b..9dcdb4850 100644 --- a/wadsrc/static/shaders/glsl/fogboundary.fp +++ b/wadsrc/static/shaders/glsl/fogboundary.fp @@ -1,5 +1,5 @@ in vec4 pixelpos; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; //=========================================================================== // diff --git a/wadsrc/static/shaders/glsl/fxaa.fp b/wadsrc/static/shaders/glsl/fxaa.fp index 415260802..64e205429 100644 --- a/wadsrc/static/shaders/glsl/fxaa.fp +++ b/wadsrc/static/shaders/glsl/fxaa.fp @@ -33,7 +33,7 @@ //---------------------------------------------------------------------------------- in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D InputTexture; diff --git a/wadsrc/static/shaders/glsl/lensdistortion.fp b/wadsrc/static/shaders/glsl/lensdistortion.fp index d3cc5c7ca..c1ce11232 100644 --- a/wadsrc/static/shaders/glsl/lensdistortion.fp +++ b/wadsrc/static/shaders/glsl/lensdistortion.fp @@ -30,7 +30,7 @@ */ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D InputTexture; diff --git a/wadsrc/static/shaders/glsl/lineardepth.fp b/wadsrc/static/shaders/glsl/lineardepth.fp index a139b8ac0..999834181 100644 --- a/wadsrc/static/shaders/glsl/lineardepth.fp +++ b/wadsrc/static/shaders/glsl/lineardepth.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; #if defined(MULTISAMPLE) uniform sampler2DMS DepthTexture; diff --git a/wadsrc/static/shaders/glsl/main.fp b/wadsrc/static/shaders/glsl/main.fp index ddd1f1439..3e47f0e43 100644 --- a/wadsrc/static/shaders/glsl/main.fp +++ b/wadsrc/static/shaders/glsl/main.fp @@ -6,10 +6,10 @@ in vec4 vEyeNormal; in vec4 vTexCoord; in vec4 vColor; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; #ifdef GBUFFER_PASS -out vec4 FragFog; -out vec4 FragNormal; +layout(location=1) out vec4 FragFog; +layout(location=2) out vec4 FragNormal; #endif vec4 Process(vec4 color); diff --git a/wadsrc/static/shaders/glsl/present.fp b/wadsrc/static/shaders/glsl/present.fp index cacd42e64..bfe2b4e76 100644 --- a/wadsrc/static/shaders/glsl/present.fp +++ b/wadsrc/static/shaders/glsl/present.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D InputTexture; diff --git a/wadsrc/static/shaders/glsl/present_checker3d.fp b/wadsrc/static/shaders/glsl/present_checker3d.fp index 5f0205038..e4f5690a9 100644 --- a/wadsrc/static/shaders/glsl/present_checker3d.fp +++ b/wadsrc/static/shaders/glsl/present_checker3d.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D LeftEyeTexture; uniform sampler2D RightEyeTexture; diff --git a/wadsrc/static/shaders/glsl/present_column3d.fp b/wadsrc/static/shaders/glsl/present_column3d.fp index 667003806..27e091c48 100644 --- a/wadsrc/static/shaders/glsl/present_column3d.fp +++ b/wadsrc/static/shaders/glsl/present_column3d.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D LeftEyeTexture; uniform sampler2D RightEyeTexture; diff --git a/wadsrc/static/shaders/glsl/present_row3d.fp b/wadsrc/static/shaders/glsl/present_row3d.fp index a318560c8..83d8d3c44 100644 --- a/wadsrc/static/shaders/glsl/present_row3d.fp +++ b/wadsrc/static/shaders/glsl/present_row3d.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D LeftEyeTexture; uniform sampler2D RightEyeTexture; diff --git a/wadsrc/static/shaders/glsl/shadowmap.fp b/wadsrc/static/shaders/glsl/shadowmap.fp index b578a78ce..fb2257b92 100644 --- a/wadsrc/static/shaders/glsl/shadowmap.fp +++ b/wadsrc/static/shaders/glsl/shadowmap.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; struct GPUNode { diff --git a/wadsrc/static/shaders/glsl/ssao.fp b/wadsrc/static/shaders/glsl/ssao.fp index ea4bc6644..16b9c1548 100644 --- a/wadsrc/static/shaders/glsl/ssao.fp +++ b/wadsrc/static/shaders/glsl/ssao.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D DepthTexture; diff --git a/wadsrc/static/shaders/glsl/ssaocombine.fp b/wadsrc/static/shaders/glsl/ssaocombine.fp index 692829dc4..82bb198d9 100644 --- a/wadsrc/static/shaders/glsl/ssaocombine.fp +++ b/wadsrc/static/shaders/glsl/ssaocombine.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D AODepthTexture; diff --git a/wadsrc/static/shaders/glsl/stencil.fp b/wadsrc/static/shaders/glsl/stencil.fp index 65f12b405..f60eef0ba 100644 --- a/wadsrc/static/shaders/glsl/stencil.fp +++ b/wadsrc/static/shaders/glsl/stencil.fp @@ -1,5 +1,5 @@ in vec4 pixelpos; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; void main() { diff --git a/wadsrc/static/shaders/glsl/swshader.fp b/wadsrc/static/shaders/glsl/swshader.fp index 79432b208..b91c324b8 100644 --- a/wadsrc/static/shaders/glsl/swshader.fp +++ b/wadsrc/static/shaders/glsl/swshader.fp @@ -1,5 +1,5 @@ in vec4 vTexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; vec4 TextureLookup(vec2 tex_coord) { diff --git a/wadsrc/static/shaders/glsl/tonemap.fp b/wadsrc/static/shaders/glsl/tonemap.fp index 5cb7cf8bd..9fb41c79d 100644 --- a/wadsrc/static/shaders/glsl/tonemap.fp +++ b/wadsrc/static/shaders/glsl/tonemap.fp @@ -1,6 +1,6 @@ in vec2 TexCoord; -out vec4 FragColor; +layout(location=0) out vec4 FragColor; uniform sampler2D InputTexture; uniform sampler2D ExposureTexture;