31 lines
1.2 KiB
Text
31 lines
1.2 KiB
Text
|
|
module;
|
||
|
|
|
||
|
|
#include <cstdint>
|
||
|
|
#include <vulkan/vulkan.h>
|
||
|
|
|
||
|
|
export module Crafter.Graphics:VulkanElement;
|
||
|
|
import Crafter.Component;
|
||
|
|
|
||
|
|
namespace Crafter {
|
||
|
|
export class VulkanElement : public Component {
|
||
|
|
public:
|
||
|
|
VkPipelineLayout pipelineLayout;
|
||
|
|
VkDescriptorSet* descriptorSet;
|
||
|
|
VkPipeline pipeline;
|
||
|
|
std::uint32_t sizeX;
|
||
|
|
std::uint32_t sizeY;
|
||
|
|
std::uint32_t sizeZ;
|
||
|
|
VulkanElement(VkPipelineLayout pipelineLayout, VkDescriptorSet* descriptorSet, VkPipeline pipeline);
|
||
|
|
VulkanElement(VkPipelineLayout pipelineLayout, VkDescriptorSet* descriptorSet, VkPipeline pipeline, std::uint32_t sizeX, std::uint32_t sizeY, std::uint32_t sizeZ);
|
||
|
|
|
||
|
|
template<typename Pipeline>
|
||
|
|
static VulkanElement FromPipeline() {
|
||
|
|
return VulkanElement(Pipeline::pipelineLayout, &Pipeline::descriptorSet, Pipeline::pipeline);
|
||
|
|
}
|
||
|
|
|
||
|
|
template<typename Pipeline>
|
||
|
|
static VulkanElement FromPipeline(std::uint32_t sizeX, std::uint32_t sizeY, std::uint32_t sizeZ) {
|
||
|
|
return VulkanElement(Pipeline::pipelineLayout, &Pipeline::descriptorSet, Pipeline::pipeline, sizeX, sizeY, sizeZ);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
}
|