diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 83b8618ad..93aa6d264 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -941,7 +941,6 @@ set (PCH_SOURCES rendering/gl/renderer/gl_renderer.cpp rendering/gl/renderer/gl_stereo3d.cpp rendering/gl/shaders/gl_shader.cpp - rendering/gl/shaders/gl_shaderprogram.cpp rendering/gl/system/gl_framebuffer.cpp rendering/hwrenderer/hw_entrypoint.cpp rendering/hwrenderer/data/hw_vertexbuilder.cpp @@ -955,7 +954,6 @@ set (PCH_SOURCES rendering/hwrenderer/utility/hw_clock.cpp rendering/hwrenderer/utility/hw_draw2d.cpp rendering/hwrenderer/utility/hw_lighting.cpp - rendering/hwrenderer/utility/hw_shaderpatcher.cpp maploader/edata.cpp maploader/specials.cpp maploader/maploader.cpp @@ -1135,6 +1133,7 @@ set (PCH_SOURCES common/rendering/hwrenderer/data/hw_lightbuffer.cpp common/rendering/hwrenderer/data/hw_aabbtree.cpp common/rendering/hwrenderer/data/hw_shadowmap.cpp + common/rendering/hwrenderer/data/hw_shaderpatcher.cpp common/rendering/hwrenderer/postprocessing/hw_postprocess.cpp common/rendering/hwrenderer/postprocessing/hw_postprocess_cvars.cpp common/rendering/gl_load/gl_interface.cpp @@ -1146,6 +1145,7 @@ set (PCH_SOURCES common/rendering/gl/gl_buffers.cpp common/rendering/gl/gl_hwtexture.cpp common/rendering/gl/gl_samplers.cpp + common/rendering/gl/gl_shaderprogram.cpp common/scripting/core/dictionary.cpp common/scripting/core/dynarrays.cpp common/scripting/core/symbols.cpp diff --git a/src/common/rendering/gl/gl_postprocess.cpp b/src/common/rendering/gl/gl_postprocess.cpp index 90b7cf335..8b97f51e0 100644 --- a/src/common/rendering/gl/gl_postprocess.cpp +++ b/src/common/rendering/gl/gl_postprocess.cpp @@ -27,7 +27,7 @@ #include "gl_renderbuffers.h" #include "gl/renderer/gl_renderer.h" #include "gl_postprocessstate.h" -#include "gl/shaders/gl_shaderprogram.h" +#include "gl_shaderprogram.h" #include "hwrenderer/postprocessing/hw_postprocess.h" #include "hwrenderer/postprocessing/hw_postprocess_cvars.h" #include "flatvertices.h" diff --git a/src/common/rendering/gl/gl_renderbuffers.cpp b/src/common/rendering/gl/gl_renderbuffers.cpp index 3cec2c937..5e212a3be 100644 --- a/src/common/rendering/gl/gl_renderbuffers.cpp +++ b/src/common/rendering/gl/gl_renderbuffers.cpp @@ -28,7 +28,7 @@ #include "gl/renderer/gl_renderer.h" #include "gl_renderbuffers.h" #include "gl_postprocessstate.h" -#include "gl/shaders/gl_shaderprogram.h" +#include "gl_shaderprogram.h" #include "gl_buffers.h" #include "templates.h" #include diff --git a/src/rendering/gl/shaders/gl_shaderprogram.cpp b/src/common/rendering/gl/gl_shaderprogram.cpp similarity index 99% rename from src/rendering/gl/shaders/gl_shaderprogram.cpp rename to src/common/rendering/gl/gl_shaderprogram.cpp index 5bd808dd5..eb322fb94 100644 --- a/src/rendering/gl/shaders/gl_shaderprogram.cpp +++ b/src/common/rendering/gl/gl_shaderprogram.cpp @@ -24,8 +24,8 @@ #include "gl_interface.h" #include "hw_cvars.h" #include "gl_debug.h" -#include "gl/shaders/gl_shaderprogram.h" -#include "hwrenderer/utility/hw_shaderpatcher.h" +#include "gl_shaderprogram.h" +#include "hw_shaderpatcher.h" #include "filesystem.h" #include "printf.h" diff --git a/src/rendering/gl/shaders/gl_shaderprogram.h b/src/common/rendering/gl/gl_shaderprogram.h similarity index 98% rename from src/rendering/gl/shaders/gl_shaderprogram.h rename to src/common/rendering/gl/gl_shaderprogram.h index 90e257297..da4525052 100644 --- a/src/rendering/gl/shaders/gl_shaderprogram.h +++ b/src/common/rendering/gl/gl_shaderprogram.h @@ -2,7 +2,7 @@ #pragma once #include "gl_system.h" -#include "gl_shader.h" +#include "gl/shaders/gl_shader.h" #include "hwrenderer/postprocessing/hw_postprocess.h" namespace OpenGLRenderer diff --git a/src/rendering/hwrenderer/utility/hw_shaderpatcher.cpp b/src/common/rendering/hwrenderer/data/hw_shaderpatcher.cpp similarity index 99% rename from src/rendering/hwrenderer/utility/hw_shaderpatcher.cpp rename to src/common/rendering/hwrenderer/data/hw_shaderpatcher.cpp index 53fc73a57..0362306d3 100644 --- a/src/rendering/hwrenderer/utility/hw_shaderpatcher.cpp +++ b/src/common/rendering/hwrenderer/data/hw_shaderpatcher.cpp @@ -66,7 +66,7 @@ static FString NextGlslToken(const char *chars, long len, long &pos) pos = tokenEnd; return FString(chars + tokenStart, tokenEnd - tokenStart); -} +} static bool isShaderType(const char *name) { diff --git a/src/rendering/hwrenderer/utility/hw_shaderpatcher.h b/src/common/rendering/hwrenderer/data/hw_shaderpatcher.h similarity index 100% rename from src/rendering/hwrenderer/utility/hw_shaderpatcher.h rename to src/common/rendering/hwrenderer/data/hw_shaderpatcher.h diff --git a/src/common/rendering/hwrenderer/postprocessing/hw_postprocess.cpp b/src/common/rendering/hwrenderer/postprocessing/hw_postprocess.cpp index a206a4c16..1dc670de0 100644 --- a/src/common/rendering/hwrenderer/postprocessing/hw_postprocess.cpp +++ b/src/common/rendering/hwrenderer/postprocessing/hw_postprocess.cpp @@ -395,8 +395,8 @@ void PPFXAA::CreateShaders() if (LastQuality == gl_fxaa) return; - FXAALuma = { "shaders/glsl/fxaa.fp", "#define FXAA_LUMA_PASS\n", {} }; - FXAA = { "shaders/glsl/fxaa.fp", GetDefines(), FXAAUniforms::Desc(), GetMaxVersion() }; + FXAALuma = { "shaders/pp/fxaa.fp", "#define FXAA_LUMA_PASS\n", {} }; + FXAA = { "shaders/pp/fxaa.fp", GetDefines(), FXAAUniforms::Desc(), GetMaxVersion() }; LastQuality = gl_fxaa; } @@ -681,14 +681,14 @@ void PPAmbientOcclusion::CreateShaders() #define NUM_STEPS %d.0 )", numDirections, numSteps); - LinearDepth = { "shaders/glsl/lineardepth.fp", "", LinearDepthUniforms::Desc() }; - LinearDepthMS = { "shaders/glsl/lineardepth.fp", "#define MULTISAMPLE\n", LinearDepthUniforms::Desc() }; - AmbientOcclude = { "shaders/glsl/ssao.fp", defines, SSAOUniforms::Desc() }; - AmbientOccludeMS = { "shaders/glsl/ssao.fp", defines + "\n#define MULTISAMPLE\n", SSAOUniforms::Desc() }; - BlurVertical = { "shaders/glsl/depthblur.fp", "#define BLUR_VERTICAL\n", DepthBlurUniforms::Desc() }; - BlurHorizontal = { "shaders/glsl/depthblur.fp", "#define BLUR_HORIZONTAL\n", DepthBlurUniforms::Desc() }; - Combine = { "shaders/glsl/ssaocombine.fp", "", AmbientCombineUniforms::Desc() }; - CombineMS = { "shaders/glsl/ssaocombine.fp", "#define MULTISAMPLE\n", AmbientCombineUniforms::Desc() }; + LinearDepth = { "shaders/pp/lineardepth.fp", "", LinearDepthUniforms::Desc() }; + LinearDepthMS = { "shaders/pp/lineardepth.fp", "#define MULTISAMPLE\n", LinearDepthUniforms::Desc() }; + AmbientOcclude = { "shaders/pp/ssao.fp", defines, SSAOUniforms::Desc() }; + AmbientOccludeMS = { "shaders/pp/ssao.fp", defines + "\n#define MULTISAMPLE\n", SSAOUniforms::Desc() }; + BlurVertical = { "shaders/pp/depthblur.fp", "#define BLUR_VERTICAL\n", DepthBlurUniforms::Desc() }; + BlurHorizontal = { "shaders/pp/depthblur.fp", "#define BLUR_HORIZONTAL\n", DepthBlurUniforms::Desc() }; + Combine = { "shaders/pp/ssaocombine.fp", "", AmbientCombineUniforms::Desc() }; + CombineMS = { "shaders/pp/ssaocombine.fp", "#define MULTISAMPLE\n", AmbientCombineUniforms::Desc() }; LastQuality = gl_ssao; } diff --git a/src/rendering/gl/renderer/gl_renderer.cpp b/src/rendering/gl/renderer/gl_renderer.cpp index 356271466..624a5ef9c 100644 --- a/src/rendering/gl/renderer/gl_renderer.cpp +++ b/src/rendering/gl/renderer/gl_renderer.cpp @@ -55,7 +55,7 @@ #include "gl/renderer/gl_renderer.h" #include "gl_renderstate.h" #include "gl_renderbuffers.h" -#include "gl/shaders/gl_shaderprogram.h" +#include "gl_shaderprogram.h" #include "hw_vrmodes.h" #include "flatvertices.h" #include "hwrenderer/scene/hw_skydome.h" diff --git a/src/rendering/gl/renderer/gl_stereo3d.cpp b/src/rendering/gl/renderer/gl_stereo3d.cpp index df6cb11ce..8bcb2768f 100644 --- a/src/rendering/gl/renderer/gl_stereo3d.cpp +++ b/src/rendering/gl/renderer/gl_stereo3d.cpp @@ -32,7 +32,7 @@ #include "gl/system/gl_framebuffer.h" #include "gl_postprocessstate.h" #include "gl/system/gl_framebuffer.h" -#include "gl/shaders/gl_shaderprogram.h" +#include "gl_shaderprogram.h" #include "gl_buffers.h" #include "menu/menu.h" diff --git a/src/rendering/gl/shaders/gl_shader.cpp b/src/rendering/gl/shaders/gl_shader.cpp index 125fbb964..9a30674fd 100644 --- a/src/rendering/gl/shaders/gl_shader.cpp +++ b/src/rendering/gl/shaders/gl_shader.cpp @@ -35,7 +35,7 @@ #include "md5.h" #include "m_misc.h" #include "gl/shaders/gl_shader.h" -#include "hwrenderer/utility/hw_shaderpatcher.h" +#include "hw_shaderpatcher.h" #include "hwrenderer/data/shaderuniforms.h" #include "hwrenderer/scene/hw_viewpointuniforms.h" #include "hw_lightbuffer.h" diff --git a/src/rendering/gl/system/gl_framebuffer.cpp b/src/rendering/gl/system/gl_framebuffer.cpp index 814a2ace5..9f3210f68 100644 --- a/src/rendering/gl/system/gl_framebuffer.cpp +++ b/src/rendering/gl/system/gl_framebuffer.cpp @@ -51,7 +51,7 @@ #include "hwrenderer/scene/hw_fakeflat.h" #include "hwrenderer/data/hw_viewpointbuffer.h" #include "hw_lightbuffer.h" -#include "gl/shaders/gl_shaderprogram.h" +#include "gl_shaderprogram.h" #include "gl_debug.h" #include "r_videoscale.h" #include "gl_buffers.h" diff --git a/src/rendering/vulkan/shaders/vk_shader.cpp b/src/rendering/vulkan/shaders/vk_shader.cpp index d7b461cf1..8162cf7b3 100644 --- a/src/rendering/vulkan/shaders/vk_shader.cpp +++ b/src/rendering/vulkan/shaders/vk_shader.cpp @@ -22,7 +22,7 @@ #include "vk_shader.h" #include "vulkan/system/vk_builders.h" -#include "hwrenderer/utility/hw_shaderpatcher.h" +#include "hw_shaderpatcher.h" #include "filesystem.h" #include "engineerrors.h" #include