载入中...
搜索中...
未找到
ComputePass.h
浏览该文件的文档.
1#pragma once
2
3#include "vkbuilder.hpp"
4
5#include <cstdint>
6#include <vector>
7
8namespace eve::graphics::vulkan {
9
18public:
19 ComputePass() = default;
20 ComputePass(const ComputePass &) = delete;
21 ComputePass &operator=(const ComputePass &) = delete;
22 ComputePass(ComputePass &&o) noexcept : device_(o.device_), pipeline_(o.pipeline_) {
23 o.device_ = nullptr;
24 o.pipeline_ = nullptr;
25 }
26 ComputePass &operator=(ComputePass &&o) noexcept;
28
30 bool create(vkb::Device &device, vk::PipelineLayout layout,
31 const std::vector<uint32_t> &spv);
32
34 void record(vk::CommandBuffer cb, uint32_t groupsX, uint32_t groupsY = 1,
35 uint32_t groupsZ = 1) const;
36
37 vk::Pipeline pipeline() const { return pipeline_; }
38
39private:
40 vkb::Device *device_ = nullptr;
41 vk::Pipeline pipeline_ = nullptr;
42};
43
44} // namespace eve::graphics::vulkan
45
std::string layout
vkb::Device & device
Minimal compute pipeline wrapper for in-frame compute sections.
Definition ComputePass.h:17
bool create(vkb::Device &device, vk::PipelineLayout layout, const std::vector< uint32_t > &spv)
Create from embedded SPIR-V words; layout must outlive the pass.
vk::Pipeline pipeline() const
Definition ComputePass.h:37
ComputePass(const ComputePass &)=delete
ComputePass & operator=(const ComputePass &)=delete
void record(vk::CommandBuffer cb, uint32_t groupsX, uint32_t groupsY=1, uint32_t groupsZ=1) const
Record one dispatch (local size baked into the shader).
ComputePass(ComputePass &&o) noexcept
Definition ComputePass.h:22