pleascach/Renderer/Shader.hpp
connellpaxton c9e2877530 Added shader compilation to build process
Created mechanism to construct pipelines, still need to finish debugging that.
2024-01-25 17:07:47 -05:00

32 lines
602 B
C++

#pragma once
#define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS
#include <vulkan/vulkan.hpp>
struct Shader {
vk::ShaderModule module;
vk::ShaderStageFlagBits stage;
Shader(vk::Device dev, const std::string& fname, vk::ShaderStageFlagBits stage);
void cleanup(vk::Device dev);
inline operator vk::ShaderModule() const {
return module;
}
inline operator vk::ShaderModule& () {
return module;
}
inline const vk::PipelineShaderStageCreateInfo info() const {
return vk::PipelineShaderStageCreateInfo {
.stage = stage,
.module = module,
.pName = "main",
};
}
std::string fname;
};