moving stuff around
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include "pipeline.hpp"
|
||||
|
||||
#include <sophia/util/logger.hpp>
|
||||
#include <stdexcept>
|
||||
|
||||
namespace sophia {
|
||||
|
||||
Pipeline::Pipeline(Device& device, vk::PipelineBindPoint bindPoint)
|
||||
: device{device}, bindPoint{bindPoint} {}
|
||||
|
||||
void Pipeline::bind(vk::CommandBuffer commandBuffer) {
|
||||
commandBuffer.bindPipeline(this->bindPoint, this->pipeline.get());
|
||||
}
|
||||
|
||||
vk::UniqueShaderModule Pipeline::createShaderModule(
|
||||
const std::vector<u32>& spirv) {
|
||||
try {
|
||||
return device.get()->createShaderModuleUnique(
|
||||
{vk::ShaderModuleCreateFlags(), spirv.size() * sizeof(u32),
|
||||
spirv.data()});
|
||||
} catch (const vk::SystemError& err) {
|
||||
log::fatal("failed to create shader module");
|
||||
throw std::runtime_error("failed to create shader module");
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace sophia
|
||||
Reference in New Issue
Block a user