From 417a4ca206a5cae7cc08c80564181af74c8fa51a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 21 Apr 2017 23:33:58 +1000 Subject: Vulkan: Implement post-processing backend No new features, just parity with OpenGL. --- Source/Core/VideoBackends/Vulkan/VulkanContext.cpp | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'Source/Core/VideoBackends/Vulkan/VulkanContext.cpp') diff --git a/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp b/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp index b7ef583786..d9cd116566 100644 --- a/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp +++ b/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp @@ -6,6 +6,9 @@ #include "Common/Assert.h" #include "Common/CommonFuncs.h" +#include "Common/CommonPaths.h" +#include "Common/FileSearch.h" +#include "Common/FileUtil.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" #include "Common/StringUtil.h" @@ -222,6 +225,21 @@ VulkanContext::GPUList VulkanContext::EnumerateGPUs(VkInstance instance) return gpus; } +static std::vector GetShaders(const std::string& sub_dir = "") +{ + std::vector paths = + Common::DoFileSearch({".glsl"}, {File::GetUserPath(D_SHADERS_IDX) + sub_dir, + File::GetSysDirectory() + SHADERS_DIR DIR_SEP + sub_dir}); + std::vector result; + for (std::string path : paths) + { + std::string name; + SplitPath(path, nullptr, &name, nullptr); + result.push_back(name); + } + return result; +} + void VulkanContext::PopulateBackendInfo(VideoConfig* config) { config->backend_info.api_type = APIType::Vulkan; @@ -237,7 +255,7 @@ void VulkanContext::PopulateBackendInfo(VideoConfig* config) config->backend_info.bSupportsComputeShaders = true; // Assumed support. config->backend_info.bSupportsGPUTextureDecoding = true; // Assumed support. config->backend_info.bSupportsInternalResolutionFrameDumps = true; // Assumed support. - config->backend_info.bSupportsPostProcessing = false; // No support yet. + config->backend_info.bSupportsPostProcessing = true; // Assumed support. config->backend_info.bSupportsDualSourceBlend = false; // Dependent on features. config->backend_info.bSupportsGeometryShaders = false; // Dependent on features. config->backend_info.bSupportsGSInstancing = false; // Dependent on features. @@ -246,6 +264,9 @@ void VulkanContext::PopulateBackendInfo(VideoConfig* config) config->backend_info.bSupportsSSAA = false; // Dependent on features. config->backend_info.bSupportsDepthClamp = false; // Dependent on features. config->backend_info.bSupportsReversedDepthRange = false; // No support yet due to driver bugs. + + g_Config.backend_info.PPShaders = GetShaders(""); + g_Config.backend_info.AnaglyphShaders = GetShaders(ANAGLYPH_DIR DIR_SEP); } void VulkanContext::PopulateBackendInfoAdapters(VideoConfig* config, const GPUList& gpu_list) -- cgit v1.2.3 From 27ae5b8d34675244af689b260f0dbb391bb6209e Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 21 Apr 2017 23:59:45 +1000 Subject: VideoConfigDiag: Move post-processing shader list to post processor The backends don't use this list at all, and since more than one backend supports post-processing now, it's duplicate code. --- Source/Core/VideoBackends/Vulkan/VulkanContext.cpp | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'Source/Core/VideoBackends/Vulkan/VulkanContext.cpp') diff --git a/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp b/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp index d9cd116566..58b10dd92e 100644 --- a/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp +++ b/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp @@ -6,9 +6,6 @@ #include "Common/Assert.h" #include "Common/CommonFuncs.h" -#include "Common/CommonPaths.h" -#include "Common/FileSearch.h" -#include "Common/FileUtil.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" #include "Common/StringUtil.h" @@ -225,21 +222,6 @@ VulkanContext::GPUList VulkanContext::EnumerateGPUs(VkInstance instance) return gpus; } -static std::vector GetShaders(const std::string& sub_dir = "") -{ - std::vector paths = - Common::DoFileSearch({".glsl"}, {File::GetUserPath(D_SHADERS_IDX) + sub_dir, - File::GetSysDirectory() + SHADERS_DIR DIR_SEP + sub_dir}); - std::vector result; - for (std::string path : paths) - { - std::string name; - SplitPath(path, nullptr, &name, nullptr); - result.push_back(name); - } - return result; -} - void VulkanContext::PopulateBackendInfo(VideoConfig* config) { config->backend_info.api_type = APIType::Vulkan; @@ -264,9 +246,6 @@ void VulkanContext::PopulateBackendInfo(VideoConfig* config) config->backend_info.bSupportsSSAA = false; // Dependent on features. config->backend_info.bSupportsDepthClamp = false; // Dependent on features. config->backend_info.bSupportsReversedDepthRange = false; // No support yet due to driver bugs. - - g_Config.backend_info.PPShaders = GetShaders(""); - g_Config.backend_info.AnaglyphShaders = GetShaders(ANAGLYPH_DIR DIR_SEP); } void VulkanContext::PopulateBackendInfoAdapters(VideoConfig* config, const GPUList& gpu_list) -- cgit v1.2.3