LiteFX 0.3.1.2022
Computer Graphics Engine
dx12.hpp
1#pragma once
2
3#include <litefx/rendering.hpp>
4
5#include "dx12_api.hpp"
6#include "dx12_formatters.hpp"
7
9 using namespace LiteFX::Math;
10 using namespace LiteFX::Rendering;
11
18 class LITEFX_DIRECTX12_API DirectX12VertexBufferLayout : public IVertexBufferLayout {
19 LITEFX_IMPLEMENTATION(DirectX12VertexBufferLayoutImpl);
20 LITEFX_BUILDER(DirectX12VertexBufferLayoutBuilder);
21
22 public:
28 explicit DirectX12VertexBufferLayout(const size_t& vertexSize, const UInt32& binding = 0);
31 virtual ~DirectX12VertexBufferLayout() 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_DIRECTX12_API DirectX12IndexBufferLayout : public IIndexBufferLayout {
56 LITEFX_IMPLEMENTATION(DirectX12IndexBufferLayoutImpl);
57
58 public:
63 explicit DirectX12IndexBufferLayout(const IndexType& type);
66 virtual ~DirectX12IndexBufferLayout() 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_DIRECTX12_API IDirectX12Buffer : public virtual IBuffer, public virtual IResource<ComPtr<ID3D12Resource>> {
93 public:
94 virtual ~IDirectX12Buffer() noexcept = default;
95 };
96
102 class LITEFX_DIRECTX12_API IDirectX12VertexBuffer : public virtual VertexBuffer<DirectX12VertexBufferLayout>, public virtual IDirectX12Buffer {
103 public:
104 virtual ~IDirectX12VertexBuffer() noexcept = default;
105
106 public:
107 virtual const D3D12_VERTEX_BUFFER_VIEW& view() const noexcept = 0;
108 };
109
115 class LITEFX_DIRECTX12_API IDirectX12IndexBuffer : public virtual IndexBuffer<DirectX12IndexBufferLayout>, public virtual IDirectX12Buffer {
116 public:
117 virtual ~IDirectX12IndexBuffer() noexcept = default;
118
119 public:
120 virtual const D3D12_INDEX_BUFFER_VIEW& view() const noexcept = 0;
121 };
122
130 class LITEFX_DIRECTX12_API IDirectX12Image : public virtual IImage, public virtual IResource<ComPtr<ID3D12Resource>> {
131 public:
132 virtual ~IDirectX12Image() noexcept = default;
133 };
134
142 class LITEFX_DIRECTX12_API IDirectX12Sampler : public virtual ISampler {
143 public:
144 virtual ~IDirectX12Sampler() noexcept = default;
145 };
146
154 class LITEFX_DIRECTX12_API DirectX12Barrier : public Barrier<IDirectX12Buffer, IDirectX12Image> {
155 LITEFX_IMPLEMENTATION(DirectX12BarrierImpl);
156
157 public:
158 explicit DirectX12Barrier() noexcept;
161 virtual ~DirectX12Barrier() noexcept;
162
163 // Barrier interface.
164 public:
166 virtual void transition(IDirectX12Buffer& buffer, const ResourceState& targetState) override;
167
169 virtual void transition(IDirectX12Buffer& buffer, const UInt32& element, const ResourceState& targetState) override;
170
172 virtual void transition(IDirectX12Buffer& buffer, const ResourceState& sourceState, const ResourceState& targetState) override;
173
175 virtual void transition(IDirectX12Buffer& buffer, const ResourceState& sourceState, const UInt32& element, const ResourceState& targetState) override;
176
178 virtual void transition(IDirectX12Image& image, const ResourceState& targetState) override;
179
181 virtual void transition(IDirectX12Image& image, const UInt32& level, const UInt32& layer, const UInt32& plane, const ResourceState& targetState) override;
182
184 virtual void transition(IDirectX12Image& image, const ResourceState& sourceState, const ResourceState& targetState) override;
185
187 virtual void transition(IDirectX12Image& image, const ResourceState& sourceState, const UInt32& level, const UInt32& layer, const UInt32& plane, const ResourceState& targetState) override;
188
190 virtual void waitFor(const IDirectX12Buffer& buffer) override;
191
193 virtual void waitFor(const IDirectX12Image& image) override;
194
195 public:
201 virtual void execute(const DirectX12CommandBuffer& commandBuffer, const D3D12_RESOURCE_BARRIER_FLAGS& flags = D3D12_RESOURCE_BARRIER_FLAG_NONE) const noexcept;
202
212 virtual void executeInverse(const DirectX12CommandBuffer& commandBuffer, const D3D12_RESOURCE_BARRIER_FLAGS& flags = D3D12_RESOURCE_BARRIER_FLAG_NONE) const noexcept;
213 };
214
220 class LITEFX_DIRECTX12_API DirectX12ShaderModule : public IShaderModule, public ComResource<IDxcBlob> {
221 LITEFX_IMPLEMENTATION(DirectX12ShaderModuleImpl);
222
223 public:
231 explicit DirectX12ShaderModule(const DirectX12Device& device, const ShaderStage& type, const String& fileName, const String& entryPoint = "main");
232
241 explicit DirectX12ShaderModule(const DirectX12Device& device, const ShaderStage& type, std::istream& stream, const String& name, const String& entryPoint = "main");
244 virtual ~DirectX12ShaderModule() noexcept;
245
246 // IShaderModule interface.
247 public:
249 virtual const String& fileName() const noexcept override;
250
252 virtual const String& entryPoint() const noexcept override;
253
255 virtual const ShaderStage& type() const noexcept override;
256 };
257
263 class LITEFX_DIRECTX12_API DirectX12ShaderProgram : public ShaderProgram<DirectX12ShaderModule> {
264 LITEFX_IMPLEMENTATION(DirectX12ShaderProgramImpl);
265 LITEFX_BUILDER(DirectX12ShaderProgramBuilder);
266
267 public:
273 explicit DirectX12ShaderProgram(const DirectX12Device& device, Array<UniquePtr<DirectX12ShaderModule>>&& modules) noexcept;
276 virtual ~DirectX12ShaderProgram() noexcept;
277
278 private:
283 explicit DirectX12ShaderProgram(const DirectX12Device& device) noexcept;
284
285 public:
287 virtual Array<const DirectX12ShaderModule*> modules() const noexcept override;
288
290 virtual SharedPtr<DirectX12PipelineLayout> reflectPipelineLayout() const;
291
292 private:
293 virtual SharedPtr<IPipelineLayout> parsePipelineLayout() const override {
294 return std::static_pointer_cast<IPipelineLayout>(this->reflectPipelineLayout());
295 }
296
297 public:
310 static void suppressMissingRootSignatureWarning(bool disableWarning = true) noexcept;
311 };
312
318 LITEFX_IMPLEMENTATION(DirectX12DescriptorSetImpl);
319
320 public:
327 explicit DirectX12DescriptorSet(const DirectX12DescriptorSetLayout& layout, ComPtr<ID3D12DescriptorHeap>&& bufferHeap, ComPtr<ID3D12DescriptorHeap>&& samplerHeap);
330 virtual ~DirectX12DescriptorSet() noexcept;
331
332 public:
337 virtual const DirectX12DescriptorSetLayout& layout() const noexcept;
338
339 public:
341 virtual void update(const UInt32& binding, const IDirectX12Buffer& buffer, const UInt32& bufferElement = 0, const UInt32& elements = 1, const UInt32& firstDescriptor = 0) const override;
342
344 virtual void update(const UInt32& binding, const IDirectX12Image& texture, const UInt32& descriptor = 0, const UInt32& firstLevel = 0, const UInt32& levels = 0, const UInt32& firstLayer = 0, const UInt32& layers = 0) const override;
345
347 virtual void update(const UInt32& binding, const IDirectX12Sampler& sampler, const UInt32& descriptor = 0) const override;
348
350 virtual void attach(const UInt32& binding, const IDirectX12Image& image) const override;
351
352 public:
357 virtual const ComPtr<ID3D12DescriptorHeap>& bufferHeap() const noexcept;
358
363 virtual const UInt32& bufferOffset() const noexcept;
364
369 virtual const ComPtr<ID3D12DescriptorHeap>& samplerHeap() const noexcept;
370
375 virtual const UInt32& samplerOffset() const noexcept;
376 };
377
386 class LITEFX_DIRECTX12_API DirectX12DescriptorLayout : public IDescriptorLayout {
387 LITEFX_IMPLEMENTATION(DirectX12DescriptorLayoutImpl);
388
389 public:
397 explicit DirectX12DescriptorLayout(const DescriptorType& type, const UInt32& binding, const size_t& elementSize, const UInt32& descriptors = 1);
398
404 explicit DirectX12DescriptorLayout(UniquePtr<IDirectX12Sampler>&& staticSampler, const UInt32& binding);
405
408 virtual ~DirectX12DescriptorLayout() noexcept;
409
410 // IDescriptorLayout interface.
411 public:
413 virtual const DescriptorType& descriptorType() const noexcept override;
414
416 virtual const UInt32& descriptors() const noexcept override;
417
419 virtual const IDirectX12Sampler* staticSampler() const noexcept override;
420
421 // IBufferLayout interface.
422 public:
424 virtual size_t elementSize() const noexcept override;
425
427 virtual const UInt32& binding() const noexcept override;
428
430 virtual const BufferType& type() const noexcept override;
431 };
432
439 LITEFX_IMPLEMENTATION(DirectX12DescriptorSetLayoutImpl);
440 LITEFX_BUILDER(DirectX12DescriptorSetLayoutBuilder);
442
443 public:
451 explicit DirectX12DescriptorSetLayout(const DirectX12Device& device, Array<UniquePtr<DirectX12DescriptorLayout>>&& descriptorLayouts, const UInt32& space, const ShaderStage& stages);
455
456 private:
461 explicit DirectX12DescriptorSetLayout(const DirectX12Device& device) noexcept;
462
463 public:
468 virtual const UInt32& rootParameterIndex() const noexcept;
469
477 virtual UInt32 descriptorOffsetForBinding(const UInt32& binding) const;
478
483 virtual const DirectX12Device& device() const noexcept;
484
485 protected:
490 virtual UInt32& rootParameterIndex() noexcept;
491
499 virtual bool isRuntimeArray() const noexcept;
500
501 public:
503 virtual Array<const DirectX12DescriptorLayout*> descriptors() const noexcept override;
504
506 virtual const DirectX12DescriptorLayout& descriptor(const UInt32& binding) const override;
507
509 virtual const UInt32& space() const noexcept override;
510
512 virtual const ShaderStage& shaderStages() const noexcept override;
513
515 virtual UInt32 uniforms() const noexcept override;
516
518 virtual UInt32 storages() const noexcept override;
519
521 virtual UInt32 images() const noexcept override;
522
524 virtual UInt32 buffers() const noexcept override;
525
527 virtual UInt32 samplers() const noexcept override;
528
530 virtual UInt32 staticSamplers() const noexcept override;
531
533 virtual UInt32 inputAttachments() const noexcept override;
534
535 public:
537 virtual UniquePtr<DirectX12DescriptorSet> allocate(const UInt32& descriptors = 0) const override;
538
540 virtual Array<UniquePtr<DirectX12DescriptorSet>> allocateMultiple(const UInt32& descriptorSets, const UInt32& descriptors = 0) const override;
541
543 virtual void free(const DirectX12DescriptorSet& descriptorSet) const noexcept override;
544 };
545
550 class LITEFX_DIRECTX12_API DirectX12PushConstantsRange : public IPushConstantsRange {
551 LITEFX_IMPLEMENTATION(DirectX12PushConstantsRangeImpl);
553
554 public:
563 explicit DirectX12PushConstantsRange(const ShaderStage& shaderStages, const UInt32& offset, const UInt32& size, const UInt32& space, const UInt32& binding);
567
568 public:
570 virtual const UInt32& space() const noexcept override;
571
573 virtual const UInt32& binding() const noexcept override;
574
576 virtual const UInt32& offset() const noexcept override;
577
579 virtual const UInt32& size() const noexcept override;
580
582 virtual const ShaderStage& stage() const noexcept override;
583
584 public:
589 virtual const UInt32& rootParameterIndex() const noexcept;
590
591 protected:
596 virtual UInt32& rootParameterIndex() noexcept;
597 };
598
611 LITEFX_IMPLEMENTATION(DirectX12PushConstantsLayoutImpl);
612 LITEFX_BUILDER(DirectX12PushConstantsLayoutBuilder);
614
615 public:
625
626 private:
631 explicit DirectX12PushConstantsLayout(const UInt32& size);
632
633 public:
635 virtual const UInt32& size() const noexcept override;
636
638 virtual const DirectX12PushConstantsRange& range(const ShaderStage& stage) const override;
639
641 virtual Array<const DirectX12PushConstantsRange*> ranges() const noexcept override;
642
643 protected:
648 virtual Array<DirectX12PushConstantsRange*> ranges() noexcept;
649 };
650
655 class LITEFX_DIRECTX12_API DirectX12PipelineLayout : public PipelineLayout<DirectX12DescriptorSetLayout, DirectX12PushConstantsLayout>, public ComResource<ID3D12RootSignature> {
656 LITEFX_IMPLEMENTATION(DirectX12PipelineLayoutImpl);
657 LITEFX_BUILDER(DirectX12PipelineLayoutBuilder);
658
659 public:
667 explicit DirectX12PipelineLayout(const DirectX12Device& device, Array<UniquePtr<DirectX12DescriptorSetLayout>>&& descriptorSetLayouts, UniquePtr<DirectX12PushConstantsLayout>&& pushConstantsLayout);
668
671 virtual ~DirectX12PipelineLayout() noexcept;
672
673 private:
678 explicit DirectX12PipelineLayout(const DirectX12Device& device) noexcept;
679
680 public:
685 virtual const DirectX12Device& device() const noexcept;
686
687 // PipelineLayout interface.
688 public:
690 virtual const DirectX12DescriptorSetLayout& descriptorSet(const UInt32& space) const override;
691
693 virtual Array<const DirectX12DescriptorSetLayout*> descriptorSets() const noexcept override;
694
696 virtual const DirectX12PushConstantsLayout* pushConstants() const noexcept override;
697 };
698
704 LITEFX_IMPLEMENTATION(DirectX12InputAssemblerImpl);
705 LITEFX_BUILDER(DirectX12InputAssemblerBuilder);
706
707 public:
714 explicit DirectX12InputAssembler(Array<UniquePtr<DirectX12VertexBufferLayout>>&& vertexBufferLayouts, UniquePtr<DirectX12IndexBufferLayout>&& indexBufferLayout, const PrimitiveTopology& primitiveTopology = PrimitiveTopology::TriangleList);
717 virtual ~DirectX12InputAssembler() noexcept;
718
719 private:
723 explicit DirectX12InputAssembler() noexcept;
724
725 public:
727 virtual Array<const DirectX12VertexBufferLayout*> vertexBufferLayouts() const noexcept override;
728
730 virtual const DirectX12VertexBufferLayout& vertexBufferLayout(const UInt32& binding) const override;
731
733 virtual const DirectX12IndexBufferLayout& indexBufferLayout() const override;
734
736 virtual const PrimitiveTopology& topology() const noexcept override;
737 };
738
743 class LITEFX_DIRECTX12_API DirectX12Rasterizer : public Rasterizer {
744 LITEFX_BUILDER(DirectX12RasterizerBuilder);
745
746 public:
755 explicit DirectX12Rasterizer(const PolygonMode& polygonMode, const CullMode& cullMode, const CullOrder& cullOrder, const Float& lineWidth = 1.f, const DepthStencilState& depthStencilState = {}) noexcept;
757 DirectX12Rasterizer(const DirectX12Rasterizer&) noexcept = delete;
758 virtual ~DirectX12Rasterizer() noexcept;
759
760 private:
764 explicit DirectX12Rasterizer() noexcept;
765 };
766
772 class LITEFX_DIRECTX12_API DirectX12PipelineState : public virtual Pipeline<DirectX12PipelineLayout, DirectX12ShaderProgram>, public ComResource<ID3D12PipelineState> {
773 public:
774 using ComResource<ID3D12PipelineState>::ComResource;
775 virtual ~DirectX12PipelineState() noexcept = default;
776
777 public:
782 virtual void use(const DirectX12CommandBuffer& commandBuffer) const noexcept = 0;
783 };
784
790 LITEFX_IMPLEMENTATION(DirectX12CommandBufferImpl);
791
792 public:
798 explicit DirectX12CommandBuffer(const DirectX12Queue& queue, const bool& begin = false);
801 virtual ~DirectX12CommandBuffer() noexcept;
802
803 // CommandBuffer interface.
804 public:
806 virtual void begin() const override;
807
809 virtual void end() const override;
810
812 virtual void generateMipMaps(IDirectX12Image& image) noexcept override;
813
815 virtual void barrier(const DirectX12Barrier& barrier, const bool& invert = false) const noexcept override;
816
818 virtual void transfer(const IDirectX12Buffer& source, const IDirectX12Buffer& target, const UInt32& sourceElement = 0, const UInt32& targetElement = 0, const UInt32& elements = 1) const override;
819
821 virtual void transfer(const IDirectX12Buffer& source, const IDirectX12Image& target, const UInt32& sourceElement = 0, const UInt32& firstSubresource = 0, const UInt32& elements = 1) const override;
822
824 virtual void transfer(const IDirectX12Image& source, const IDirectX12Image& target, const UInt32& sourceSubresource = 0, const UInt32& targetSubresource = 0, const UInt32& subresources = 1) const override;
825
827 virtual void transfer(const IDirectX12Image& source, const IDirectX12Buffer& target, const UInt32& firstSubresource = 0, const UInt32& targetElement = 0, const UInt32& subresources = 1) const override;
828
830 virtual void use(const DirectX12PipelineState& pipeline) const noexcept override;
831
833 virtual void bind(const DirectX12DescriptorSet& descriptorSet, const DirectX12PipelineState& pipeline) const noexcept override;
834
836 virtual void bind(const IDirectX12VertexBuffer& buffer) const noexcept override;
837
839 virtual void bind(const IDirectX12IndexBuffer& buffer) const noexcept override;
840
842 virtual void dispatch(const Vector3u& threadCount) const noexcept override;
843
845 virtual void draw(const UInt32& vertices, const UInt32& instances = 1, const UInt32& firstVertex = 0, const UInt32& firstInstance = 0) const noexcept override;
846
848 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;
849
851 virtual void pushConstants(const DirectX12PushConstantsLayout& layout, const void* const memory) const noexcept override;
852 };
853
860 LITEFX_IMPLEMENTATION(DirectX12RenderPipelineImpl);
861 LITEFX_BUILDER(DirectX12RenderPipelineBuilder);
862
863 public:
874 explicit DirectX12RenderPipeline(const DirectX12RenderPass& renderPass, SharedPtr<DirectX12PipelineLayout> layout, SharedPtr<DirectX12ShaderProgram> shaderProgram, SharedPtr<DirectX12InputAssembler> inputAssembler, SharedPtr<DirectX12Rasterizer> rasterizer, Array<SharedPtr<IViewport>>&& viewports, Array<SharedPtr<IScissor>>&& scissors, const bool enableAlphaToCoverage = false, const String& name = "");
877 virtual ~DirectX12RenderPipeline() noexcept;
878
879 private:
885 DirectX12RenderPipeline(const DirectX12RenderPass& renderPass, const String& name = "") noexcept;
886
887 // Pipeline interface.
888 public:
890 virtual SharedPtr<const DirectX12ShaderProgram> program() const noexcept override;
891
893 virtual SharedPtr<const DirectX12PipelineLayout> layout() const noexcept override;
894
895 // RenderPipeline interface.
896 public:
898 virtual SharedPtr<DirectX12InputAssembler> inputAssembler() const noexcept override;
899
901 virtual SharedPtr<DirectX12Rasterizer> rasterizer() const noexcept override;
902
904 virtual Array<const IViewport*> viewports() const noexcept override;
905
907 virtual Array<const IScissor*> scissors() const noexcept override;
908
910 virtual UInt32& stencilRef() const noexcept override;
911
913 virtual Vector4f& blendFactors() const noexcept override;
914
916 virtual const bool& alphaToCoverage() const noexcept override;
917
918 // DirectX12PipelineState interface.
919 public:
921 virtual void use(const DirectX12CommandBuffer& commandBuffer) const noexcept override;
922 };
923
930 LITEFX_IMPLEMENTATION(DirectX12ComputePipelineImpl);
931 LITEFX_BUILDER(DirectX12ComputePipelineBuilder);
932
933 public:
941 explicit DirectX12ComputePipeline(const DirectX12Device& device, SharedPtr<DirectX12PipelineLayout> layout, SharedPtr<DirectX12ShaderProgram> shaderProgram, const String& name = "");
944 virtual ~DirectX12ComputePipeline() noexcept;
945
946 private:
951 DirectX12ComputePipeline(const DirectX12Device& device) noexcept;
952
953 // Pipeline interface.
954 public:
956 virtual SharedPtr<const DirectX12ShaderProgram> program() const noexcept override;
957
959 virtual SharedPtr<const DirectX12PipelineLayout> layout() const noexcept override;
960
961 // DirectX12PipelineState interface.
962 public:
963 virtual void use(const DirectX12CommandBuffer& commandBuffer) const noexcept override;
964 };
965
970 class LITEFX_DIRECTX12_API DirectX12FrameBuffer : public FrameBuffer<DirectX12CommandBuffer> {
971 LITEFX_IMPLEMENTATION(DirectX12FrameBufferImpl);
972
973 public:
981 DirectX12FrameBuffer(const DirectX12RenderPass& renderPass, const UInt32& bufferIndex, const Size2d& renderArea, const UInt32& commandBuffers = 1);
984 virtual ~DirectX12FrameBuffer() noexcept;
985
986 // DirectX 12 FrameBuffer
987 public:
994 virtual ID3D12DescriptorHeap* renderTargetHeap() const noexcept;
995
1005 virtual ID3D12DescriptorHeap* depthStencilTargetHeap() const noexcept;
1006
1012 virtual const UInt32& renderTargetDescriptorSize() const noexcept;
1013
1019 virtual const UInt32& depthStencilTargetDescriptorSize() const noexcept;
1020
1028 virtual UInt64& lastFence() const noexcept;
1029
1030 // FrameBuffer interface.
1031 public:
1033 virtual const UInt32& bufferIndex() const noexcept override;
1034
1036 virtual const Size2d& size() const noexcept override;
1037
1039 virtual size_t getWidth() const noexcept override;
1040
1042 virtual size_t getHeight() const noexcept override;
1043
1045 virtual Array<const DirectX12CommandBuffer*> commandBuffers() const noexcept override;
1046
1048 virtual const DirectX12CommandBuffer& commandBuffer(const UInt32& index) const override;
1049
1051 virtual Array<const IDirectX12Image*> images() const noexcept override;
1052
1054 virtual const IDirectX12Image& image(const UInt32& location) const override;
1055
1056 public:
1058 virtual void resize(const Size2d& renderArea) override;
1059 };
1060
1066 LITEFX_IMPLEMENTATION(DirectX12RenderPassImpl);
1067 LITEFX_BUILDER(DirectX12RenderPassBuilder);
1068
1069 public:
1078 explicit DirectX12RenderPass(const DirectX12Device& device, Span<RenderTarget> renderTargets, const UInt32& commandBuffers = 1, const MultiSamplingLevel& samples = MultiSamplingLevel::x1, Span<DirectX12InputAttachmentMapping> inputAttachments = { });
1079
1089 explicit DirectX12RenderPass(const DirectX12Device& device, const String& name, Span<RenderTarget> renderTargets, const UInt32& commandBuffers = 1, const MultiSamplingLevel& samples = MultiSamplingLevel::x1, Span<DirectX12InputAttachmentMapping> inputAttachments = { });
1090
1093 virtual ~DirectX12RenderPass() noexcept;
1094
1095 private:
1105 explicit DirectX12RenderPass(const DirectX12Device& device, const String& name = "") noexcept;
1106
1107 // IInputAttachmentMappingSource interface.
1108 public:
1110 virtual const DirectX12FrameBuffer& frameBuffer(const UInt32& buffer) const override;
1111
1112 // RenderPass interface.
1113 public:
1118 virtual const DirectX12Device& device() const noexcept;
1119
1121 virtual const DirectX12FrameBuffer& activeFrameBuffer() const override;
1122
1124 virtual Array<const DirectX12FrameBuffer*> frameBuffers() const noexcept override;
1125
1127 virtual Array<const DirectX12RenderPipeline*> pipelines() const noexcept override;
1128
1130 virtual const RenderTarget& renderTarget(const UInt32& location) const override;
1131
1133 virtual Span<const RenderTarget> renderTargets() const noexcept override;
1134
1136 virtual bool hasPresentTarget() const noexcept override;
1137
1139 virtual Span<const DirectX12InputAttachmentMapping> inputAttachments() const noexcept override;
1140
1142 virtual const MultiSamplingLevel& multiSamplingLevel() const noexcept override;
1143
1144 public:
1146 virtual void begin(const UInt32& buffer) override;
1147
1149 virtual void end() const override;
1150
1152 virtual void resizeFrameBuffers(const Size2d& renderArea) override;
1153
1155 virtual void changeMultiSamplingLevel(const MultiSamplingLevel& samples) override;
1156
1158 virtual void updateAttachments(const DirectX12DescriptorSet& descriptorSet) const override;
1159 };
1160
1167 LITEFX_IMPLEMENTATION(DirectX12InputAttachmentMappingImpl);
1168
1169 public:
1174
1181 DirectX12InputAttachmentMapping(const DirectX12RenderPass& renderPass, const RenderTarget& renderTarget, const UInt32& location);
1182
1187
1192
1194
1195 public:
1199 inline DirectX12InputAttachmentMapping& operator=(const DirectX12InputAttachmentMapping&) noexcept;
1200
1205
1206 public:
1208 virtual const DirectX12RenderPass* inputAttachmentSource() const noexcept override;
1209
1211 virtual const RenderTarget& renderTarget() const noexcept override;
1212
1214 virtual const UInt32& location() const noexcept override;
1215 };
1216
1220 class LITEFX_DIRECTX12_API DirectX12SwapChain : public SwapChain<IDirectX12Image, DirectX12FrameBuffer>, public ComResource<IDXGISwapChain4> {
1221 LITEFX_IMPLEMENTATION(DirectX12SwapChainImpl);
1222
1223 public:
1231 explicit DirectX12SwapChain(const DirectX12Device& device, const Format& surfaceFormat = Format::B8G8R8A8_SRGB, const Size2d& renderArea = { 800, 600 }, const UInt32& buffers = 3);
1234 virtual ~DirectX12SwapChain() noexcept;
1235
1236 // DirectX 12 swap chain.
1237 public:
1242 virtual const bool& supportsVariableRefreshRate() const noexcept;
1243
1244 // SwapChain interface.
1245 public:
1247 virtual const Format& surfaceFormat() const noexcept override;
1248
1250 virtual const UInt32& buffers() const noexcept override;
1251
1253 virtual const Size2d& renderArea() const noexcept override;
1254
1256 virtual Array<const IDirectX12Image*> images() const noexcept override;
1257
1259 virtual void present(const DirectX12FrameBuffer& frameBuffer) const override;
1260
1261 public:
1263 virtual Array<Format> getSurfaceFormats() const noexcept override;
1264
1266 virtual void reset(const Format& surfaceFormat, const Size2d& renderArea, const UInt32& buffers) override;
1267
1269 [[nodiscard]] virtual UInt32 swapBackBuffer() const override;
1270 };
1271
1276 class LITEFX_DIRECTX12_API DirectX12Queue : public CommandQueue<DirectX12CommandBuffer>, public ComResource<ID3D12CommandQueue> {
1277 LITEFX_IMPLEMENTATION(DirectX12QueueImpl);
1278
1279 public:
1286 explicit DirectX12Queue(const DirectX12Device& device, const QueueType& type, const QueuePriority& priority);
1289 virtual ~DirectX12Queue() noexcept;
1290
1291 // DirectX12CommandQueue interface.
1292 public:
1297 virtual const DirectX12Device& device() const noexcept;
1298
1299 // CommandQueue interface.
1300 public:
1302 virtual bool isBound() const noexcept override;
1303
1305 virtual const QueuePriority& priority() const noexcept override;
1306
1308 virtual const QueueType& type() const noexcept override;
1309
1310 public:
1312 virtual void bind() override;
1313
1315 virtual void release() override;
1316
1318 virtual UniquePtr<DirectX12CommandBuffer> createCommandBuffer(const bool& beginRecording = false) const override;
1319
1321 virtual UInt64 submit(const DirectX12CommandBuffer& commandBuffer) const override;
1322
1324 virtual UInt64 submit(const Array<const DirectX12CommandBuffer*>& commandBuffers) const override;
1325
1327 virtual void waitFor(const UInt64& fence) const noexcept override;
1328
1330 virtual UInt64 currentFence() const noexcept override;
1331 };
1332
1340 LITEFX_IMPLEMENTATION(DirectX12GraphicsFactoryImpl);
1341
1342 public:
1347 explicit DirectX12GraphicsFactory(const DirectX12Device& device);
1350 virtual ~DirectX12GraphicsFactory() noexcept;
1351
1352 public:
1354 virtual UniquePtr<IDirectX12Buffer> createBuffer(const BufferType& type, const BufferUsage& usage, const size_t& elementSize, const UInt32& elements = 1, const bool& allowWrite = false) const override;
1355
1357 virtual UniquePtr<IDirectX12Buffer> createBuffer(const String& name, const BufferType& type, const BufferUsage& usage, const size_t& elementSize, const UInt32& elements = 1, const bool& allowWrite = false) const override;
1358
1360 virtual UniquePtr<IDirectX12VertexBuffer> createVertexBuffer(const DirectX12VertexBufferLayout& layout, const BufferUsage& usage, const UInt32& elements = 1) const override;
1361
1363 virtual UniquePtr<IDirectX12VertexBuffer> createVertexBuffer(const String& name, const DirectX12VertexBufferLayout& layout, const BufferUsage& usage, const UInt32& elements = 1) const override;
1364
1366 virtual UniquePtr<IDirectX12IndexBuffer> createIndexBuffer(const DirectX12IndexBufferLayout& layout, const BufferUsage& usage, const UInt32& elements) const override;
1367
1369 virtual UniquePtr<IDirectX12IndexBuffer> createIndexBuffer(const String& name, const DirectX12IndexBufferLayout& layout, const BufferUsage& usage, const UInt32& elements) const override;
1370
1372 virtual UniquePtr<IDirectX12Image> createAttachment(const Format& format, const Size2d& size, const MultiSamplingLevel& samples = MultiSamplingLevel::x1) const override;
1373
1375 virtual UniquePtr<IDirectX12Image> createAttachment(const String& name, const Format& format, const Size2d& size, const MultiSamplingLevel& samples = MultiSamplingLevel::x1) const override;
1376
1378 virtual UniquePtr<IDirectX12Image> 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;
1379
1381 virtual UniquePtr<IDirectX12Image> 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;
1382
1384 virtual Array<UniquePtr<IDirectX12Image>> 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;
1385
1387 virtual UniquePtr<IDirectX12Sampler> 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;
1388
1390 virtual UniquePtr<IDirectX12Sampler> 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;
1391
1393 virtual Array<UniquePtr<IDirectX12Sampler>> 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;
1394 };
1395
1400 LITEFX_IMPLEMENTATION(DirectX12DeviceImpl);
1401
1402 public:
1409 explicit DirectX12Device(const DirectX12Backend& backend, const DirectX12GraphicsAdapter& adapter, UniquePtr<DirectX12Surface>&& surface);
1410
1422 explicit DirectX12Device(const DirectX12Backend& backend, const DirectX12GraphicsAdapter& adapter, UniquePtr<DirectX12Surface>&& surface, const Format& format, const Size2d& frameBufferSize, const UInt32& frameBuffers, const UInt32& globalBufferHeapSize = 524287, const UInt32& globalSamplerHeapSize = 2048);
1423
1426 virtual ~DirectX12Device() noexcept;
1427
1428 // DirectX 12 Device interface.
1429 public:
1434 virtual const DirectX12Backend& backend() const noexcept;
1435
1443 virtual const ID3D12DescriptorHeap* globalBufferHeap() const noexcept;
1444
1450 virtual const ID3D12DescriptorHeap* globalSamplerHeap() const noexcept;
1451
1458 virtual void allocateGlobalDescriptors(const DirectX12DescriptorSet& descriptorSet, UInt32& bufferOffset, UInt32& samplerOffset) const;
1459
1469 virtual void releaseGlobalDescriptors(const DirectX12DescriptorSet& descriptorSet) const noexcept;
1470
1477 virtual void updateBufferDescriptors(const DirectX12DescriptorSet& descriptorSet, const UInt32& firstDescriptor, const UInt32& descriptors) const noexcept;
1478
1485 virtual void updateSamplerDescriptors(const DirectX12DescriptorSet& descriptorSet, const UInt32& firstDescriptor, const UInt32& descriptors) const noexcept;
1486
1497 virtual void bindDescriptorSet(const DirectX12CommandBuffer& commandBuffer, const DirectX12DescriptorSet& descriptorSet, const DirectX12PipelineState& pipeline) const noexcept;
1498
1503 virtual void bindGlobalDescriptorHeaps(const DirectX12CommandBuffer& commandBuffer) const noexcept;
1504
1513 virtual DirectX12ComputePipeline& blitPipeline() const noexcept;
1514
1515 // GraphicsDevice interface.
1516 public:
1518 virtual DeviceState& state() const noexcept override;
1519
1521 virtual const DirectX12SwapChain& swapChain() const noexcept override;
1522
1524 virtual DirectX12SwapChain& swapChain() noexcept override;
1525
1527 virtual const DirectX12Surface& surface() const noexcept override;
1528
1530 virtual const DirectX12GraphicsAdapter& adapter() const noexcept override;
1531
1533 virtual const DirectX12GraphicsFactory& factory() const noexcept override;
1534
1536 virtual const DirectX12Queue& graphicsQueue() const noexcept override;
1537
1539 virtual const DirectX12Queue& transferQueue() const noexcept override;
1540
1542 virtual const DirectX12Queue& bufferQueue() const noexcept override;
1543
1545 virtual const DirectX12Queue& computeQueue() const noexcept override;
1546
1548 virtual UniquePtr<DirectX12Barrier> makeBarrier() const noexcept override;
1549
1552 virtual MultiSamplingLevel maximumMultiSamplingLevel(const Format& format) const noexcept override;
1553
1554 public:
1556 virtual void wait() const override;
1557
1558#if defined(BUILD_DEFINE_BUILDERS)
1559 public:
1561 [[nodiscard]] virtual DirectX12RenderPassBuilder buildRenderPass(const MultiSamplingLevel& samples = MultiSamplingLevel::x1, const UInt32& commandBuffers = 1) const override;
1562
1564 [[nodiscard]] virtual DirectX12RenderPassBuilder buildRenderPass(const String& name, const MultiSamplingLevel& samples = MultiSamplingLevel::x1, const UInt32& commandBuffers = 1) const override;
1565
1567 //[[nodiscard]] virtual DirectX12RenderPipelineBuilder buildRenderPipeline(const String& name) const override;
1568
1570 [[nodiscard]] virtual DirectX12RenderPipelineBuilder buildRenderPipeline(const DirectX12RenderPass& renderPass, const String& name) const override;
1571
1573 [[nodiscard]] virtual DirectX12ComputePipelineBuilder buildComputePipeline(const String& name) const override;
1574
1576 [[nodiscard]] virtual DirectX12PipelineLayoutBuilder buildPipelineLayout() const override;
1577
1579 [[nodiscard]] virtual DirectX12InputAssemblerBuilder buildInputAssembler() const override;
1580
1582 [[nodiscard]] virtual DirectX12RasterizerBuilder buildRasterizer() const override;
1583
1585 [[nodiscard]] virtual DirectX12ShaderProgramBuilder buildShaderProgram() const override;
1586#endif // defined(BUILD_DEFINE_BUILDERS)
1587 };
1588
1592 class LITEFX_DIRECTX12_API DirectX12Backend : public RenderBackend<DirectX12Backend, DirectX12Device>, public ComResource<IDXGIFactory7> {
1593 LITEFX_IMPLEMENTATION(DirectX12BackendImpl);
1594
1595 public:
1596 explicit DirectX12Backend(const App& app, const bool& advancedSoftwareRasterizer = false);
1597 DirectX12Backend(const DirectX12Backend&) noexcept = delete;
1600
1601 // IBackend interface.
1602 public:
1604 virtual BackendType type() const noexcept override;
1605
1607 virtual String name() const noexcept override;
1608
1609 protected:
1611 virtual void activate() override;
1612
1614 virtual void deactivate() override;
1615
1616 // RenderBackend interface.
1617 public:
1619 virtual Array<const DirectX12GraphicsAdapter*> listAdapters() const override;
1620
1622 virtual const DirectX12GraphicsAdapter* findAdapter(const Optional<UInt64>& adapterId = std::nullopt) const override;
1623
1625 virtual void registerDevice(String name, UniquePtr<DirectX12Device>&& device) override;
1626
1628 virtual void releaseDevice(const String& name) override;
1629
1631 virtual DirectX12Device* device(const String& name) noexcept override;
1632
1634 virtual const DirectX12Device* device(const String& name) const noexcept override;
1635
1636 public:
1642 UniquePtr<DirectX12Surface> createSurface(const HWND& hwnd) const;
1643
1652 virtual void enableAdvancedSoftwareRasterizer(const bool& enable = false);
1653 };
1654}
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
Implements the DirectX 12 RenderBackend.
Definition: dx12.hpp:1592
DirectX12Backend(const DirectX12Backend &) noexcept=delete
DirectX12Backend(DirectX12Backend &&) noexcept=delete
Implements a DirectX 12 resource barrier.
Definition: dx12.hpp:154
DirectX12Barrier(const DirectX12Barrier &)=delete
DirectX12Barrier(DirectX12Barrier &&)=delete
Records commands for a DirectX12CommandQueue
Definition: dx12.hpp:789
DirectX12CommandBuffer(DirectX12CommandBuffer &&)=delete
DirectX12CommandBuffer(const DirectX12CommandBuffer &)=delete
Implements a DirectX 12 ComputePipeline.
Definition: dx12.hpp:929
DirectX12ComputePipeline(DirectX12ComputePipeline &&) noexcept=delete
Implements a DirectX 12 IDescriptorLayout
Definition: dx12.hpp:386
DirectX12DescriptorLayout(DirectX12DescriptorLayout &&)=delete
DirectX12DescriptorLayout(const DirectX12DescriptorLayout &)=delete
Implements a DirectX 12 DescriptorSet.
Definition: dx12.hpp:317
DirectX12DescriptorSet(const DirectX12DescriptorSet &)=delete
DirectX12DescriptorSet(DirectX12DescriptorSet &&)=delete
Implements a DirectX 12 DescriptorSetLayout.
Definition: dx12.hpp:438
DirectX12DescriptorSetLayout(const DirectX12DescriptorSetLayout &)=delete
DirectX12DescriptorSetLayout(DirectX12DescriptorSetLayout &&)=delete
Implements a DirectX 12 graphics device.
Definition: dx12.hpp:1399
DirectX12Device(const DirectX12Device &)=delete
DirectX12Device(DirectX12Device &&)=delete
Implements a DirectX 12 frame buffer.
Definition: dx12.hpp:970
DirectX12FrameBuffer(const DirectX12FrameBuffer &) noexcept=delete
DirectX12FrameBuffer(DirectX12FrameBuffer &&) noexcept=delete
Implements a DirectX12 IGraphicsAdapter.
Definition: dx12_api.hpp:203
A graphics factory that produces objects for a DirectX12Device.
Definition: dx12.hpp:1339
DirectX12GraphicsFactory(DirectX12GraphicsFactory &&)=delete
DirectX12GraphicsFactory(const DirectX12GraphicsFactory &)=delete
Implements a DirectX 12 index buffer layout.
Definition: dx12.hpp:55
DirectX12IndexBufferLayout(const DirectX12IndexBufferLayout &)=delete
DirectX12IndexBufferLayout(DirectX12IndexBufferLayout &&)=delete
Implements the DirectX 12 input assembler state.
Definition: dx12.hpp:703
DirectX12InputAssembler(DirectX12InputAssembler &&) noexcept=delete
Implements a IInputAttachmentMapping.
Definition: dx12.hpp:1166
Implements a DirectX 12 PipelineLayout.
Definition: dx12.hpp:655
DirectX12PipelineLayout(DirectX12PipelineLayout &&) noexcept=delete
Defines the base class for DirectX 12 pipeline state objects.
Definition: dx12.hpp:772
Implements the DirectX 12 PushConstantsLayout.
Definition: dx12.hpp:610
DirectX12PushConstantsLayout(DirectX12PushConstantsLayout &&)=delete
DirectX12PushConstantsLayout(const DirectX12PushConstantsLayout &)=delete
Implements the DirectX 12 IPushConstantsRange.
Definition: dx12.hpp:550
DirectX12PushConstantsRange(const DirectX12PushConstantsRange &)=delete
DirectX12PushConstantsRange(DirectX12PushConstantsRange &&)=delete
Implements a DirectX 12 command queue.
Definition: dx12.hpp:1276
DirectX12Queue(DirectX12Queue &&)=delete
DirectX12Queue(const DirectX12Queue &)=delete
Implements a DirectX 12 IRasterizer.
Definition: dx12.hpp:743
DirectX12Rasterizer(DirectX12Rasterizer &&) noexcept=delete
Implements a DirectX 12 render pass.
Definition: dx12.hpp:1065
DirectX12RenderPass(DirectX12RenderPass &&)=delete
DirectX12RenderPass(const DirectX12RenderPass &)=delete
Implements a DirectX 12 RenderPipeline.
Definition: dx12.hpp:859
DirectX12RenderPipeline(DirectX12RenderPipeline &&) noexcept=delete
Implements a DirectX 12 IShaderModule.
Definition: dx12.hpp:220
DirectX12ShaderModule(DirectX12ShaderModule &&) noexcept=delete
DirectX12ShaderModule(const DirectX12ShaderModule &) noexcept=delete
Implements a DirectX 12 ShaderProgram.
Definition: dx12.hpp:263
DirectX12ShaderProgram(DirectX12ShaderProgram &&) noexcept=delete
Implements a DirectX12 ISurface.
Definition: dx12_api.hpp:251
Implements a DirectX 12 swap chain.
Definition: dx12.hpp:1220
DirectX12SwapChain(DirectX12SwapChain &&)=delete
DirectX12SwapChain(const DirectX12SwapChain &)=delete
Implements a DirectX 12 vertex buffer layout.
Definition: dx12.hpp:18
DirectX12VertexBufferLayout(DirectX12VertexBufferLayout &&)=delete
DirectX12VertexBufferLayout(const DirectX12VertexBufferLayout &)=delete
Represents the base interface for a DirectX 12 buffer implementation.
Definition: dx12.hpp:92
virtual ~IDirectX12Buffer() noexcept=default
Represents a DirectX 12 sampled image or the base interface for a texture.
Definition: dx12.hpp:130
virtual ~IDirectX12Image() noexcept=default
Represents a DirectX 12 index buffer.
Definition: dx12.hpp:115
Represents a DirectX 12 sampler.
Definition: dx12.hpp:142
virtual ~IDirectX12Sampler() noexcept=default
Represents a DirectX 12 vertex buffer.
Definition: dx12.hpp:102
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
Resource< ComPtr< THandle > > ComResource
A resource that is hold by a ComPtr.
Definition: dx12_api.hpp:94
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::optional< T > Optional
Represents an optional value.
Definition: containers.hpp:79