3#include <litefx/rendering.hpp>
6#include "dx12_formatters.hpp"
9#pragma warning(disable:4250)
23 LITEFX_BUILDER(DirectX12VertexBufferLayoutBuilder);
66 static inline auto create(
size_t vertexSize,
UInt32 binding = 0) {
98 size_t elementSize() const noexcept override;
101 UInt32 binding() const noexcept override;
162 IndexType indexType() const noexcept override;
167 size_t elementSize() const noexcept override;
170 UInt32 binding() const noexcept override;
212 virtual const D3D12_VERTEX_BUFFER_VIEW& view() const noexcept = 0;
232 virtual const D3D12_INDEX_BUFFER_VIEW& view() const noexcept = 0;
347 UInt64 offset() const noexcept override;
350 UInt64 size() const noexcept override;
358 void addTriangleMesh(const
TriangleMesh& mesh) override;
367 void clear() noexcept override;
370 bool remove(const
TriangleMesh& mesh) noexcept override;
376 Array<D3D12_RAYTRACING_GEOMETRY_DESC> buildInfo() const;
441 UInt64 offset() const noexcept override;
444 UInt64 size() const noexcept override;
452 void addInstance(const
Instance& instance) override;
455 void clear() noexcept override;
458 bool remove(const
Instance& instance) noexcept override;
461 Array<D3D12_RAYTRACING_INSTANCE_DESC> buildInfo() const;
479 LITEFX_BUILDER(DirectX12BarrierBuilder);
483 using base_type::transition;
599 const
String& fileName() const noexcept override;
602 const
String& entryPoint() const noexcept override;
618 LITEFX_BUILDER(DirectX12ShaderProgramBuilder);
678 virtual
SharedPtr<DirectX12PipelineLayout> reflectPipelineLayout() const;
682 return std::static_pointer_cast<IPipelineLayout>(this->reflectPipelineLayout());
698 static void suppressMissingRootSignatureWarning(
bool disableWarning =
true) noexcept;
710 using base_type::update;
761 virtual const ComPtr<ID3D12DescriptorHeap>& bufferHeap() const noexcept;
767 virtual
UInt32 bufferOffset() const noexcept;
773 virtual const ComPtr<ID3D12DescriptorHeap>& samplerHeap() const noexcept;
779 virtual
UInt32 samplerOffset() const noexcept;
836 bool local() const noexcept;
844 UInt32 descriptors() const noexcept override;
852 size_t elementSize() const noexcept override;
855 UInt32 binding() const noexcept override;
868 LITEFX_BUILDER(DirectX12DescriptorSetLayoutBuilder);
874 using base_type::free;
875 using base_type::allocate;
950 virtual UInt32 descriptorOffsetForBinding(
UInt32 binding)
const;
966 virtual
bool isRuntimeArray() const noexcept;
970 const
Array<DirectX12DescriptorLayout>& descriptors() const noexcept override;
973 const DirectX12DescriptorLayout& descriptor(
UInt32 binding) const override;
976 UInt32 space() const noexcept override;
979 ShaderStage shaderStages() const noexcept override;
982 UInt32 uniforms() const noexcept override;
985 UInt32 storages() const noexcept override;
988 UInt32 images() const noexcept override;
991 UInt32 buffers() const noexcept override;
994 UInt32 samplers() const noexcept override;
997 UInt32 staticSamplers() const noexcept override;
1000 UInt32 inputAttachments() const noexcept override;
1015#ifdef __cpp_lib_mdspan
1024 void free(
const DirectX12DescriptorSet& descriptorSet)
const override;
1063 UInt32 space() const noexcept override;
1066 UInt32 binding() const noexcept override;
1069 UInt32 offset() const noexcept override;
1072 UInt32 size() const noexcept override;
1091 LITEFX_BUILDER(DirectX12PushConstantsLayoutBuilder);
1126 UInt32 size() const noexcept override;
1148 LITEFX_BUILDER(DirectX12PipelineLayoutBuilder);
1208 const DirectX12Device& device() const noexcept ;
1211 const DirectX12DescriptorSetLayout& descriptorSet(
UInt32 space) const override;
1214 const
Array<
SharedPtr<const DirectX12DescriptorSetLayout>>& descriptorSets() const override;
1217 const DirectX12PushConstantsLayout* pushConstants() const noexcept override;
1232 Optional<
UInt32> rootParameterIndex(const DirectX12DescriptorSetLayout& layout) const noexcept;
1243 Optional<
UInt32> rootParameterIndex(const DirectX12PushConstantsRange& range) const noexcept;
1252 LITEFX_BUILDER(DirectX12InputAssemblerBuilder);
1312 static inline auto create() {
1321 const DirectX12VertexBufferLayout& vertexBufferLayout(
UInt32 binding)
const override;
1324 const DirectX12IndexBufferLayout* indexBufferLayout() const noexcept override;
1335 LITEFX_BUILDER(DirectX12RasterizerBuilder);
1399 static inline auto create() {
1411 using ComResource<ID3D12PipelineState>::ComResource;
1439 using base_type::dispatch;
1440 using base_type::dispatchIndirect;
1441 using base_type::dispatchMesh;
1442 using base_type::draw;
1443 using base_type::drawIndirect;
1444 using base_type::drawIndexed;
1445 using base_type::drawIndexedIndirect;
1446 using base_type::barrier;
1447 using base_type::transfer;
1448 using base_type::bind;
1449 using base_type::use;
1450 using base_type::pushConstants;
1451 using base_type::buildAccelerationStructure;
1452 using base_type::updateAccelerationStructure;
1453 using base_type::copyAccelerationStructure;
1498 void begin() const override;
1501 void end() const override;
1513 bool isSecondary() const noexcept override;
1516 void setViewports(
Span<const
IViewport*> viewports) const override;
1519 void setViewports(const
IViewport* viewport) const override;
1522 void setScissors(
Span<const
IScissor*> scissors) const override;
1525 void setScissors(const
IScissor* scissor) const override;
1528 void setBlendFactors(const
Vector4f& blendFactors) const noexcept override;
1531 void setStencilRef(
UInt32 stencilRef) const noexcept override;
1534 UInt64 submit() const override;
1546 void transfer(const
void* const data,
size_t size, const
IDirectX12Buffer& target,
UInt32 targetElement = 0,
UInt32 elements = 1) const override;
1549 void transfer(
Span<const
void* const> data,
size_t elementSize, const
IDirectX12Buffer& target,
UInt32 firstElement = 0) const override;
1555 void transfer(const
void* const data,
size_t size, const
IDirectX12Image& target,
UInt32 subresource = 0) const override;
1558 void transfer(
Span<const
void* const> data,
size_t elementSize, const
IDirectX12Image& target,
UInt32 firstSubresource = 0,
UInt32 subresources = 1) const override;
1600 void dispatch(const
Vector3u& threadCount) const noexcept override;
1609 void dispatchMesh(const
Vector3u& threadCount) const noexcept override;
1618 void draw(
UInt32 vertices,
UInt32 instances = 1,
UInt32 firstVertex = 0,
UInt32 firstInstance = 0) const noexcept override;
1627 void drawIndexed(
UInt32 indices,
UInt32 instances = 1,
UInt32 firstIndex = 0,
Int32 vertexOffset = 0,
UInt32 firstInstance = 0) const noexcept override;
1670 return std::static_pointer_cast<const ICommandQueue>(this->queue());
1673 void releaseSharedState()
const override;
1686 using base_type::submit;
1740 QueueType type() const noexcept override;
1742#if defined(LITEFX_BUILD_SUPPORT_DEBUG_MARKERS) && defined(LITEFX_BUILD_WITH_PIX_RUNTIME)
1748 void endDebugRegion() const noexcept override;
1751 void setDebugMarker(const
String& label, const Vectors::ByteVector3& color = DEFAULT_DEBUG_COLOR) const noexcept override;
1765 void waitFor(
UInt64 fence)
const override;
1771 UInt64 currentFence() const noexcept override;
1777 if (d3dQueue ==
nullptr) [[unlikely]]
1780 this->waitFor(*d3dQueue, fence);
1791 LITEFX_BUILDER(DirectX12RenderPipelineBuilder);
1847 bool alphaToCoverage() const noexcept override;
1868 LITEFX_BUILDER(DirectX12ComputePipelineBuilder);
1929 LITEFX_BUILDER(DirectX12RayTracingPipelineBuilder);
1982 UInt32 maxRecursionDepth() const noexcept override;
1985 UInt32 maxPayloadSize() const noexcept override;
1988 UInt32 maxAttributeSize() const noexcept override;
2002 ComPtr<ID3D12StateObject> stateObject() const noexcept;
2014 using FrameBuffer::addImage;
2015 using FrameBuffer::mapRenderTarget;
2016 using FrameBuffer::mapRenderTargets;
2064 D3D12_CPU_DESCRIPTOR_HANDLE descriptorHandle(
UInt32 imageIndex)
const;
2072 D3D12_CPU_DESCRIPTOR_HANDLE descriptorHandle(
StringView imageName)
const;
2080 D3D12_CPU_DESCRIPTOR_HANDLE descriptorHandle(
const RenderTarget& renderTarget)
const;
2085 const Size2d& size() const noexcept override;
2088 size_t getWidth() const noexcept override;
2091 size_t getHeight() const noexcept override;
2100 void unmapRenderTarget(const
RenderTarget& renderTarget) noexcept override;
2107 return this->image(index);
2115 return this->image(renderTarget);
2123 return this->resolveImage(hash(renderTargetName));
2128 return this->resolveImage(hash(renderTargetName));
2141 void resize(
const Size2d& renderArea)
override;
2150 LITEFX_BUILDER(DirectX12RenderPassBuilder);
2207 DirectX12RenderPass(DirectX12RenderPass&&) noexcept = delete;
2210 DirectX12RenderPass(const DirectX12RenderPass&) = delete;
2213 DirectX12RenderPass& operator=(DirectX12RenderPass&&) noexcept = delete;
2216 DirectX12RenderPass& operator=(const DirectX12RenderPass&) = delete;
2289 explicit DirectX12RenderPass(
const DirectX12Device& device,
const String& name =
"");
2311 const DirectX12Device& device() const noexcept ;
2314 SharedPtr<const DirectX12FrameBuffer> activeFrameBuffer() const noexcept override;
2317 const DirectX12Queue& commandQueue() const noexcept override;
2323 SharedPtr<const DirectX12CommandBuffer> commandBuffer(
UInt32 index) const override;
2326 UInt32 secondaryCommandBuffers() const noexcept override;
2335 bool hasPresentTarget() const noexcept override;
2347 void begin(const DirectX12FrameBuffer& frameBuffer) const override;
2350 UInt64 end() const override;
2399 virtual
bool supportsVariableRefreshRate() const noexcept;
2405 virtual ID3D12QueryHeap* timestampQueryHeap() const noexcept;
2425 Format surfaceFormat() const noexcept override;
2428 UInt32 buffers() const noexcept override;
2431 const
Size2d& renderArea() const noexcept override;
2434 bool verticalSynchronization() const noexcept override;
2446 void present(
UInt64 fence) const override;
2456 void reset(
Format surfaceFormat, const
Size2d& renderArea,
UInt32 buffers,
bool enableVsync = false) override;
2459 [[nodiscard]]
UInt32 swapBackBuffer() const override;
2478 using base_type::createBuffer;
2479 using base_type::createVertexBuffer;
2480 using base_type::createIndexBuffer;
2481 using base_type::createTexture;
2482 using base_type::createTextures;
2483 using base_type::createSampler;
2484 using base_type::createSamplers;
2551 SharedPtr<IDirectX12Sampler> createSampler(
const String& name,
FilterMode magFilter = FilterMode::Nearest,
FilterMode minFilter = FilterMode::Nearest,
BorderMode borderU = BorderMode::Repeat,
BorderMode borderV = BorderMode::Repeat,
BorderMode borderW = BorderMode::Repeat,
MipMapMode mipMapMode = MipMapMode::Nearest,
Float mipMapBias = 0.f,
Float maxLod = std::numeric_limits<Float>::max(),
Float minLod = 0.f,
Float anisotropy = 0.f)
const override;
2566 class LITEFX_DIRECTX12_API
DirectX12Device final :
public GraphicsDevice<DirectX12GraphicsFactory, DirectX12Surface, DirectX12GraphicsAdapter, DirectX12SwapChain, DirectX12Queue, DirectX12RenderPass, DirectX12RenderPipeline, DirectX12ComputePipeline, DirectX12RayTracingPipeline, DirectX12Barrier>,
public ComResource<ID3D12Device10> {
2647 void release() noexcept;
2658 const ID3D12DescriptorHeap* globalBufferHeap() const noexcept;
2665 const ID3D12DescriptorHeap* globalSamplerHeap() const noexcept;
2673 void allocateGlobalDescriptors(const DirectX12DescriptorSet& descriptorSet,
UInt32& bufferOffset,
UInt32& samplerOffset) const;
2684 void releaseGlobalDescriptors(const DirectX12DescriptorSet& descriptorSet) const;
2692 void updateBufferDescriptors(const DirectX12DescriptorSet& descriptorSet,
UInt32 firstDescriptor,
UInt32 descriptors) const noexcept;
2700 void updateSamplerDescriptors(const DirectX12DescriptorSet& descriptorSet,
UInt32 firstDescriptor,
UInt32 descriptors) const noexcept;
2712 void bindDescriptorSet(const DirectX12CommandBuffer& commandBuffer, const DirectX12DescriptorSet& descriptorSet, const DirectX12PipelineState& pipeline) const noexcept;
2718 void bindGlobalDescriptorHeaps(const DirectX12CommandBuffer& commandBuffer) const noexcept;
2727 void indirectDrawSignatures(ComPtr<ID3D12CommandSignature>& dispatchSignature, ComPtr<ID3D12CommandSignature>& dispatchMeshSignature, ComPtr<ID3D12CommandSignature>& drawSignature, ComPtr<ID3D12CommandSignature>& drawIndexedSignature) const noexcept;
2735 const DirectX12SwapChain& swapChain() const noexcept override;
2738 DirectX12SwapChain& swapChain() noexcept override;
2741 const DirectX12Surface& surface() const noexcept override;
2744 const DirectX12GraphicsAdapter& adapter() const noexcept override;
2747 const DirectX12GraphicsFactory& factory() const noexcept override;
2750 const DirectX12Queue& defaultQueue(
QueueType type) const override;
2759 [[nodiscard]]
SharedPtr<DirectX12FrameBuffer> makeFrameBuffer(
StringView name, const
Size2d& renderArea) const override;
2766 double ticksPerMillisecond() const noexcept override;
2769 void wait() const override;
2772 void computeAccelerationStructureSizes(const DirectX12BottomLevelAccelerationStructure& blas,
UInt64& bufferSize,
UInt64& scratchSize,
bool forUpdate = false) const override;
2775 void computeAccelerationStructureSizes(const DirectX12TopLevelAccelerationStructure& tlas,
UInt64& bufferSize,
UInt64& scratchSize,
bool forUpdate = false) const override;
2777#if defined(LITEFX_BUILD_DEFINE_BUILDERS)
2780 [[nodiscard]] DirectX12RenderPassBuilder buildRenderPass(
UInt32 commandBuffers = 1)
const override;
2783 [[nodiscard]] DirectX12RenderPassBuilder buildRenderPass(
const String& name,
UInt32 commandBuffers = 1)
const override;
2789 [[nodiscard]] DirectX12RenderPipelineBuilder buildRenderPipeline(
const DirectX12RenderPass& renderPass,
const String& name)
const override;
2792 [[nodiscard]] DirectX12ComputePipelineBuilder buildComputePipeline(
const String& name)
const override;
2795 [[nodiscard]] DirectX12RayTracingPipelineBuilder buildRayTracingPipeline(
ShaderRecordCollection&& shaderRecords)
const override;
2798 [[nodiscard]] DirectX12RayTracingPipelineBuilder buildRayTracingPipeline(
const String& name,
ShaderRecordCollection&& shaderRecords)
const override;
2801 [[nodiscard]] DirectX12PipelineLayoutBuilder buildPipelineLayout()
const override;
2804 [[nodiscard]] DirectX12InputAssemblerBuilder buildInputAssembler()
const override;
2807 [[nodiscard]] DirectX12RasterizerBuilder buildRasterizer()
const override;
2810 [[nodiscard]] DirectX12ShaderProgramBuilder buildShaderProgram()
const override;
2813 [[nodiscard]] DirectX12BarrierBuilder buildBarrier()
const override;
2851 void activate() override;
2854 void deactivate() override;
2868 void releaseDevice(const
String& name) override;
2892 virtual
void enableAdvancedSoftwareRasterizer(
bool enable = false);
Definition barrier.cpp:14
Definition command_buffer.cpp:9
Definition compute_pipeline.cpp:10
Definition descriptor_layout.cpp:10
Definition descriptor_set.cpp:9
Definition descriptor_set_layout.cpp:11
Definition frame_buffer.cpp:9
Definition factory.cpp:11
Definition index_buffer_layout.cpp:9
Definition pipeline_layout.cpp:10
Definition push_constants_layout.cpp:10
Definition push_constants_range.cpp:9
Definition ray_tracing_pipeline.cpp:36
Definition render_pass.cpp:16
Definition render_pipeline.cpp:10
Definition shader_module.cpp:9
Definition shader_program.cpp:33
Definition swapchain.cpp:10
Definition vertex_buffer_layout.cpp:10
The base class for an application.
Definition app.hpp:402
Provides access to a resource managed by the class.
Definition containers.hpp:792
An exception that is thrown, if a provided argument is not valid.
Definition exceptions.hpp:60
Implements the DirectX 12 RenderBackend.
Definition dx12.hpp:2820
DirectX12Backend(DirectX12Backend &&) noexcept
Implements a DirectX 12 resource barrier.
Definition dx12.hpp:477
DirectX12Barrier(DirectX12Barrier &&) noexcept
Implements a DirectX 12 bottom-level acceleration structure (BLAS).
Definition dx12.hpp:295
DirectX12BottomLevelAccelerationStructure(DirectX12BottomLevelAccelerationStructure &&) noexcept
Records commands for a DirectX12Queue
Definition dx12.hpp:1433
Implements a DirectX 12 ComputePipeline.
Definition dx12.hpp:1866
DirectX12ComputePipeline(DirectX12ComputePipeline &&) noexcept
Implements a DirectX 12 IDescriptorLayout
Definition dx12.hpp:790
DirectX12DescriptorLayout(DirectX12DescriptorLayout &&) noexcept
Implements a DirectX 12 DescriptorSet.
Definition dx12.hpp:705
DirectX12DescriptorSet(DirectX12DescriptorSet &&) noexcept=delete
Implements a DirectX 12 DescriptorSetLayout.
Definition dx12.hpp:866
static auto create(const DirectX12DescriptorSetLayout &other)
Creates a copy of a DirectX 12 descriptor set layout.
Definition dx12.hpp:928
Implements a DirectX 12 graphics device.
Definition dx12.hpp:2566
static SharedPtr< DirectX12Device > create(const DirectX12Backend &backend, const DirectX12GraphicsAdapter &adapter, UniquePtr< DirectX12Surface > &&surface, Format format, const Size2d &renderArea, UInt32 backBuffers, bool enableVsync=false, GraphicsDeviceFeatures features={}, UInt32 globalBufferHeapSize=D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_1, UInt32 globalSamplerHeapSize=D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE)
Initializes the device instance.
Definition dx12.hpp:2627
Implements a DirectX 12 frame buffer.
Definition dx12.hpp:2009
const IDirectX12Image & image(StringView renderTargetName) const override
Resolves a render target name and returns the image mapped to it.The image mapped to the render targe...
Definition dx12.hpp:2127
const IDirectX12Image & operator[](const RenderTarget &renderTarget) const override
Resolves a render target and returns the image mapped to it.The image mapped to the render target.
Definition dx12.hpp:2114
const IDirectX12Image & operator[](StringView renderTargetName) const override
Resolves a render target name and returns the image mapped to it.The image mapped to the render targe...
Definition dx12.hpp:2122
Implements a DirectX12 IGraphicsAdapter.
Definition dx12_api.hpp:224
A graphics factory that produces objects for a DirectX12Device.
Definition dx12.hpp:2471
Implements a DirectX12 IImage.
Definition image.h:16
Implements a DirectX 12 index buffer layout.
Definition dx12.hpp:112
static auto create(const DirectX12IndexBufferLayout &other)
Creates a copy of an index buffer layout.
Definition dx12.hpp:155
Implements a DirectX 12 PipelineLayout.
Definition dx12.hpp:1146
Defines the base class for DirectX 12 pipeline state objects.
Definition dx12.hpp:1409
DirectX12PipelineState(DirectX12PipelineState &&) noexcept=default
Implements the DirectX 12 PushConstantsLayout.
Definition dx12.hpp:1089
DirectX12PushConstantsLayout(DirectX12PushConstantsLayout &&) noexcept
Implements the DirectX 12 IPushConstantsRange.
Definition dx12.hpp:1031
DirectX12PushConstantsRange(DirectX12PushConstantsRange &&) noexcept
Implements a DirectX 12 command queue.
Definition dx12.hpp:1680
Implements a DirectX 12 IRasterizer.
Definition dx12.hpp:1334
static auto create(const DirectX12Rasterizer &other)
Creates a new DirectX 12 rasterizer state by copying an existing one.
Definition dx12.hpp:1390
Implements a DirectX 12 RayTracingPipeline.
Definition dx12.hpp:1927
DirectX12RayTracingPipeline(DirectX12RayTracingPipeline &&) noexcept
Implements a DirectX 12 render pass.
Definition dx12.hpp:2148
static SharedPtr< DirectX12RenderPass > create(const DirectX12Device &device, const String &name, Span< RenderTarget > renderTargets, Span< RenderPassDependency > inputAttachments={ }, Optional< DescriptorBindingPoint > inputAttachmentSamplerBinding=std::nullopt, UInt32 secondaryCommandBuffers=1u)
Creates and initializes a new DirectX 12 render pass instance that executes on the default graphics q...
Definition dx12.hpp:2248
static SharedPtr< DirectX12RenderPass > create(const DirectX12Device &device, const DirectX12Queue &queue, Span< RenderTarget > renderTargets, Span< RenderPassDependency > inputAttachments={ }, Optional< DescriptorBindingPoint > inputAttachmentSamplerBinding=std::nullopt, UInt32 secondaryCommandBuffers=1u)
Creates and initializes a new DirectX 12 render pass instance.
Definition dx12.hpp:2263
static SharedPtr< DirectX12RenderPass > create(const DirectX12Device &device, const String &name, const DirectX12Queue &queue, Span< RenderTarget > renderTargets, Span< RenderPassDependency > inputAttachments={ }, Optional< DescriptorBindingPoint > inputAttachmentSamplerBinding=std::nullopt, UInt32 secondaryCommandBuffers=1u)
Creates and initializes a new DirectX 12 render pass instance.
Definition dx12.hpp:2279
Implements a DirectX 12 RenderPipeline.
Definition dx12.hpp:1789
DirectX12RenderPipeline(DirectX12RenderPipeline &&) noexcept=delete
Implements a DirectX 12 IShaderModule.
Definition dx12.hpp:556
DirectX12ShaderModule(DirectX12ShaderModule &&) noexcept
Implements a DirectX 12 ShaderProgram.
Definition dx12.hpp:616
Implements a DirectX12 ISurface.
Definition dx12_api.hpp:290
Implements a DirectX 12 swap chain.
Definition dx12.hpp:2356
DirectX12SwapChain(DirectX12SwapChain &&) noexcept=delete
Implements a DirectX 12 top-level acceleration structure (TLAS).
Definition dx12.hpp:389
DirectX12TopLevelAccelerationStructure(DirectX12TopLevelAccelerationStructure &&) noexcept
Implements a DirectX 12 vertex buffer layout.
Definition dx12.hpp:21
static auto create(const DirectX12VertexBufferLayout &other)
Creates a copy of a vertex buffer layout.
Definition dx12.hpp:86
static auto create(size_t vertexSize, const Enumerable< BufferAttribute > &attributes, UInt32 binding=0)
Creates a new vertex buffer layout.
Definition dx12.hpp:77
Represents the base interface for a DirectX 12 acceleration structure implementation.
Definition dx12.hpp:279
IDirectX12AccelerationStructure() noexcept=default
Represents the base interface for a DirectX 12 buffer implementation.
Definition dx12.hpp:183
IDirectX12Buffer() noexcept=default
Represents a DirectX 12 sampled image or the base interface for a texture.
Definition dx12.hpp:242
IDirectX12Image() noexcept=default
Represents a DirectX 12 index buffer.
Definition dx12.hpp:220
IDirectX12IndexBuffer() noexcept=default
Represents a DirectX 12 sampler.
Definition dx12.hpp:261
IDirectX12Sampler() noexcept=default
Represents a DirectX 12 vertex buffer.
Definition dx12.hpp:200
IDirectX12VertexBuffer() noexcept=default
A barrier used for GPU resource synchronization.
Definition rendering.hpp:17
Represents a command buffer, that buffers commands that should be submitted to a CommandQueue.
Definition rendering.hpp:597
Represents a command queue.
Definition rendering.hpp:1090
Represents a compute Pipeline.
Definition rendering.hpp:1001
Stores the depth/stencil state of a see IRasterizer.
Definition rendering_api.hpp:3143
Defines a set of descriptors.
Definition rendering.hpp:150
Describes the layout of a descriptor set.
Definition rendering.hpp:215
A class that can be used to manage the state of a IGraphicsDevice.
Definition rendering_api.hpp:2312
Stores the images used by a RenderPass to either read from using input attachments or write to using ...
Definition rendering.hpp:1057
Represents the graphics device that a rendering back-end is doing work on.
Definition rendering.hpp:1431
Describes a factory that creates objects for a GraphicsDevice.
Definition rendering.hpp:1254
Base interface for a ray tracing acceleration structure.
Definition rendering_api.hpp:4449
void update(const ICommandBuffer &commandBuffer, const SharedPtr< const IBuffer > &scratchBuffer=nullptr, const SharedPtr< const IBuffer > &buffer=nullptr, UInt64 offset=0, UInt64 maxSize=0)
Performs an update on the acceleration structure.
Definition rendering_api.hpp:4530
void build(const ICommandBuffer &commandBuffer, const SharedPtr< const IBuffer > &scratchBuffer=nullptr, const SharedPtr< const IBuffer > &buffer=nullptr, UInt64 offset=0, UInt64 maxSize=0)
Performs a complete build of the acceleration structure.
Definition rendering_api.hpp:4494
A structure that holds a singular entity of geometry for hardware ray-tracing.
Definition rendering_api.hpp:4588
void copy(const ICommandBuffer &commandBuffer, IBottomLevelAccelerationStructure &destination, bool compress=false, const SharedPtr< const IBuffer > &buffer=nullptr, UInt64 offset=0, bool copyBuildInfo=true) const
Copies the acceleration structure into the acceleration structure provided by destination .
Definition rendering_api.hpp:4807
Base interface for buffer objects.
Definition rendering_api.hpp:4186
The interface for a command buffer.
Definition rendering_api.hpp:6517
The interface for a command queue.
Definition rendering_api.hpp:8481
Describes a the layout of a single descriptor within a DescriptorSet.
Definition rendering_api.hpp:3993
The interface for a graphics device that.
Definition rendering_api.hpp:9164
Describes a generic image.
Definition rendering_api.hpp:4208
Describes a index buffer layout.
Definition rendering_api.hpp:3952
The interface for a pipeline layout.
Definition rendering_api.hpp:6385
Describes a range within a IPushConstantsLayout.
Definition rendering_api.hpp:5645
Describes a texture sampler.
Definition rendering_api.hpp:4324
The interface of a scissor.
Definition rendering_api.hpp:3562
Represents a single shader module, i.e. a part of a IShaderProgram.
Definition rendering_api.hpp:2755
A structure that stores the instance data for a IBottomLevelAccelerationStructure.
Definition rendering_api.hpp:4870
void copy(const ICommandBuffer &commandBuffer, ITopLevelAccelerationStructure &destination, bool compress=false, const SharedPtr< const IBuffer > &buffer=nullptr, UInt64 offset=0, bool copyBuildInfo=true) const
Copies the acceleration structure into the acceleration structure provided by destination .
Definition rendering_api.hpp:5016
Describes a vertex buffer layout.
Definition rendering_api.hpp:3929
Interface for a viewport.
Definition rendering_api.hpp:3444
Describes an index buffer.
Definition rendering.hpp:479
Represents a pipeline state.
Definition rendering.hpp:547
Represents a the layout of a RenderPipeline, ComputePipeline or RayTracingPipeline.
Definition rendering.hpp:418
Describes the layout of the pipelines push constant ranges.
Definition rendering.hpp:355
Implements a IRasterizer.
Definition rendering_api.hpp:3371
Represents a ray-tracing Pipeline.
Definition rendering.hpp:1020
Defines a back-end, that provides a device instance for a certain surface and graphics adapter.
Definition rendering.hpp:1642
Represents a mapping between a set of RenderTarget instances and the input attachments of a IRenderPa...
Definition rendering_api.hpp:3076
Represents a render pass.
Definition rendering.hpp:1150
Represents a graphics Pipeline.
Definition rendering.hpp:962
Implements a render target.
Definition rendering_api.hpp:2976
Represents a shader program, consisting of multiple IShaderModules.
Definition rendering.hpp:386
Stores a set of IShaderRecords in that later form a shader binding table used for ray-tracing.
Definition rendering_api.hpp:6007
Base class for a resource that can be identified by a name string within a DeviceState.
Definition rendering_api.hpp:2265
Represents a swap chain, i.e. a chain of multiple IImage instances, that can be presented to a ISurfa...
Definition rendering.hpp:1210
An event that is used to measure timestamps in a command queue.
Definition rendering_api.hpp:3726
Describes a vertex buffer.
Definition rendering.hpp:455
Implements the IResource interface.
Definition containers.hpp:823
static auto create(TArgs &&... args) -> SharedPtr< T >
Generic factory method used to create instances of the shared object.
Definition containers.hpp:1114
Concept that can be used to refer to backend implementations.
Definition app.hpp:80
uint64_t UInt64
A type for an unsigned 64 bit integer.
Definition math.hpp:66
float_t Float
A type for a floating point value with single precision.
Definition math.hpp:71
uint32_t UInt32
A type for an unsigned 32 bit integer.
Definition math.hpp:56
int32_t Int32
A type for a signed 32 bit integer.
Definition math.hpp:51
BorderMode
Describes how to treat texture coordinates that are outside the domain [0..1].
Definition rendering_api.hpp:1184
CullOrder
Describes the order or vertex winding, that is used to determine, whether a polygon is facing towards...
Definition rendering_api.hpp:1018
ImageLayout
Specifies the layout of an IImage resource.
Definition rendering_api.hpp:1686
MipMapMode
Describes the filter operation between two mip-map levels.
Definition rendering_api.hpp:1169
CullMode
Describes which faces are culled by the Rasterizer stage.
Definition rendering_api.hpp:991
ShaderStage
Describes the valid shader stages of a graphics pipeline.
Definition rendering_api.hpp:799
IndexType
Describes the element type of an index buffer.
Definition rendering_api.hpp:750
PrimitiveTopology
Describes the topology of a mesh primitive.
Definition rendering_api.hpp:765
@ TriangleList
A list of triangles, where each triplet of vertices refers to a whole triangle.
ShaderBindingGroup
Describes a group or combination of groups of a shader binding table.
Definition rendering_api.hpp:939
@ All
Refers to a combination of all possible groups that can be stored in a shader binding table.
PolygonMode
Describes the draw mode for polygons.
Definition rendering_api.hpp:970
BufferType
Describes the type of a IBuffer.
Definition rendering_api.hpp:540
ResourceUsage
Describes the intended usage for a resource.
Definition rendering_api.hpp:690
ImageDimensions
Describes the dimensions of a image resource, i.e. the dimensions that are required to access a texel...
Definition rendering_api.hpp:1086
DescriptorType
Describes the type of a IDescriptor.
Definition rendering_api.hpp:436
QueuePriority
Specifies the priority with which a queue is scheduled on the GPU.
Definition rendering_api.hpp:159
QueueType
Represents the type of a CommandQueue.
Definition rendering_api.hpp:113
ResourceHeap
Defines where a resource (buffer or image) memory is located and from where it can be accessed.
Definition rendering_api.hpp:649
AccelerationStructureFlags
Controls how an acceleration structure should be built.
Definition rendering_api.hpp:1816
FilterMode
Describes the filter operation when accessing a pixel from a texture coordinate.
Definition rendering_api.hpp:1152
PipelineStage
Defines pipeline stages as points where synchronization may occur.
Definition rendering_api.hpp:1373
ResourceAccess
Defines how a IBuffer or IImage resource is accessed.
Definition rendering_api.hpp:1537
Format
Describes a texel format.
Definition rendering_api.hpp:182
MultiSamplingLevel
Describes the number of samples with which a IImage is sampled.
Definition rendering_api.hpp:1111
std::generator< T, TVal > Generator
Describes an intermediate container for elements of type T .
Definition containers.hpp:206
std::vector< T > Array
Represents a dynamic array.
Definition containers.hpp:73
std::optional< T > Optional
Represents an optional value.
Definition containers.hpp:94
std::shared_ptr< T > SharedPtr
Represents a shared pointer, that expresses non-exclusive ownership.
Definition containers.hpp:109
std::unique_ptr< T, TDeleter > UniquePtr
Represents a unique pointer, that expresses exclusive ownership.
Definition containers.hpp:102
std::string String
Definition string.hpp:24
std::string_view StringView
Definition string.hpp:26
BackendType
Definition app_api.hpp:35
std::span< T > Span
Represents a view of an array.
Definition containers.hpp:87
An input range over another range, where the returned values of type T are covariants of the values ...
Definition containers.hpp:529
An algebraic vector type.
Definition vector.hpp:23
Describes a resource binding to a descriptor or descriptor set.
Definition rendering_api.hpp:5334
Describes a single descriptor binding point within a IShaderModule.
Definition rendering_api.hpp:2735
Describes optional features that can be supported by a device.
Definition rendering_api.hpp:9138
Stores a buffer that contains axis-aligned bounding boxes.
Definition rendering_api.hpp:4670
Represents a triangle mesh.
Definition rendering_api.hpp:4593
Represents an instance of an IBottomLevelAccelerationStructure.
Definition rendering_api.hpp:4877
Describes the offsets and sizes of a shader group within a shader binding table buffer.
Definition rendering_api.hpp:3646
An allocator used to allocate the shared object.
Definition containers.hpp:1098