mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-23 05:00:09 +00:00
vk_graphics_pipeline: Add shader SPIRV interface
Direct creation of `Shader` from `u32` source
This commit is contained in:
parent
882f75c02c
commit
99e83a4ab8
@ -58,6 +58,11 @@ Shader::Shader(const Instance& instance, vk::ShaderStageFlagBits stage, std::str
|
|||||||
MarkDone();
|
MarkDone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Shader::Shader(const Instance& instance, std::span<const u32> code) : Shader{instance} {
|
||||||
|
module = CompileSPV(code, instance.GetDevice());
|
||||||
|
MarkDone();
|
||||||
|
}
|
||||||
|
|
||||||
Shader::~Shader() {
|
Shader::~Shader() {
|
||||||
if (device && module) {
|
if (device && module) {
|
||||||
device.destroyShaderModule(module);
|
device.destroyShaderModule(module);
|
||||||
|
@ -152,6 +152,7 @@ struct PipelineInfo {
|
|||||||
struct Shader : public Common::AsyncHandle {
|
struct Shader : public Common::AsyncHandle {
|
||||||
explicit Shader(const Instance& instance);
|
explicit Shader(const Instance& instance);
|
||||||
explicit Shader(const Instance& instance, vk::ShaderStageFlagBits stage, std::string code);
|
explicit Shader(const Instance& instance, vk::ShaderStageFlagBits stage, std::string code);
|
||||||
|
explicit Shader(const Instance& instance, std::span<const u32> code);
|
||||||
~Shader();
|
~Shader();
|
||||||
|
|
||||||
[[nodiscard]] vk::ShaderModule Handle() const noexcept {
|
[[nodiscard]] vk::ShaderModule Handle() const noexcept {
|
||||||
|
Loading…
Reference in New Issue
Block a user