From 09883431bfd4c811dc8ba120bc0f1676cf4fe070 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 20 Apr 2019 19:19:34 +0200 Subject: [PATCH] - fix wrong clamp mode used in OpenGL - fix sampler array size on Vulkan --- src/rendering/gl/renderer/gl_renderbuffers.cpp | 2 +- src/rendering/vulkan/renderer/vk_postprocess.cpp | 2 +- src/rendering/vulkan/renderer/vk_postprocess.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rendering/gl/renderer/gl_renderbuffers.cpp b/src/rendering/gl/renderer/gl_renderbuffers.cpp index a54df1279a..2ab12e44a1 100644 --- a/src/rendering/gl/renderer/gl_renderbuffers.cpp +++ b/src/rendering/gl/renderer/gl_renderbuffers.cpp @@ -868,7 +868,7 @@ void GLPPRenderState::Draw() const PPTextureInput &input = Textures[index]; int filter = (input.Filter == PPFilterMode::Nearest) ? GL_NEAREST : GL_LINEAR; - int wrap = (input.Wrap == PPWrapMode::Clamp) ? GL_CLAMP : GL_REPEAT; + int wrap = (input.Wrap == PPWrapMode::Clamp) ? GL_CLAMP_TO_EDGE : GL_REPEAT; switch (input.Type) { diff --git a/src/rendering/vulkan/renderer/vk_postprocess.cpp b/src/rendering/vulkan/renderer/vk_postprocess.cpp index e0f4891445..8716b8d38d 100644 --- a/src/rendering/vulkan/renderer/vk_postprocess.cpp +++ b/src/rendering/vulkan/renderer/vk_postprocess.cpp @@ -287,7 +287,7 @@ void VkPostprocess::RenderBuffersReset() VulkanSampler *VkPostprocess::GetSampler(PPFilterMode filter, PPWrapMode wrap) { - int index = (((int)filter) << 2) | (int)wrap; + int index = (((int)filter) << 1) | (int)wrap; auto &sampler = mSamplers[index]; if (sampler) return sampler.get(); diff --git a/src/rendering/vulkan/renderer/vk_postprocess.h b/src/rendering/vulkan/renderer/vk_postprocess.h index ace4afdfe9..a1b6b9e872 100644 --- a/src/rendering/vulkan/renderer/vk_postprocess.h +++ b/src/rendering/vulkan/renderer/vk_postprocess.h @@ -75,7 +75,7 @@ private: VulkanSampler *GetSampler(PPFilterMode filter, PPWrapMode wrap); - std::array, 16> mSamplers; + std::array, 4> mSamplers; std::map> mRenderPassSetup; std::unique_ptr mDescriptorPool; int mCurrentPipelineImage = 0;