diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 5ef3eb513..603ae0b9b 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -58,6 +58,11 @@ Shader::Shader(const Instance& instance, vk::ShaderStageFlagBits stage, std::str MarkDone(); } +Shader::Shader(const Instance& instance, std::span code) : Shader{instance} { + module = CompileSPV(code, instance.GetDevice()); + MarkDone(); +} + Shader::~Shader() { if (device && module) { device.destroyShaderModule(module); diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index 38cd988d1..4bb3b446e 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h @@ -152,6 +152,7 @@ struct PipelineInfo { struct Shader : public Common::AsyncHandle { explicit Shader(const Instance& instance); explicit Shader(const Instance& instance, vk::ShaderStageFlagBits stage, std::string code); + explicit Shader(const Instance& instance, std::span code); ~Shader(); [[nodiscard]] vk::ShaderModule Handle() const noexcept {