#include "pipeline.hpp" #include #include 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& 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