LiteFX 0.3.1.2022
Computer Graphics Engine
vulkan.hpp
1#pragma once
2
3#include <litefx/rendering.hpp>
4
5#include "vulkan_api.hpp"
6#include "vulkan_formatters.hpp"
7
9 using namespace LiteFX::Math;
10 using namespace LiteFX::Rendering;
11
18 class LITEFX_VULKAN_API VulkanVertexBufferLayout : public IVertexBufferLayout {
19 LITEFX_IMPLEMENTATION(VulkanVertexBufferLayoutImpl);
20 LITEFX_BUILDER(VulkanVertexBufferLayoutBuilder);
21
22 public:
28 explicit VulkanVertexBufferLayout(const size_t& vertexSize, const UInt32& binding = 0);
31 virtual ~VulkanVertexBufferLayout() noexcept;
32
33 // IVertexBufferLayout interface.
34 public:
36 virtual Array<const BufferAttribute*> attributes() const noexcept override;
37
38 // IBufferLayout interface.
39 public:
41 virtual size_t elementSize() const noexcept override;
42
44 virtual const UInt32& binding() const noexcept override;
45
47 virtual const BufferType& type() const noexcept override;
48 };
49
55 class LITEFX_VULKAN_API VulkanIndexBufferLayout : public IIndexBufferLayout {
56 LITEFX_IMPLEMENTATION(VulkanIndexBufferLayoutImpl);
57
58 public:
63 explicit VulkanIndexBufferLayout(const IndexType& type);
66 virtual ~VulkanIndexBufferLayout() noexcept;
67
68 // IIndexBufferLayout interface.
69 public:
71 virtual const IndexType& indexType() const noexcept override;
72
73 // IBufferLayout interface.
74 public:
76 virtual size_t elementSize() const noexcept override;
77
79 virtual const UInt32& binding() const noexcept override;
80
82 virtual const BufferType& type() const noexcept override;
83 };
84
92 class LITEFX_VULKAN_API IVulkanBuffer : public virtual IBuffer, public virtual IResource<VkBuffer> {
93 public:
94 virtual ~IVulkanBuffer() noexcept = default;
95 };
96
102 class LITEFX_VULKAN_API IVulkanVertexBuffer : public virtual VertexBuffer<VulkanVertexBufferLayout>, public virtual IVulkanBuffer {
103 public:
104 virtual ~IVulkanVertexBuffer() noexcept = default;
105 };
106
112 class LITEFX_VULKAN_API IVulkanIndexBuffer : public virtual IndexBuffer<VulkanIndexBufferLayout>, public virtual IVulkanBuffer {
113 public:
114 virtual ~IVulkanIndexBuffer() noexcept = default;
115 };
116
125 class LITEFX_VULKAN_API IVulkanImage : public virtual IImage, public virtual IResource<VkImage> {
126 public:
127 virtual ~IVulkanImage() noexcept = default;
128
129 public:
134 virtual VkImageAspectFlags aspectMask() const noexcept = 0;
135
141 virtual VkImageAspectFlags aspectMask(const UInt32& plane) const = 0;
142
150 virtual void resolveSubresource(const UInt32& subresource, UInt32& plane, UInt32& layer, UInt32& level) const = 0;
151
157 virtual const VkImageView& imageView(const UInt32& plane = 0) const = 0;
158 };
159
167 class LITEFX_VULKAN_API IVulkanSampler : public virtual ISampler, public virtual IResource<VkSampler> {
168 public:
169 virtual ~IVulkanSampler() noexcept = default;
170 };
171
179 class LITEFX_VULKAN_API VulkanBarrier : public Barrier<IVulkanBuffer, IVulkanImage> {
180 LITEFX_IMPLEMENTATION(VulkanBarrierImpl);
181
182 public:
186 explicit VulkanBarrier() noexcept;
187 VulkanBarrier(const VulkanBarrier&) = delete;
189 virtual ~VulkanBarrier() noexcept;
190
191 // Barrier interface.
192 public:
194 virtual void transition(IVulkanBuffer& buffer, const ResourceState& targetState) override;
195
197 virtual void transition(IVulkanBuffer& buffer, const UInt32& element, const ResourceState& targetState) override;
198
200 virtual void transition(IVulkanBuffer& buffer, const ResourceState& sourceState, const ResourceState& targetState) override;
201
203 virtual void transition(IVulkanBuffer& buffer, const ResourceState& sourceState, const UInt32& element, const ResourceState& targetState) override;
204
206 virtual void transition(IVulkanImage& image, const ResourceState& targetState) override;
207
209 virtual void transition(IVulkanImage& image, const UInt32& level, const UInt32& layer, const UInt32& plane, const ResourceState& targetState) override;
210
212 virtual void transition(IVulkanImage& image, const ResourceState& sourceState, const ResourceState& targetState) override;
213
215 virtual void transition(IVulkanImage& image, const ResourceState& sourceState, const UInt32& level, const UInt32& layer, const UInt32& plane, const ResourceState& targetState) override;
216
218 virtual void waitFor(const IVulkanBuffer& buffer) override;
219
221 virtual void waitFor(const IVulkanImage& image) override;
222
223 public:
228 virtual void execute(const VulkanCommandBuffer& commandBuffer) const noexcept;
229
238 virtual void executeInverse(const VulkanCommandBuffer& commandBuffer) const noexcept;
239 };
240
247 class LITEFX_VULKAN_API VulkanShaderModule : public IShaderModule, public Resource<VkShaderModule> {
248 LITEFX_IMPLEMENTATION(VulkanShaderModuleImpl);
249
250 public:
258 explicit VulkanShaderModule(const VulkanDevice& device, const ShaderStage& type, const String& fileName, const String& entryPoint = "main");
259
268 explicit VulkanShaderModule(const VulkanDevice& device, const ShaderStage& type, std::istream& stream, const String& name, const String& entryPoint = "main");
269 VulkanShaderModule(const VulkanShaderModule&) noexcept = delete;
271 virtual ~VulkanShaderModule() noexcept;
272
273 // ShaderModule interface.
274 public:
276 virtual const String& fileName() const noexcept override;
277
279 virtual const String& entryPoint() const noexcept override;
280
282 virtual const ShaderStage& type() const noexcept override;
283
284 public:
289 virtual const String& bytecode() const noexcept;
290
295 virtual VkPipelineShaderStageCreateInfo shaderStageDefinition() const;
296 };
297
304 class LITEFX_VULKAN_API VulkanShaderProgram : public ShaderProgram<VulkanShaderModule> {
305 LITEFX_IMPLEMENTATION(VulkanShaderProgramImpl);
306 LITEFX_BUILDER(VulkanShaderProgramBuilder);
307
308 public:
314 explicit VulkanShaderProgram(const VulkanDevice& device, Array<UniquePtr<VulkanShaderModule>>&& modules);
316 VulkanShaderProgram(const VulkanShaderProgram&) noexcept = delete;
317 virtual ~VulkanShaderProgram() noexcept;
318
319 private:
324 explicit VulkanShaderProgram(const VulkanDevice& device) noexcept;
325
326 public:
328 virtual Array<const VulkanShaderModule*> modules() const noexcept override;
329
331 virtual SharedPtr<VulkanPipelineLayout> reflectPipelineLayout() const;
332
333 private:
334 virtual SharedPtr<IPipelineLayout> parsePipelineLayout() const override {
335 return std::static_pointer_cast<IPipelineLayout>(this->reflectPipelineLayout());
336 }
337 };
338
343 class LITEFX_VULKAN_API VulkanDescriptorSet : public DescriptorSet<IVulkanBuffer, IVulkanImage, IVulkanSampler>, public Resource<VkDescriptorSet> {
344 LITEFX_IMPLEMENTATION(VulkanDescriptorSetImpl);
345
346 public:
352 explicit VulkanDescriptorSet(const VulkanDescriptorSetLayout& layout, VkDescriptorSet descriptorSet);
355 virtual ~VulkanDescriptorSet() noexcept;
356
357 public:
362 virtual const VulkanDescriptorSetLayout& layout() const noexcept;
363
364 public:
366 virtual void update(const UInt32& binding, const IVulkanBuffer& buffer, const UInt32& bufferElement = 0, const UInt32& elements = 1, const UInt32& firstDescriptor = 0) const override;
367
369 virtual void update(const UInt32& binding, const IVulkanImage& texture, const UInt32& descriptor = 0, const UInt32& firstLevel = 0, const UInt32& levels = 0, const UInt32& firstLayer = 0, const UInt32& layers = 0) const override;
370
372 virtual void update(const UInt32& binding, const IVulkanSampler& sampler, const UInt32& descriptor = 0) const override;
373
375 virtual void attach(const UInt32& binding, const IVulkanImage& image) const override;
376 };
377
386 class LITEFX_VULKAN_API VulkanDescriptorLayout : public IDescriptorLayout {
387 LITEFX_IMPLEMENTATION(VulkanDescriptorLayoutImpl);
388
389 public:
398 explicit VulkanDescriptorLayout(const DescriptorType& type, const UInt32& binding, const size_t& elementSize, const UInt32& descriptors = 1);
399
405 explicit VulkanDescriptorLayout(UniquePtr<IVulkanSampler>&& staticSampler, const UInt32& binding);
406
409 virtual ~VulkanDescriptorLayout() noexcept;
410
411 // IDescriptorLayout interface.
412 public:
414 virtual const DescriptorType& descriptorType() const noexcept override;
415
417 virtual const UInt32& descriptors() const noexcept override;
418
420 virtual const IVulkanSampler* staticSampler() const noexcept override;
421
422 // IBufferLayout interface.
423 public:
425 virtual size_t elementSize() const noexcept override;
426
428 virtual const UInt32& binding() const noexcept override;
429
431 virtual const BufferType& type() const noexcept override;
432 };
433
439 class LITEFX_VULKAN_API VulkanDescriptorSetLayout : public DescriptorSetLayout<VulkanDescriptorLayout, VulkanDescriptorSet>, public Resource<VkDescriptorSetLayout> {
440 LITEFX_IMPLEMENTATION(VulkanDescriptorSetLayoutImpl);
441 LITEFX_BUILDER(VulkanDescriptorSetLayoutBuilder);
442
443 public:
458 explicit VulkanDescriptorSetLayout(const VulkanDevice& device, Array<UniquePtr<VulkanDescriptorLayout>>&& descriptorLayouts, const UInt32& space, const ShaderStage& stages, const UInt32& poolSize = 1024, const UInt32& maxUnboundedArraySize = 104857);
461 virtual ~VulkanDescriptorSetLayout() noexcept;
462
463 private:
468 explicit VulkanDescriptorSetLayout(const VulkanDevice& device) noexcept;
469
470 public:
475 virtual const VulkanDevice& device() const noexcept;
476
477 public:
479 virtual Array<const VulkanDescriptorLayout*> descriptors() const noexcept override;
480
482 virtual const VulkanDescriptorLayout& descriptor(const UInt32& binding) const override;
483
485 virtual const UInt32& space() const noexcept override;
486
488 virtual const ShaderStage& shaderStages() const noexcept override;
489
491 virtual UInt32 uniforms() const noexcept override;
492
494 virtual UInt32 storages() const noexcept override;
495
497 virtual UInt32 images() const noexcept override;
498
500 virtual UInt32 buffers() const noexcept override;
501
503 virtual UInt32 samplers() const noexcept override;
504
506 virtual UInt32 staticSamplers() const noexcept override;
507
509 virtual UInt32 inputAttachments() const noexcept override;
510
511 public:
513 virtual UniquePtr<VulkanDescriptorSet> allocate(const UInt32& descriptors = 0) const override;
514
516 virtual Array<UniquePtr<VulkanDescriptorSet>> allocateMultiple(const UInt32& descriptorSets, const UInt32& descriptors = 0) const override;
517
519 virtual void free(const VulkanDescriptorSet& descriptorSet) const noexcept override;
520
521 public:
540 virtual const UInt32& poolSize() const noexcept;
541
549 virtual size_t pools() const noexcept;
550 };
551
556 class LITEFX_VULKAN_API VulkanPushConstantsRange : public IPushConstantsRange {
557 LITEFX_IMPLEMENTATION(VulkanPushConstantsRangeImpl);
558
559 public:
568 explicit VulkanPushConstantsRange(const ShaderStage& shaderStage, const UInt32& offset, const UInt32& size, const UInt32& space, const UInt32& binding);
571 virtual ~VulkanPushConstantsRange() noexcept;
572
573 public:
575 virtual const UInt32& space() const noexcept override;
576
578 virtual const UInt32& binding() const noexcept override;
579
581 virtual const UInt32& offset() const noexcept override;
582
584 virtual const UInt32& size() const noexcept override;
585
587 virtual const ShaderStage& stage() const noexcept override;
588 };
589
597 LITEFX_IMPLEMENTATION(VulkanPushConstantsLayoutImpl);
598 LITEFX_BUILDER(VulkanPushConstantsLayoutBuilder);
600
601 public:
610 virtual ~VulkanPushConstantsLayout() noexcept;
611
612 private:
617 explicit VulkanPushConstantsLayout(const UInt32& size);
618
619 public:
624 virtual const VulkanPipelineLayout& pipelineLayout() const;
625
626 private:
631 virtual void pipelineLayout(const VulkanPipelineLayout& pipelineLayout);
632
633 public:
635 virtual const UInt32& size() const noexcept override;
636
638 virtual const VulkanPushConstantsRange& range(const ShaderStage& stage) const override;
639
641 virtual Array<const VulkanPushConstantsRange*> ranges() const noexcept override;
642 };
643
648 class LITEFX_VULKAN_API VulkanPipelineLayout : public PipelineLayout<VulkanDescriptorSetLayout, VulkanPushConstantsLayout>, public Resource<VkPipelineLayout> {
649 LITEFX_IMPLEMENTATION(VulkanPipelineLayoutImpl);
650 LITEFX_BUILDER(VulkanPipelineLayoutBuilder);
651
652 public:
659 explicit VulkanPipelineLayout(const VulkanDevice& device, Array<UniquePtr<VulkanDescriptorSetLayout>>&& descriptorSetLayouts, UniquePtr<VulkanPushConstantsLayout>&& pushConstantsLayout);
662 virtual ~VulkanPipelineLayout() noexcept;
663
664 private:
669 explicit VulkanPipelineLayout(const VulkanDevice& device) noexcept;
670
671 public:
676 virtual const VulkanDevice& device() const noexcept;
677
678 // PipelineLayout interface.
679 public:
681 virtual const VulkanDescriptorSetLayout& descriptorSet(const UInt32& space) const override;
682
684 virtual Array<const VulkanDescriptorSetLayout*> descriptorSets() const noexcept override;
685
687 virtual const VulkanPushConstantsLayout* pushConstants() const noexcept override;
688 };
689
695 LITEFX_IMPLEMENTATION(VulkanInputAssemblerImpl);
696 LITEFX_BUILDER(VulkanInputAssemblerBuilder);
697
698 public:
705 explicit VulkanInputAssembler(Array<UniquePtr<VulkanVertexBufferLayout>>&& vertexBufferLayouts, UniquePtr<VulkanIndexBufferLayout>&& indexBufferLayout, const PrimitiveTopology& primitiveTopology = PrimitiveTopology::TriangleList);
708 virtual ~VulkanInputAssembler() noexcept;
709
710 private:
714 explicit VulkanInputAssembler() noexcept;
715
716 public:
718 virtual Array<const VulkanVertexBufferLayout*> vertexBufferLayouts() const noexcept override;
719
721 virtual const VulkanVertexBufferLayout& vertexBufferLayout(const UInt32& binding) const override;
722
724 virtual const VulkanIndexBufferLayout& indexBufferLayout() const override;
725
727 virtual const PrimitiveTopology& topology() const noexcept override;
728 };
729
734 class LITEFX_VULKAN_API VulkanRasterizer : public Rasterizer {
735 LITEFX_BUILDER(VulkanRasterizerBuilder);
736
737 public:
746 explicit VulkanRasterizer(const PolygonMode& polygonMode, const CullMode& cullMode, const CullOrder& cullOrder, const Float& lineWidth = 1.f, const DepthStencilState& depthStencilState = {}) noexcept;
747 VulkanRasterizer(VulkanRasterizer&&) noexcept = delete;
748 VulkanRasterizer(const VulkanRasterizer&) noexcept = delete;
749 virtual ~VulkanRasterizer() noexcept;
750
751 private:
755 explicit VulkanRasterizer() noexcept;
756
757 public:
770 virtual void updateLineWidth(const Float& lineWidth) noexcept;
771 };
772
778 class LITEFX_VULKAN_API VulkanPipelineState : public virtual Pipeline<VulkanPipelineLayout, VulkanShaderProgram>, public Resource<VkPipeline> {
779 public:
780 using Resource<VkPipeline>::Resource;
781 virtual ~VulkanPipelineState() noexcept = default;
782
783 public:
788 virtual void use(const VulkanCommandBuffer& commandBuffer) const noexcept = 0;
789
795 virtual void bind(const VulkanCommandBuffer& commandBuffer, const VulkanDescriptorSet& descriptorSet) const noexcept = 0;
796 };
797
803 LITEFX_IMPLEMENTATION(VulkanCommandBufferImpl);
804
805 public:
812 explicit VulkanCommandBuffer(const VulkanQueue& queue, const bool& begin = false, const bool& primary = true);
815 virtual ~VulkanCommandBuffer() noexcept;
816
817 // Vulkan Command Buffer interface.
818 public:
823 virtual void begin(const VulkanRenderPass& renderPass) const noexcept;
824
825 // CommandBuffer interface.
826 public:
828 virtual void begin() const override;
829
831 virtual void end() const override;
832
834 virtual void generateMipMaps(IVulkanImage& image) noexcept override;
835
837 virtual void barrier(const VulkanBarrier& barrier, const bool& invert = false) const noexcept override;
838
840 virtual void transfer(const IVulkanBuffer& source, const IVulkanBuffer& target, const UInt32& sourceElement = 0, const UInt32& targetElement = 0, const UInt32& elements = 1) const override;
841
843 virtual void transfer(const IVulkanBuffer& source, const IVulkanImage& target, const UInt32& sourceElement = 0, const UInt32& firstSubresource = 0, const UInt32& elements = 1) const override;
844
846 virtual void transfer(const IVulkanImage& source, const IVulkanImage& target, const UInt32& sourceSubresource = 0, const UInt32& targetSubresource = 0, const UInt32& subresources = 1) const override;
847
849 virtual void transfer(const IVulkanImage& source, const IVulkanBuffer& target, const UInt32& firstSubresource = 0, const UInt32& targetElement = 0, const UInt32& subresources = 1) const override;
850
852 virtual void use(const VulkanPipelineState& pipeline) const noexcept override;
853
855 virtual void bind(const VulkanDescriptorSet& descriptorSet, const VulkanPipelineState& pipeline) const noexcept override;
856
858 virtual void bind(const IVulkanVertexBuffer& buffer) const noexcept override;
859
861 virtual void bind(const IVulkanIndexBuffer& buffer) const noexcept override;
862
864 virtual void dispatch(const Vector3u& threadCount) const noexcept override;
865
867 virtual void draw(const UInt32& vertices, const UInt32& instances = 1, const UInt32& firstVertex = 0, const UInt32& firstInstance = 0) const noexcept override;
868
870 virtual void drawIndexed(const UInt32& indices, const UInt32& instances = 1, const UInt32& firstIndex = 0, const Int32& vertexOffset = 0, const UInt32& firstInstance = 0) const noexcept override;
871
873 virtual void pushConstants(const VulkanPushConstantsLayout& layout, const void* const memory) const noexcept override;
874 };
875
882 LITEFX_IMPLEMENTATION(VulkanRenderPipelineImpl);
883 LITEFX_BUILDER(VulkanRenderPipelineBuilder);
884
885 public:
896 explicit VulkanRenderPipeline(const VulkanRenderPass& renderPass, SharedPtr<VulkanShaderProgram> shaderProgram, SharedPtr<VulkanPipelineLayout> layout, SharedPtr<VulkanInputAssembler> inputAssembler, SharedPtr<VulkanRasterizer> rasterizer, Array<SharedPtr<IViewport>> viewports, Array<SharedPtr<IScissor>> scissors, const bool& enableAlphaToCoverage = false, const String& name = "");
899 virtual ~VulkanRenderPipeline() noexcept;
900
901 private:
907 VulkanRenderPipeline(const VulkanRenderPass& renderPass, const String& name = "") noexcept;
908
909 // Pipeline interface.
910 public:
912 virtual SharedPtr<const VulkanShaderProgram> program() const noexcept override;
913
915 virtual SharedPtr<const VulkanPipelineLayout> layout() const noexcept override;
916
917 // RenderPipeline interface.
918 public:
920 virtual SharedPtr<VulkanInputAssembler> inputAssembler() const noexcept override;
921
923 virtual SharedPtr<VulkanRasterizer> rasterizer() const noexcept override;
924
926 virtual Array<const IViewport*> viewports() const noexcept override;
927
929 virtual Array<const IScissor*> scissors() const noexcept override;
930
932 virtual UInt32& stencilRef() const noexcept override;
933
935 virtual Vector4f& blendFactors() const noexcept override;
936
938 virtual const bool& alphaToCoverage() const noexcept override;
939
940 // VulkanPipelineState interface.
941 public:
943 virtual void use(const VulkanCommandBuffer& commandBuffer) const noexcept override;
944
946 virtual void bind(const VulkanCommandBuffer& commandBuffer, const VulkanDescriptorSet& descriptorSet) const noexcept override;
947 };
948
955 LITEFX_IMPLEMENTATION(VulkanComputePipelineImpl);
956 LITEFX_BUILDER(VulkanComputePipelineBuilder);
957
958 public:
966 explicit VulkanComputePipeline(const VulkanDevice& device, SharedPtr<VulkanShaderProgram> shaderProgram, SharedPtr<VulkanPipelineLayout> layout, const String& name = "");
969 virtual ~VulkanComputePipeline() noexcept;
970
971 private:
976 VulkanComputePipeline(const VulkanDevice& device) noexcept;
977
978 // Pipeline interface.
979 public:
981 virtual SharedPtr<const VulkanShaderProgram> program() const noexcept override;
982
984 virtual SharedPtr<const VulkanPipelineLayout> layout() const noexcept override;
985
986 // VulkanPipelineState interface.
987 public:
989 virtual void use(const VulkanCommandBuffer& commandBuffer) const noexcept override;
990
992 virtual void bind(const VulkanCommandBuffer& commandBuffer, const VulkanDescriptorSet& descriptorSet) const noexcept override;
993 };
994
999 class LITEFX_VULKAN_API VulkanFrameBuffer : public FrameBuffer<VulkanCommandBuffer>, public Resource<VkFramebuffer> {
1000 LITEFX_IMPLEMENTATION(VulkanFrameBufferImpl);
1001
1002 public:
1010 VulkanFrameBuffer(const VulkanRenderPass& renderPass, const UInt32& bufferIndex, const Size2d& renderArea, const UInt32& commandBuffers = 1);
1011 VulkanFrameBuffer(const VulkanFrameBuffer&) noexcept = delete;
1013 virtual ~VulkanFrameBuffer() noexcept;
1014
1015 // Vulkan frame buffer interface.
1016 public:
1021 virtual const VkSemaphore& semaphore() const noexcept;
1022
1030 virtual UInt64& lastFence() const noexcept;
1031
1032 // FrameBuffer interface.
1033 public:
1035 virtual const UInt32& bufferIndex() const noexcept override;
1036
1038 virtual const Size2d& size() const noexcept override;
1039
1041 virtual size_t getWidth() const noexcept override;
1042
1044 virtual size_t getHeight() const noexcept override;
1045
1047 virtual const VulkanCommandBuffer& commandBuffer(const UInt32& index) const override;
1048
1050 virtual Array<const VulkanCommandBuffer*> commandBuffers() const noexcept override;
1051
1053 virtual Array<const IVulkanImage*> images() const noexcept override;
1054
1056 virtual const IVulkanImage& image(const UInt32& location) const override;
1057
1058 public:
1060 virtual void resize(const Size2d& renderArea) override;
1061 };
1062
1068 LITEFX_IMPLEMENTATION(VulkanRenderPassImpl);
1069 LITEFX_BUILDER(VulkanRenderPassBuilder);
1070
1071 public:
1080 explicit VulkanRenderPass(const VulkanDevice& device, Span<RenderTarget> renderTargets, const UInt32& commandBuffers = 1, const MultiSamplingLevel& samples = MultiSamplingLevel::x1, Span<VulkanInputAttachmentMapping> inputAttachments = { });
1081
1091 explicit VulkanRenderPass(const VulkanDevice& device, const String& name, Span<RenderTarget> renderTargets, const UInt32& commandBuffers = 1, const MultiSamplingLevel& samples = MultiSamplingLevel::x1, Span<VulkanInputAttachmentMapping> inputAttachments = { });
1092
1095 virtual ~VulkanRenderPass() noexcept;
1096
1097 private:
1107 explicit VulkanRenderPass(const VulkanDevice& device, const String& name = "") noexcept;
1108
1109 // IInputAttachmentMappingSource interface.
1110 public:
1112 virtual const VulkanFrameBuffer& frameBuffer(const UInt32& buffer) const override;
1113
1114 // RenderPass interface.
1115 public:
1120 virtual const VulkanDevice& device() const noexcept;
1121
1123 virtual const VulkanFrameBuffer& activeFrameBuffer() const override;
1124
1126 virtual Array<const VulkanFrameBuffer*> frameBuffers() const noexcept override;
1127
1129 virtual Array<const VulkanRenderPipeline*> pipelines() const noexcept override;
1130
1132 virtual const RenderTarget& renderTarget(const UInt32& location) const override;
1133
1135 virtual Span<const RenderTarget> renderTargets() const noexcept override;
1136
1138 virtual bool hasPresentTarget() const noexcept override;
1139
1141 virtual Span<const VulkanInputAttachmentMapping> inputAttachments() const noexcept override;
1142
1144 virtual const MultiSamplingLevel& multiSamplingLevel() const noexcept override;
1145
1146 public:
1148 virtual void begin(const UInt32& buffer) override;
1149
1151 virtual void end() const override;
1152
1154 virtual void resizeFrameBuffers(const Size2d& renderArea) override;
1155
1157 virtual void changeMultiSamplingLevel(const MultiSamplingLevel& samples) override;
1158
1160 virtual void updateAttachments(const VulkanDescriptorSet& descriptorSet) const override;
1161 };
1162
1169 LITEFX_IMPLEMENTATION(VulkanInputAttachmentMappingImpl);
1170
1171 public:
1176
1183 VulkanInputAttachmentMapping(const VulkanRenderPass& renderPass, const RenderTarget& renderTarget, const UInt32& location);
1184
1189
1194
1196
1197 public:
1201 inline VulkanInputAttachmentMapping& operator=(const VulkanInputAttachmentMapping&) noexcept;
1202
1206 inline VulkanInputAttachmentMapping& operator=(VulkanInputAttachmentMapping&&) noexcept;
1207
1208 public:
1210 virtual const VulkanRenderPass* inputAttachmentSource() const noexcept override;
1211
1213 virtual const RenderTarget& renderTarget() const noexcept override;
1214
1216 virtual const UInt32& location() const noexcept override;
1217 };
1218
1222 class LITEFX_VULKAN_API VulkanSwapChain : public SwapChain<IVulkanImage, VulkanFrameBuffer> {
1223 LITEFX_IMPLEMENTATION(VulkanSwapChainImpl);
1224
1225 public:
1233 explicit VulkanSwapChain(const VulkanDevice& device, const Format& surfaceFormat = Format::B8G8R8A8_SRGB, const Size2d& renderArea = { 800, 600 }, const UInt32& buffers = 3);
1236 virtual ~VulkanSwapChain() noexcept;
1237
1238 // Vulkan Swap Chain interface.
1239 public:
1244 virtual const VkSemaphore& semaphore() const noexcept;
1245
1246 // SwapChain interface.
1247 public:
1249 virtual const Format& surfaceFormat() const noexcept override;
1250
1252 virtual const UInt32& buffers() const noexcept override;
1253
1255 virtual const Size2d& renderArea() const noexcept override;
1256
1258 virtual Array<const IVulkanImage*> images() const noexcept override;
1259
1261 virtual void present(const VulkanFrameBuffer& frameBuffer) const override;
1262
1263 public:
1265 virtual Array<Format> getSurfaceFormats() const noexcept override;
1266
1268 virtual void reset(const Format& surfaceFormat, const Size2d& renderArea, const UInt32& buffers) override;
1269
1271 [[nodiscard]] virtual UInt32 swapBackBuffer() const override;
1272 };
1273
1278 class LITEFX_VULKAN_API VulkanQueue : public CommandQueue<VulkanCommandBuffer>, public Resource<VkQueue> {
1279 LITEFX_IMPLEMENTATION(VulkanQueueImpl);
1280
1281 public:
1290 explicit VulkanQueue(const VulkanDevice& device, const QueueType& type, const QueuePriority& priority, const UInt32& familyId, const UInt32& queueId);
1291 VulkanQueue(const VulkanQueue&) = delete;
1293 virtual ~VulkanQueue() noexcept;
1294
1295 // VulkanQueue interface.
1296 public:
1301 virtual const VulkanDevice& device() const noexcept;
1302
1313 virtual const VkCommandPool& commandPool() const noexcept;
1314
1319 virtual const UInt32& familyId() const noexcept;
1320
1325 virtual const UInt32& queueId() const noexcept;
1326
1331 virtual const VkSemaphore& timelineSemaphore() const noexcept;
1332
1345 virtual UInt64 submit(const VulkanCommandBuffer& commandBuffer, Span<VkSemaphore> waitForSemaphores, Span<VkPipelineStageFlags> waitForStages, Span<VkSemaphore> signalSemaphores = { }) const;
1346
1359 virtual UInt64 submit(const Array<const VulkanCommandBuffer*>& commandBuffers, Span<VkSemaphore> waitForSemaphores, Span<VkPipelineStageFlags> waitForStages, Span<VkSemaphore> signalSemaphores = { }) const;
1360
1367 virtual UniquePtr<VulkanCommandBuffer> createCommandBuffer(const bool& secondary, const bool& beginRecording) const;
1368
1369 // CommandQueue interface.
1370 public:
1372 virtual bool isBound() const noexcept override;
1373
1375 virtual const QueuePriority& priority() const noexcept override;
1376
1378 virtual const QueueType& type() const noexcept override;
1379
1380 public:
1382 virtual void bind() override;
1383
1385 virtual void release() override;
1386
1388 virtual UniquePtr<VulkanCommandBuffer> createCommandBuffer(const bool& beginRecording = false) const override;
1389
1391 virtual UInt64 submit(const VulkanCommandBuffer& commandBuffer) const override;
1392
1394 virtual UInt64 submit(const Array<const VulkanCommandBuffer*>& commandBuffers) const override;
1395
1397 virtual void waitFor(const UInt64& fence) const noexcept override;
1398
1400 virtual UInt64 currentFence() const noexcept override;
1401 };
1402
1410 LITEFX_IMPLEMENTATION(VulkanGraphicsFactoryImpl);
1411
1412 public:
1417 explicit VulkanGraphicsFactory(const VulkanDevice& device);
1420 virtual ~VulkanGraphicsFactory() noexcept;
1421
1422 public:
1424 virtual UniquePtr<IVulkanBuffer> createBuffer(const BufferType& type, const BufferUsage& usage, const size_t& elementSize, const UInt32& elements = 1, const bool& allowWrite = false) const override;
1425
1427 virtual UniquePtr<IVulkanBuffer> createBuffer(const String& name, const BufferType& type, const BufferUsage& usage, const size_t& elementSize, const UInt32& elements = 1, const bool& allowWrite = false) const override;
1428
1430 virtual UniquePtr<IVulkanVertexBuffer> createVertexBuffer(const VulkanVertexBufferLayout& layout, const BufferUsage& usage, const UInt32& elements = 1) const override;
1431
1433 virtual UniquePtr<IVulkanVertexBuffer> createVertexBuffer(const String& name, const VulkanVertexBufferLayout& layout, const BufferUsage& usage, const UInt32& elements = 1) const override;
1434
1436 virtual UniquePtr<IVulkanIndexBuffer> createIndexBuffer(const VulkanIndexBufferLayout& layout, const BufferUsage& usage, const UInt32& elements) const override;
1437
1439 virtual UniquePtr<IVulkanIndexBuffer> createIndexBuffer(const String& name, const VulkanIndexBufferLayout& layout, const BufferUsage& usage, const UInt32& elements) const override;
1440
1442 virtual UniquePtr<IVulkanImage> createAttachment(const Format& format, const Size2d& size, const MultiSamplingLevel& samples = MultiSamplingLevel::x1) const override;
1443
1445 virtual UniquePtr<IVulkanImage> createAttachment(const String& name, const Format& format, const Size2d& size, const MultiSamplingLevel& samples = MultiSamplingLevel::x1) const override;
1446
1448 virtual UniquePtr<IVulkanImage> createTexture(const Format& format, const Size3d& size, const ImageDimensions& dimension = ImageDimensions::DIM_2, const UInt32& levels = 1, const UInt32& layers = 1, const MultiSamplingLevel& samples = MultiSamplingLevel::x1, const bool& allowWrite = false) const override;
1449
1451 virtual UniquePtr<IVulkanImage> createTexture(const String& name, const Format& format, const Size3d& size, const ImageDimensions& dimension = ImageDimensions::DIM_2, const UInt32& levels = 1, const UInt32& layers = 1, const MultiSamplingLevel& samples = MultiSamplingLevel::x1, const bool& allowWrite = false) const override;
1452
1454 virtual Array<UniquePtr<IVulkanImage>> createTextures(const UInt32& elements, const Format& format, const Size3d& size, const ImageDimensions& dimension = ImageDimensions::DIM_2, const UInt32& levels = 1, const UInt32& layers = 1, const MultiSamplingLevel& samples = MultiSamplingLevel::x1, const bool& allowWrite = false) const override;
1455
1457 virtual UniquePtr<IVulkanSampler> createSampler(const FilterMode& magFilter = FilterMode::Nearest, const FilterMode& minFilter = FilterMode::Nearest, const BorderMode& borderU = BorderMode::Repeat, const BorderMode& borderV = BorderMode::Repeat, const BorderMode& borderW = BorderMode::Repeat, const MipMapMode& mipMapMode = MipMapMode::Nearest, const Float& mipMapBias = 0.f, const Float& maxLod = std::numeric_limits<Float>::max(), const Float& minLod = 0.f, const Float& anisotropy = 0.f) const override;
1458
1460 virtual UniquePtr<IVulkanSampler> createSampler(const String& name, const FilterMode& magFilter = FilterMode::Nearest, const FilterMode& minFilter = FilterMode::Nearest, const BorderMode& borderU = BorderMode::Repeat, const BorderMode& borderV = BorderMode::Repeat, const BorderMode& borderW = BorderMode::Repeat, const MipMapMode& mipMapMode = MipMapMode::Nearest, const Float& mipMapBias = 0.f, const Float& maxLod = std::numeric_limits<Float>::max(), const Float& minLod = 0.f, const Float& anisotropy = 0.f) const override;
1461
1463 virtual Array<UniquePtr<IVulkanSampler>> createSamplers(const UInt32& elements, const FilterMode& magFilter = FilterMode::Nearest, const FilterMode& minFilter = FilterMode::Nearest, const BorderMode& borderU = BorderMode::Repeat, const BorderMode& borderV = BorderMode::Repeat, const BorderMode& borderW = BorderMode::Repeat, const MipMapMode& mipMapMode = MipMapMode::Nearest, const Float& mipMapBias = 0.f, const Float& maxLod = std::numeric_limits<Float>::max(), const Float& minLod = 0.f, const Float& anisotropy = 0.f) const override;
1464 };
1465
1470 LITEFX_IMPLEMENTATION(VulkanDeviceImpl);
1471
1472 public:
1480 explicit VulkanDevice(const VulkanBackend& backend, const VulkanGraphicsAdapter& adapter, UniquePtr<VulkanSurface>&& surface, Span<String> extensions = { });
1481
1492 explicit VulkanDevice(const VulkanBackend& backend, const VulkanGraphicsAdapter& adapter, UniquePtr<VulkanSurface>&& surface, const Format& format, const Size2d& frameBufferSize, const UInt32& frameBuffers, Span<String> extensions = { });
1493
1494 VulkanDevice(const VulkanDevice&) = delete;
1496 virtual ~VulkanDevice() noexcept;
1497
1498 // Vulkan Device interface.
1499 public:
1504 virtual Span<const String> enabledExtensions() const noexcept;
1505
1516 virtual void setDebugName(UInt64 objectHandle, VkDebugReportObjectTypeEXT objectType, StringView name) const noexcept;
1517
1518 // GraphicsDevice interface.
1519 public:
1521 virtual DeviceState& state() const noexcept override;
1522
1524 virtual const VulkanSwapChain& swapChain() const noexcept override;
1525
1527 virtual VulkanSwapChain& swapChain() noexcept override;
1528
1530 virtual const VulkanSurface& surface() const noexcept override;
1531
1533 virtual const VulkanGraphicsAdapter& adapter() const noexcept override;
1534
1536 virtual const VulkanGraphicsFactory& factory() const noexcept override;
1537
1539 virtual const VulkanQueue& graphicsQueue() const noexcept override;
1540
1542 virtual const VulkanQueue& transferQueue() const noexcept override;
1543
1545 virtual const VulkanQueue& bufferQueue() const noexcept override;
1546
1548 virtual const VulkanQueue& computeQueue() const noexcept override;
1549
1551 virtual UniquePtr<VulkanBarrier> makeBarrier() const noexcept override;
1552
1554 virtual MultiSamplingLevel maximumMultiSamplingLevel(const Format& format) const noexcept override;
1555
1557 virtual void wait() const override;
1558
1559#if defined(BUILD_DEFINE_BUILDERS)
1560 public:
1562 [[nodiscard]] virtual VulkanRenderPassBuilder buildRenderPass(const MultiSamplingLevel& samples = MultiSamplingLevel::x1, const UInt32& commandBuffers = 1) const override;
1563
1565 [[nodiscard]] virtual VulkanRenderPassBuilder buildRenderPass(const String& name, const MultiSamplingLevel& samples = MultiSamplingLevel::x1, const UInt32& commandBuffers = 1) const override;
1566
1568 //[[nodiscard]] virtual VulkanRenderPipelineBuilder buildRenderPipeline(const String& name) const override;
1569
1571 [[nodiscard]] virtual VulkanRenderPipelineBuilder buildRenderPipeline(const VulkanRenderPass& renderPass, const String& name) const override;
1572
1574 [[nodiscard]] virtual VulkanComputePipelineBuilder buildComputePipeline(const String& name) const override;
1575
1577 [[nodiscard]] virtual VulkanPipelineLayoutBuilder buildPipelineLayout() const override;
1578
1580 [[nodiscard]] virtual VulkanInputAssemblerBuilder buildInputAssembler() const override;
1581
1583 [[nodiscard]] virtual VulkanRasterizerBuilder buildRasterizer() const override;
1584
1586 [[nodiscard]] virtual VulkanShaderProgramBuilder buildShaderProgram() const override;
1587#endif // defined(BUILD_DEFINE_BUILDERS)
1588 };
1589
1593 class LITEFX_VULKAN_API VulkanBackend : public RenderBackend<VulkanBackend, VulkanDevice>, public Resource<VkInstance> {
1594 LITEFX_IMPLEMENTATION(VulkanBackendImpl);
1595
1596 public:
1603 explicit VulkanBackend(const App& app, const Span<String> extensions = { }, const Span<String> validationLayers = { });
1604 VulkanBackend(const VulkanBackend&) noexcept = delete;
1605 VulkanBackend(VulkanBackend&&) noexcept = delete;
1606 virtual ~VulkanBackend() noexcept;
1607
1608
1609 public:
1614 virtual Span<const String> getEnabledValidationLayers() const noexcept;
1615
1616#ifdef VK_USE_PLATFORM_WIN32_KHR
1622 UniquePtr<VulkanSurface> createSurface(const HWND& hwnd) const;
1623#else
1627 typedef std::function<VkSurfaceKHR(const VkInstance&)> surface_callback;
1628
1635 UniquePtr<VulkanSurface> createSurface(surface_callback predicate) const;
1636#endif // VK_USE_PLATFORM_WIN32_KHR
1637
1638 public:
1644 static bool validateInstanceExtensions(Span<const String> extensions) noexcept;
1645
1651 static Array<String> getAvailableInstanceExtensions() noexcept;
1652
1658 static bool validateInstanceLayers(const Span<const String> validationLayers) noexcept;
1659
1665 static Array<String> getInstanceValidationLayers() noexcept;
1666
1667 // IBackend interface.
1668 public:
1670 virtual BackendType type() const noexcept override;
1671
1673 virtual String name() const noexcept override;
1674
1675 protected:
1677 virtual void activate() override;
1678
1680 virtual void deactivate() override;
1681
1682 // RenderBackend interface.
1683 public:
1685 virtual Array<const VulkanGraphicsAdapter*> listAdapters() const override;
1686
1688 virtual const VulkanGraphicsAdapter* findAdapter(const Optional<UInt64>& adapterId = std::nullopt) const override;
1689
1691 virtual void registerDevice(String name, UniquePtr<VulkanDevice>&& device) override;
1692
1694 virtual void releaseDevice(const String& name) override;
1695
1697 virtual VulkanDevice* device(const String& name) noexcept override;
1698
1700 virtual const VulkanDevice* device(const String& name) const noexcept override;
1701 };
1702}
The base class for an application.
Definition: app.hpp:74
Provides access to a resource managed by the class.
Definition: containers.hpp:347
Definition: math.hpp:571
Definition: math.hpp:540
Definition: math.hpp:271
Definition: math.hpp:349
Represents the base interface for a Vulkan buffer implementation.
Definition: vulkan.hpp:92
virtual ~IVulkanBuffer() noexcept=default
Represents a Vulkan sampled image or the base interface for a texture.
Definition: vulkan.hpp:125
virtual ~IVulkanImage() noexcept=default
Represents a Vulkan index buffer.
Definition: vulkan.hpp:112
virtual ~IVulkanIndexBuffer() noexcept=default
Represents a Vulkan sampler.
Definition: vulkan.hpp:167
virtual ~IVulkanSampler() noexcept=default
Represents a Vulkan vertex buffer.
Definition: vulkan.hpp:102
virtual ~IVulkanVertexBuffer() noexcept=default
Defines a rendering backend that creates a Vulkan device.
Definition: vulkan.hpp:1593
std::function< VkSurfaceKHR(const VkInstance &)> surface_callback
A callback that creates a surface from a Vulkan instance.
Definition: vulkan.hpp:1627
VulkanBackend(VulkanBackend &&) noexcept=delete
VulkanBackend(const VulkanBackend &) noexcept=delete
Implements a Vulkan resource barrier.
Definition: vulkan.hpp:179
VulkanBarrier(VulkanBarrier &&)=delete
VulkanBarrier(const VulkanBarrier &)=delete
Records commands for a VulkanCommandQueue
Definition: vulkan.hpp:802
VulkanCommandBuffer(const VulkanCommandBuffer &)=delete
VulkanCommandBuffer(VulkanCommandBuffer &&)=delete
Implements a Vulkan ComputePipeline.
Definition: vulkan.hpp:954
VulkanComputePipeline(VulkanComputePipeline &&) noexcept=delete
Implements a Vulkan IDescriptorLayout
Definition: vulkan.hpp:386
VulkanDescriptorLayout(VulkanDescriptorLayout &&)=delete
VulkanDescriptorLayout(const VulkanDescriptorLayout &)=delete
Implements a Vulkan DescriptorSet.
Definition: vulkan.hpp:343
VulkanDescriptorSet(VulkanDescriptorSet &&)=delete
VulkanDescriptorSet(const VulkanDescriptorSet &)=delete
Implements a Vulkan DescriptorSetLayout.
Definition: vulkan.hpp:439
VulkanDescriptorSetLayout(const VulkanDescriptorSetLayout &)=delete
VulkanDescriptorSetLayout(VulkanDescriptorSetLayout &&)=delete
Implements a Vulkan graphics device.
Definition: vulkan.hpp:1469
VulkanDevice(const VulkanDevice &)=delete
Implements a Vulkan frame buffer.
Definition: vulkan.hpp:999
VulkanFrameBuffer(const VulkanFrameBuffer &) noexcept=delete
VulkanFrameBuffer(VulkanFrameBuffer &&) noexcept=delete
Represents a Vulkan IGraphicsAdapter.
Definition: vulkan_api.hpp:199
A graphics factory that produces objects for a VulkanDevice.
Definition: vulkan.hpp:1409
VulkanGraphicsFactory(VulkanGraphicsFactory &&)=delete
VulkanGraphicsFactory(const VulkanGraphicsFactory &)=delete
Implements a Vulkan index buffer layout.
Definition: vulkan.hpp:55
VulkanIndexBufferLayout(const VulkanIndexBufferLayout &)=delete
VulkanIndexBufferLayout(VulkanIndexBufferLayout &&)=delete
Implements the Vulkan input assembler state.
Definition: vulkan.hpp:694
VulkanInputAssembler(VulkanInputAssembler &&) noexcept=delete
Implements a IInputAttachmentMapping.
Definition: vulkan.hpp:1168
Implements a Vulkan PipelineLayout.
Definition: vulkan.hpp:648
VulkanPipelineLayout(VulkanPipelineLayout &&) noexcept=delete
Defines the base class for Vulkan pipeline state objects.
Definition: vulkan.hpp:778
virtual ~VulkanPipelineState() noexcept=default
Implements the Vulkan PushConstantsLayout.
Definition: vulkan.hpp:596
VulkanPushConstantsLayout(const VulkanPushConstantsLayout &)=delete
VulkanPushConstantsLayout(VulkanPushConstantsLayout &&)=delete
Implements the Vulkan IPushConstantsRange.
Definition: vulkan.hpp:556
VulkanPushConstantsRange(const VulkanPushConstantsRange &)=delete
VulkanPushConstantsRange(VulkanPushConstantsRange &&)=delete
Implements a Vulkan command queue.
Definition: vulkan.hpp:1278
VulkanQueue(const VulkanQueue &)=delete
Implements a Vulkan IRasterizer.
Definition: vulkan.hpp:734
VulkanRasterizer(VulkanRasterizer &&) noexcept=delete
Implements a Vulkan render pass.
Definition: vulkan.hpp:1067
VulkanRenderPass(VulkanRenderPass &&)=delete
VulkanRenderPass(const VulkanRenderPass &)=delete
Implements a Vulkan RenderPipeline.
Definition: vulkan.hpp:881
VulkanRenderPipeline(VulkanRenderPipeline &&) noexcept=delete
Implements a Vulkan IShaderModule.
Definition: vulkan.hpp:247
VulkanShaderModule(VulkanShaderModule &&) noexcept=delete
VulkanShaderModule(const VulkanShaderModule &) noexcept=delete
Implements a Vulkan ShaderProgram.
Definition: vulkan.hpp:304
VulkanShaderProgram(VulkanShaderProgram &&) noexcept=delete
Represents a Vulkan ISurface.
Definition: vulkan_api.hpp:276
Implements a Vulkan swap chain.
Definition: vulkan.hpp:1222
VulkanSwapChain(const VulkanSwapChain &)=delete
VulkanSwapChain(VulkanSwapChain &&)=delete
Implements a Vulkan vertex buffer layout.
Definition: vulkan.hpp:18
VulkanVertexBufferLayout(const VulkanVertexBufferLayout &)=delete
VulkanVertexBufferLayout(VulkanVertexBufferLayout &&)=delete
A barrier that transitions a set of resources backed by IDeviceMemory into different ResourceState.
Definition: rendering.hpp:19
Stores meta data about a buffer attribute, i.e. a member or field of a descriptor or buffer.
Definition: rendering_api.hpp:2461
Represents a command buffer, that buffers commands that should be submitted to a CommandQueue.
Definition: rendering.hpp:488
Represents a command queue.
Definition: rendering.hpp:874
Represents a compute Pipeline.
Definition: rendering.hpp:664
Stores the depth/stencil state of a see IRasterizer.
Definition: rendering_api.hpp:2066
Defines a set of descriptors.
Definition: rendering.hpp:169
Describes the layout of a descriptor set.
Definition: rendering.hpp:224
A class that can be used to manage the state of a IGraphicsDevice.
Definition: rendering_api.hpp:1489
Stores the images for the output attachments for a back buffer of a RenderPass, as well as a CommandB...
Definition: rendering.hpp:676
Represents the graphics device that a rendering back-end is doing work on.
Definition: rendering.hpp:1078
Describes a factory that creates objects for a GraphicsDevice.
Definition: rendering.hpp:930
Base interface for buffer objects.
Definition: rendering_api.hpp:2774
Describes a the layout of a single descriptor within a DescriptorSet.
Definition: rendering_api.hpp:2613
Describes a generic image.
Definition: rendering_api.hpp:2789
Describes a index buffer layout.
Definition: rendering_api.hpp:2579
Represents a mapping between a set of IRenderTarget instances and the input attachments of a RenderPa...
Definition: rendering.hpp:742
The interface for a pipeline layout.
Definition: rendering_api.hpp:3410
Describes a range within a IPushConstantsLayout.
Definition: rendering_api.hpp:3282
Describes a texture sampler.
Definition: rendering_api.hpp:2872
The interface of a scissor.
Definition: rendering_api.hpp:2415
Represents a single shader module, i.e. a part of a IShaderProgram.
Definition: rendering_api.hpp:1827
Describes a vertex buffer layout.
Definition: rendering_api.hpp:2563
Interface for a viewport.
Definition: rendering_api.hpp:2331
Describes an index buffer.
Definition: rendering.hpp:396
Represents a the input assembler state of a RenderPipeline.
Definition: rendering.hpp:416
Represents a pipeline state.
Definition: rendering.hpp:451
Represents a the layout of a RenderPipeline or a ComputePipeline.
Definition: rendering.hpp:347
Describes the layout of the pipelines push constant ranges.
Definition: rendering.hpp:296
Implements a IRasterizer.
Definition: rendering_api.hpp:2287
Defines a back-end, that provides a device instance for a certain surface and graphics adapter.
Definition: rendering.hpp:1224
Represents a render pass.
Definition: rendering.hpp:787
Represents a graphics Pipeline.
Definition: rendering.hpp:632
Implements a render target.
Definition: rendering_api.hpp:1994
Represents a shader program, consisting of multiple IShaderModules.
Definition: rendering.hpp:321
Represents a swap chain, i.e. a chain of multiple IImage instances, that can be presented to a ISurfa...
Definition: rendering.hpp:838
Describes a vertex buffer.
Definition: rendering.hpp:378
Implements the IResource interface.
Definition: containers.hpp:371
Definition: math.hpp:30
uint32_t UInt32
Definition: math.hpp:37
float_t Float
Definition: math.hpp:40
uint64_t UInt64
Definition: math.hpp:39
int32_t Int32
Definition: math.hpp:36
Definition: dx12.hpp:8
Definition: dx12.hpp:8
std::string String
Definition: string.hpp:19
std::vector< T > Array
Represents a dynamic array.
Definition: containers.hpp:58
std::span< T > Span
Represents a view of an array.
Definition: containers.hpp:72
std::shared_ptr< T > SharedPtr
Represents a shared pointer, that expresses non-exclusive ownership.
Definition: containers.hpp:94
std::unique_ptr< T, TDeleter > UniquePtr
Represents a unique pointer, that expresses exclusive ownership.
Definition: containers.hpp:87
std::string_view StringView
Definition: string.hpp:21
std::optional< T > Optional
Represents an optional value.
Definition: containers.hpp:79