From 8a1a924e2e34bb122b3a046d28e5da86c42163dc Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 21 May 2018 12:19:41 -0400 Subject: [PATCH] Vulkan/PostProcessing: Make file-scope std::string instances const char arrays Avoids performing avoidable file-scope heap allocations --- Source/Core/VideoBackends/Vulkan/PostProcessing.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoBackends/Vulkan/PostProcessing.cpp b/Source/Core/VideoBackends/Vulkan/PostProcessing.cpp index 983567b2ac..88bb29eee7 100644 --- a/Source/Core/VideoBackends/Vulkan/PostProcessing.cpp +++ b/Source/Core/VideoBackends/Vulkan/PostProcessing.cpp @@ -134,7 +134,7 @@ void VulkanPostProcessing::FillUniformBuffer(u8* buf, const TargetRectangle& src } } -static const std::string DEFAULT_FRAGMENT_SHADER_SOURCE = R"( +constexpr char DEFAULT_FRAGMENT_SHADER_SOURCE[] = R"( layout(set = 1, binding = 0) uniform sampler2DArray samp0; layout(location = 0) in float3 uv0; @@ -147,7 +147,7 @@ static const std::string DEFAULT_FRAGMENT_SHADER_SOURCE = R"( } )"; -static const std::string POSTPROCESSING_SHADER_HEADER = R"( +constexpr char POSTPROCESSING_SHADER_HEADER[] = R"( SAMPLER_BINDING(0) uniform sampler2DArray samp0; SAMPLER_BINDING(1) uniform sampler2DArray samp1;