diff --git a/src/video_core/renderer_vulkan/vk_shader_util.cpp b/src/video_core/renderer_vulkan/vk_shader_util.cpp index ba5c5f867..c60fe3b7f 100644 --- a/src/video_core/renderer_vulkan/vk_shader_util.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_util.cpp @@ -158,7 +158,14 @@ bool InitializeCompiler() { } } // Anonymous namespace -vk::ShaderModule Compile(std::string_view code, vk::ShaderStageFlagBits stage, vk::Device device) { +/** + * @brief Compiles GLSL into SPIRV + * @param code The string containing GLSL code. + * @param stage The pipeline stage the shader will be used in. + * @param device The vulkan device handle. + */ +std::vector CompileGLSLtoSPIRV(std::string_view code, vk::ShaderStageFlagBits stage, + vk::Device device) { if (!InitializeCompiler()) { return {}; } @@ -212,7 +219,11 @@ vk::ShaderModule Compile(std::string_view code, vk::ShaderStageFlagBits stage, v LOG_INFO(Render_Vulkan, "SPIR-V conversion messages: {}", spv_messages); } - return CompileSPV(out_code, device); + return out_code; +} + +vk::ShaderModule Compile(std::string_view code, vk::ShaderStageFlagBits stage, vk::Device device) { + return CompileSPV(CompileGLSLtoSPIRV(code, stage, device), device); } vk::ShaderModule CompileSPV(std::span code, vk::Device device) { diff --git a/src/video_core/renderer_vulkan/vk_shader_util.h b/src/video_core/renderer_vulkan/vk_shader_util.h index eb932e07d..2c38c3b56 100644 --- a/src/video_core/renderer_vulkan/vk_shader_util.h +++ b/src/video_core/renderer_vulkan/vk_shader_util.h @@ -10,6 +10,15 @@ namespace Vulkan { +/** + * @brief Compiles GLSL into SPIRV + * @param code The string containing GLSL code. + * @param stage The pipeline stage the shader will be used in. + * @param device The vulkan device handle. + */ +std::vector CompileGLSLtoSPIRV(std::string_view code, vk::ShaderStageFlagBits stage, + vk::Device device); + /** * @brief Creates a vulkan shader module from GLSL by converting it to SPIR-V using glslang. * @param code The string containing GLSL code.