From e8febd0cef02c205b77ab6fdb7af33da59ce59cc Mon Sep 17 00:00:00 2001 From: degasus Date: Sat, 25 Nov 2017 11:07:14 +0100 Subject: VideoCommon: Create a namespace for TextureConversionShaderGen. --- Source/Core/VideoBackends/OGL/TextureCache.cpp | 5 +++-- Source/Core/VideoBackends/OGL/TextureCache.h | 2 +- Source/Core/VideoBackends/Vulkan/TextureCache.cpp | 6 ++++-- Source/Core/VideoBackends/Vulkan/TextureCache.h | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) (limited to 'Source/Core/VideoBackends') diff --git a/Source/Core/VideoBackends/OGL/TextureCache.cpp b/Source/Core/VideoBackends/OGL/TextureCache.cpp index f370da7142..cf36f0663d 100644 --- a/Source/Core/VideoBackends/OGL/TextureCache.cpp +++ b/Source/Core/VideoBackends/OGL/TextureCache.cpp @@ -510,7 +510,8 @@ void TextureCache::CopyEFBToCacheEntry(TCacheEntry* entry, bool is_depth_copy, glViewport(0, 0, destination_texture->GetConfig().width, destination_texture->GetConfig().height); - auto uid = GetTextureConverterShaderUid(dst_format, is_depth_copy, is_intensity, scale_by_half); + auto uid = TextureConversionShaderGen::GetShaderUid(dst_format, is_depth_copy, is_intensity, + scale_by_half); auto it = m_efb_copy_programs.emplace(uid, EFBCopyShader()); EFBCopyShader& shader = it.first->second; @@ -518,7 +519,7 @@ void TextureCache::CopyEFBToCacheEntry(TCacheEntry* entry, bool is_depth_copy, if (created) { - ShaderCode code = GenerateTextureConverterShaderCode(APIType::OpenGL, uid.GetUidData()); + ShaderCode code = TextureConversionShaderGen::GenerateShader(APIType::OpenGL, uid.GetUidData()); std::string geo_program = ""; char prefix = 'f'; diff --git a/Source/Core/VideoBackends/OGL/TextureCache.h b/Source/Core/VideoBackends/OGL/TextureCache.h index f0ab838c23..4a5e921eb6 100644 --- a/Source/Core/VideoBackends/OGL/TextureCache.h +++ b/Source/Core/VideoBackends/OGL/TextureCache.h @@ -86,7 +86,7 @@ private: GLuint position_uniform; }; - std::map m_efb_copy_programs; + std::map m_efb_copy_programs; SHADER m_colorCopyProgram; GLuint m_colorCopyPositionUniform; diff --git a/Source/Core/VideoBackends/Vulkan/TextureCache.cpp b/Source/Core/VideoBackends/Vulkan/TextureCache.cpp index 130a494bb2..a97a560d55 100644 --- a/Source/Core/VideoBackends/Vulkan/TextureCache.cpp +++ b/Source/Core/VideoBackends/Vulkan/TextureCache.cpp @@ -307,7 +307,8 @@ void TextureCache::CopyEFBToCacheEntry(TCacheEntry* entry, bool is_depth_copy, texture->GetRawTexIdentifier()->TransitionToLayout(command_buffer, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL); - auto uid = GetTextureConverterShaderUid(dst_format, is_depth_copy, is_intensity, scale_by_half); + auto uid = TextureConversionShaderGen::GetShaderUid(dst_format, is_depth_copy, is_intensity, + scale_by_half); auto it = m_efb_copy_to_tex_shaders.emplace(uid, VkShaderModule(VK_NULL_HANDLE)); VkShaderModule& shader = it.first->second; @@ -316,7 +317,8 @@ void TextureCache::CopyEFBToCacheEntry(TCacheEntry* entry, bool is_depth_copy, if (created) { std::string source = g_shader_cache->GetUtilityShaderHeader(); - source += GenerateTextureConverterShaderCode(APIType::Vulkan, uid.GetUidData()).GetBuffer(); + source += + TextureConversionShaderGen::GenerateShader(APIType::Vulkan, uid.GetUidData()).GetBuffer(); shader = Util::CompileAndCreateFragmentShader(source); } diff --git a/Source/Core/VideoBackends/Vulkan/TextureCache.h b/Source/Core/VideoBackends/Vulkan/TextureCache.h index 0e29229d18..26a01be3bb 100644 --- a/Source/Core/VideoBackends/Vulkan/TextureCache.h +++ b/Source/Core/VideoBackends/Vulkan/TextureCache.h @@ -65,7 +65,7 @@ private: std::unique_ptr m_texture_converter; VkShaderModule m_copy_shader = VK_NULL_HANDLE; - std::map m_efb_copy_to_tex_shaders; + std::map m_efb_copy_to_tex_shaders; }; } // namespace Vulkan -- cgit v1.2.3