diff --git a/src/common/rendering/v_video.h b/src/common/rendering/v_video.h index 792be2f9d..919647284 100644 --- a/src/common/rendering/v_video.h +++ b/src/common/rendering/v_video.h @@ -130,6 +130,14 @@ public: int mPipelineNbr = 1; // Number of HW buffers to pipeline int mPipelineType = 0; + // Lightprobes + constexpr static const int irrandiaceMapTexelCount = 32 * 32 * 6; + constexpr static const int prefilterMapLevelsSize = 5; + constexpr static const int prefilterMapTexelCount = prefilterMapLevelsSize * 6; + + constexpr static const int irradianceMapChannelCount = 3; + constexpr static const int prefilterMapChannelCount = 3; + public: DFrameBuffer (int width=1, int height=1); virtual ~DFrameBuffer(); diff --git a/src/common/rendering/vulkan/vk_lightprober.cpp b/src/common/rendering/vulkan/vk_lightprober.cpp index db1ae5a61..cae04b0c0 100644 --- a/src/common/rendering/vulkan/vk_lightprober.cpp +++ b/src/common/rendering/vulkan/vk_lightprober.cpp @@ -258,7 +258,7 @@ void VkLightprober::CreateIrradianceMap() bool VkLightprober::GenerateIrradianceMap(TArrayView& databuffer) { - const int texelCount = irrandiaceMapTexelCount; + const int texelCount = DFrameBuffer::irrandiaceMapTexelCount; if (databuffer.Size() < texelCount) { @@ -405,7 +405,7 @@ void VkLightprober::CreatePrefilterMap() bool VkLightprober::GeneratePrefilterMap(TArrayView& databuffer) { - const int texelCount = prefilterMapTexelCount; + const int texelCount = DFrameBuffer::prefilterMapTexelCount; if (databuffer.Size() < texelCount) { diff --git a/src/common/rendering/vulkan/vk_lightprober.h b/src/common/rendering/vulkan/vk_lightprober.h index 6987c56f0..648d33568 100644 --- a/src/common/rendering/vulkan/vk_lightprober.h +++ b/src/common/rendering/vulkan/vk_lightprober.h @@ -93,7 +93,7 @@ private: { enum { - maxlevels = 5, + maxlevels = DFrameBuffer::prefilterMapLevelsSize, levelsSize = 128 * 128 + 64 * 64 + 32 * 32 + 16 * 16 + 8 * 8 }; std::unique_ptr shader; @@ -108,12 +108,4 @@ private: } prefilterMap; VulkanRenderDevice* fb = nullptr; - -public: - // Used to pass buffer sizes - constexpr static const int irrandiaceMapTexelCount = 32 * 32 * 6; - constexpr static const int prefilterMapTexelCount = PrefilterMap::levelsSize * 6; - - constexpr static const int irradianceMapChannelCount = 3; - constexpr static const int prefilterMapChannelCount = 3; }; diff --git a/src/rendering/hwrenderer/hw_entrypoint.cpp b/src/rendering/hwrenderer/hw_entrypoint.cpp index 582a87b18..59ee8ad39 100644 --- a/src/rendering/hwrenderer/hw_entrypoint.cpp +++ b/src/rendering/hwrenderer/hw_entrypoint.cpp @@ -50,8 +50,6 @@ #include "hwrenderer/scene/hw_drawcontext.h" #include "hw_vrmodes.h" -#include "common/rendering/vulkan/vk_lightprober.h" // to fetch irradiance and prefilter map texel counts - EXTERN_CVAR(Bool, cl_capfps) EXTERN_CVAR(Float, r_visibility) EXTERN_CVAR(Bool, gl_bandedswlight) @@ -335,7 +333,7 @@ static void CheckTimer(FRenderState &state, uint64_t ShaderStartTime) state.firstFrame = screen->FrameTime - 1; } -LightProbeIncrementalBuilder lightProbeBuilder(VkLightprober::irrandiaceMapTexelCount, VkLightprober::prefilterMapTexelCount, VkLightprober::irradianceMapChannelCount, VkLightprober::prefilterMapChannelCount); +LightProbeIncrementalBuilder lightProbeBuilder(DFrameBuffer::irrandiaceMapTexelCount, DFrameBuffer::prefilterMapTexelCount, DFrameBuffer::irradianceMapChannelCount, DFrameBuffer::prefilterMapChannelCount); sector_t* RenderView(player_t* player) {