vk_graphics_pipeline: Add shader SPIRV interface
Direct creation of `Shader` from `u32` source
This commit is contained in:
parent
882f75c02c
commit
99e83a4ab8
2 changed files with 6 additions and 0 deletions
|
@ -58,6 +58,11 @@ Shader::Shader(const Instance& instance, vk::ShaderStageFlagBits stage, std::str
|
|||
MarkDone();
|
||||
}
|
||||
|
||||
Shader::Shader(const Instance& instance, std::span<const u32> code) : Shader{instance} {
|
||||
module = CompileSPV(code, instance.GetDevice());
|
||||
MarkDone();
|
||||
}
|
||||
|
||||
Shader::~Shader() {
|
||||
if (device && module) {
|
||||
device.destroyShaderModule(module);
|
||||
|
|
|
@ -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<const u32> code);
|
||||
~Shader();
|
||||
|
||||
[[nodiscard]] vk::ShaderModule Handle() const noexcept {
|
||||
|
|
Loading…
Reference in a new issue