3#include <litefx/rendering.hpp>
6#include "dx12_formatters.hpp"
9#pragma warning(disable:4250)
23 LITEFX_BUILDER(DirectX12VertexBufferLayoutBuilder);
46 DirectX12VertexBufferLayout(DirectX12VertexBufferLayout&&) noexcept = delete;
49 DirectX12VertexBufferLayout(const DirectX12VertexBufferLayout&);
52 DirectX12VertexBufferLayout& operator=(DirectX12VertexBufferLayout&&) noexcept = delete;
55 DirectX12VertexBufferLayout& operator=(const DirectX12VertexBufferLayout&) = delete;
59 ~DirectX12VertexBufferLayout() noexcept override;
90 static inline auto create(
const DirectX12VertexBufferLayout& other) {
105 size_t elementSize() const noexcept override;
108 UInt32 binding() const noexcept override;
132 DirectX12IndexBufferLayout(DirectX12IndexBufferLayout&&) noexcept = delete;
135 DirectX12IndexBufferLayout(const DirectX12IndexBufferLayout&);
138 DirectX12IndexBufferLayout& operator=(DirectX12IndexBufferLayout&&) noexcept = delete;
141 DirectX12IndexBufferLayout& operator=(const DirectX12IndexBufferLayout&) = delete;
145 ~DirectX12IndexBufferLayout() noexcept override;
162 static inline auto create(
const DirectX12IndexBufferLayout& other) {
169 IndexType indexType() const noexcept override;
174 size_t elementSize() const noexcept override;
177 UInt32 binding() const noexcept override;
219 virtual const D3D12_VERTEX_BUFFER_VIEW&
view() const noexcept = 0;
239 virtual const D3D12_INDEX_BUFFER_VIEW&
view() const noexcept = 0;
374 void clear() noexcept override;
383 Array<D3D12_RAYTRACING_GEOMETRY_DESC> buildInfo() const;
462 void clear() noexcept override;
468 Array<D3D12_RAYTRACING_INSTANCE_DESC> buildInfo() const;
486 LITEFX_BUILDER(DirectX12BarrierBuilder);
625 LITEFX_BUILDER(DirectX12ShaderProgramBuilder);
640 explicit DirectX12ShaderProgram(
const DirectX12Device& device)
noexcept;
644 DirectX12ShaderProgram(DirectX12ShaderProgram&&) noexcept = delete;
647 DirectX12ShaderProgram(const DirectX12ShaderProgram&) = delete;
650 DirectX12ShaderProgram& operator=(DirectX12ShaderProgram&&) noexcept = delete;
653 DirectX12ShaderProgram& operator=(const DirectX12ShaderProgram&) = delete;
657 ~DirectX12ShaderProgram() noexcept override;
689 return std::static_pointer_cast<IPipelineLayout>(this->reflectPipelineLayout(hints));
824 bool local() const noexcept;
835 bool unbounded() const noexcept override;
859 LITEFX_BUILDER(DirectX12DescriptorSetLayoutBuilder);
886 DirectX12DescriptorSetLayout(DirectX12DescriptorSetLayout&&) noexcept = delete;
889 DirectX12DescriptorSetLayout(const DirectX12DescriptorSetLayout& other);
892 DirectX12DescriptorSetLayout& operator=(DirectX12DescriptorSetLayout&&) noexcept = delete;
895 DirectX12DescriptorSetLayout& operator=(const DirectX12DescriptorSetLayout&) = delete;
899 ~DirectX12DescriptorSetLayout() noexcept override;
919 static inline auto create(
const DirectX12DescriptorSetLayout& other) {
942 const
Array<DirectX12DescriptorLayout>& descriptors() const noexcept override;
945 const DirectX12DescriptorLayout& descriptor(
UInt32 binding) const override;
948 UInt32 space() const noexcept override;
951 ShaderStage shaderStages() const noexcept override;
954 UInt32 uniforms() const noexcept override;
957 UInt32 storages() const noexcept override;
960 UInt32 images() const noexcept override;
963 UInt32 buffers() const noexcept override;
966 UInt32 samplers() const noexcept override;
969 UInt32 staticSamplers() const noexcept override;
972 UInt32 inputAttachments() const noexcept override;
975 bool containsUnboundedArray() const noexcept override;
981 bool bindsResources() const noexcept override;
984 bool bindsSamplers() const noexcept override;
999#ifdef __cpp_lib_mdspan
1008 void free(
const DirectX12DescriptorSet& descriptorSet)
const override;
1075 LITEFX_BUILDER(DirectX12PushConstantsLayoutBuilder);
1132 LITEFX_BUILDER(DirectX12PipelineLayoutBuilder);
1152 DirectX12PipelineLayout(DirectX12PipelineLayout&&) noexcept = delete;
1155 DirectX12PipelineLayout(const DirectX12PipelineLayout&) = delete;
1158 DirectX12PipelineLayout& operator=(DirectX12PipelineLayout&&) noexcept = delete;
1161 DirectX12PipelineLayout& operator=(const DirectX12PipelineLayout&) = delete;
1165 ~DirectX12PipelineLayout() noexcept override;
1192 const DirectX12Device& device() const noexcept ;
1195 const DirectX12DescriptorSetLayout& descriptorSet(
UInt32 space) const override;
1198 const
Array<
SharedPtr<const DirectX12DescriptorSetLayout>>& descriptorSets() const override;
1201 const DirectX12PushConstantsLayout* pushConstants() const noexcept override;
1204 bool dynamicResourceHeapAccess() const override;
1207 bool dynamicSamplerHeapAccess() const override;
1241 Optional<
UInt32> rootParameterIndex(const DirectX12PushConstantsRange& range) const noexcept;
1250 LITEFX_BUILDER(DirectX12InputAssemblerBuilder);
1265 explicit DirectX12InputAssembler();
1269 DirectX12InputAssembler(DirectX12InputAssembler&&) noexcept;
1272 DirectX12InputAssembler(const DirectX12InputAssembler&);
1275 DirectX12InputAssembler& operator=(DirectX12InputAssembler&&) noexcept;
1278 DirectX12InputAssembler& operator=(const DirectX12InputAssembler&) = delete;
1282 ~DirectX12InputAssembler() noexcept override;
1301 static inline auto create(
const DirectX12InputAssembler& other) {
1310 static inline auto create() {
1319 const DirectX12VertexBufferLayout& vertexBufferLayout(
UInt32 binding)
const override;
1322 const DirectX12IndexBufferLayout* indexBufferLayout() const noexcept override;
1332 class LITEFX_DIRECTX12_API DirectX12Rasterizer final : public
Rasterizer {
1333 LITEFX_BUILDER(DirectX12RasterizerBuilder);
1369 ~DirectX12Rasterizer() noexcept override = default;
1392 static inline auto create(
const DirectX12Rasterizer& other) {
1401 static inline auto create() {
1440 using base_type = CommandBuffer<DirectX12CommandBuffer, IDirectX12Buffer, IDirectX12VertexBuffer, IDirectX12IndexBuffer, IDirectX12Image, DirectX12Barrier, DirectX12PipelineState, DirectX12BottomLevelAccelerationStructure, DirectX12TopLevelAccelerationStructure>;
1468 DirectX12CommandBuffer(DirectX12CommandBuffer&&) noexcept = delete;
1471 DirectX12CommandBuffer(const DirectX12CommandBuffer&) = delete;
1474 DirectX12CommandBuffer& operator=(DirectX12CommandBuffer&&) noexcept = delete;
1477 DirectX12CommandBuffer& operator=(const DirectX12CommandBuffer&) = delete;
1481 ~DirectX12CommandBuffer() noexcept override;
1500 void begin() const override;
1503 void end() const override;
1518 bool isSecondary() const noexcept override;
1521 void setViewports(
Span<const
IViewport*> viewports) const override;
1524 void setViewports(const
IViewport* viewport) const override;
1527 void setScissors(
Span<const
IScissor*> scissors) const override;
1530 void setScissors(const
IScissor* scissor) const override;
1533 void setBlendFactors(const
Vector4f& blendFactors) const noexcept override;
1536 void setStencilRef(
UInt32 stencilRef) const noexcept override;
1539 void setDepthBounds(
Float minBounds,
Float maxBounds) const noexcept override;
1542 UInt64 submit() const override;
1554 void transfer(const
void* const data,
size_t size, const
IDirectX12Buffer& target,
UInt32 targetElement = 0,
UInt32 elements = 1) const override;
1557 void transfer(
Span<const
void* const> data,
size_t elementSize, const
IDirectX12Buffer& target,
UInt32 firstElement = 0) const override;
1563 void transfer(const
void* const data,
size_t size, const
IDirectX12Image& target,
UInt32 subresource = 0) const override;
1566 void transfer(
Span<const
void* const> data,
size_t elementSize, const
IDirectX12Image& target,
UInt32 firstSubresource = 0,
UInt32 subresources = 1) const override;
1608 void dispatch(const
Vector3u& threadCount) const noexcept override;
1617 void dispatchMesh(const
Vector3u& threadCount) const noexcept override;
1626 void draw(
UInt32 vertices,
UInt32 instances = 1,
UInt32 firstVertex = 0,
UInt32 firstInstance = 0) const noexcept override;
1635 void drawIndexed(
UInt32 indices,
UInt32 instances = 1,
UInt32 firstIndex = 0,
Int32 vertexOffset = 0,
UInt32 firstInstance = 0) const noexcept override;
1678 return std::static_pointer_cast<const ICommandQueue>(this->queue());
1681 void releaseSharedState()
const override;
1688 class LITEFX_DIRECTX12_API DirectX12Queue final :
public CommandQueue<DirectX12CommandBuffer>,
public ComResource<ID3D12CommandQueue> {
1707 DirectX12Queue(DirectX12Queue&&) noexcept = delete;
1710 DirectX12Queue(const DirectX12Queue&) = delete;
1713 DirectX12Queue& operator=(DirectX12Queue&&) noexcept = delete;
1716 DirectX12Queue& operator=(const DirectX12Queue&) = delete;
1720 ~DirectX12Queue() noexcept override;
1748 QueueType type() const noexcept override;
1750#if defined(LITEFX_BUILD_SUPPORT_DEBUG_MARKERS) && defined(LITEFX_BUILD_WITH_PIX_RUNTIME)
1756 void endDebugRegion() const noexcept override;
1759 void setDebugMarker(const
String& label, const
Vectors::ByteVector3& color = DEFAULT_DEBUG_COLOR) const noexcept override;
1773 void waitFor(
UInt64 fence)
const override;
1779 UInt64 currentFence() const noexcept override;
1782 UInt64 lastCompletedFence() const noexcept override;
1788 if (d3dQueue ==
nullptr) [[unlikely]]
1791 this->waitFor(*d3dQueue, fence);
1802 LITEFX_BUILDER(DirectX12RenderPipelineBuilder);
1879 LITEFX_BUILDER(DirectX12ComputePipelineBuilder);
1940 LITEFX_BUILDER(DirectX12RayTracingPipelineBuilder);
2013 ComPtr<ID3D12StateObject>
stateObject() const noexcept;
2051 DirectX12FrameBuffer(DirectX12FrameBuffer&&) noexcept = delete;
2054 DirectX12FrameBuffer(const DirectX12FrameBuffer&) = delete;
2057 DirectX12FrameBuffer& operator=(DirectX12FrameBuffer&&) noexcept = delete;
2060 DirectX12FrameBuffer& operator=(const DirectX12FrameBuffer&) = delete;
2064 ~DirectX12FrameBuffer() noexcept override;
2098 D3D12_CPU_DESCRIPTOR_HANDLE descriptorHandle(
UInt32 imageIndex)
const;
2106 D3D12_CPU_DESCRIPTOR_HANDLE descriptorHandle(
StringView imageName)
const;
2114 D3D12_CPU_DESCRIPTOR_HANDLE descriptorHandle(
const RenderTarget& renderTarget)
const;
2119 const Size2d& size() const noexcept override;
2122 size_t getWidth() const noexcept override;
2125 size_t getHeight() const noexcept override;
2134 void unmapRenderTarget(const
RenderTarget& renderTarget) noexcept override;
2141 return this->image(index);
2149 return this->image(renderTarget);
2175 void resize(
const Size2d& renderArea)
override;
2182 class LITEFX_DIRECTX12_API DirectX12RenderPass final :
public RenderPass<DirectX12Queue, DirectX12FrameBuffer> {
2184 LITEFX_BUILDER(DirectX12RenderPassBuilder);
2245 DirectX12RenderPass(DirectX12RenderPass&&) noexcept = delete;
2248 DirectX12RenderPass(const DirectX12RenderPass&) = delete;
2251 DirectX12RenderPass& operator=(DirectX12RenderPass&&) noexcept = delete;
2254 DirectX12RenderPass& operator=(const DirectX12RenderPass&) = delete;
2258 ~DirectX12RenderPass() noexcept override;
2331 explicit DirectX12RenderPass(
const DirectX12Device& device,
const String& name =
"");
2353 const DirectX12Device& device() const noexcept ;
2356 SharedPtr<const DirectX12FrameBuffer> activeFrameBuffer() const noexcept override;
2359 const DirectX12Queue& commandQueue() const noexcept override;
2365 SharedPtr<const DirectX12CommandBuffer> commandBuffer(
UInt32 index) const override;
2368 UInt32 secondaryCommandBuffers() const noexcept override;
2377 bool hasPresentTarget() const noexcept override;
2389 void begin(const DirectX12FrameBuffer& frameBuffer) const override;
2392 UInt64 end() const override;
2395 UInt32 viewMask() const noexcept override;
2427 DirectX12SwapChain(const DirectX12SwapChain&) = delete;
2430 DirectX12SwapChain& operator=(DirectX12SwapChain&&) noexcept = delete;
2433 DirectX12SwapChain& operator=(const DirectX12SwapChain&) = delete;
2436 ~DirectX12SwapChain() noexcept override;
2517 LITEFX_IMPLEMENTATION(DirectX12GraphicsFactoryImpl);
2545 DirectX12GraphicsFactory(DirectX12GraphicsFactory&&) noexcept = delete;
2548 DirectX12GraphicsFactory(const DirectX12GraphicsFactory&) = delete;
2551 DirectX12GraphicsFactory& operator=(DirectX12GraphicsFactory&&) noexcept = delete;
2554 DirectX12GraphicsFactory& operator=(const DirectX12GraphicsFactory&) = delete;
2558 ~DirectX12GraphicsFactory() noexcept override;
2643 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;
2667 class LITEFX_DIRECTX12_API DirectX12Device final : public
GraphicsDevice<
DirectX12GraphicsFactory,
DirectX12Surface,
DirectX12GraphicsAdapter,
DirectX12SwapChain,
DirectX12Queue,
DirectX12RenderPass,
DirectX12RenderPipeline,
DirectX12ComputePipeline,
DirectX12RayTracingPipeline,
DirectX12Barrier>, public
ComResource<ID3D12Device10> {
2684 DirectX12Device(DirectX12Device&&) noexcept = delete;
2687 DirectX12Device(const DirectX12Device&) = delete;
2690 DirectX12Device& operator=(DirectX12Device&&) noexcept = delete;
2693 DirectX12Device& operator=(const DirectX12Device&) = delete;
2697 ~DirectX12Device() noexcept override;
2748 void release() noexcept;
2759 ID3D12DescriptorHeap* globalBufferHeap() const noexcept;
2766 ID3D12DescriptorHeap* globalSamplerHeap() const noexcept;
2775 void indirectDrawSignatures(ComPtr<ID3D12CommandSignature>& dispatchSignature, ComPtr<ID3D12CommandSignature>& dispatchMeshSignature, ComPtr<ID3D12CommandSignature>& drawSignature, ComPtr<ID3D12CommandSignature>& drawIndexedSignature) const noexcept;
2812 const DirectX12SwapChain& swapChain() const noexcept override;
2815 DirectX12SwapChain& swapChain() noexcept override;
2818 const DirectX12Surface& surface() const noexcept override;
2821 const DirectX12GraphicsAdapter& adapter() const noexcept override;
2824 const DirectX12GraphicsFactory& factory() const noexcept override;
2827 const DirectX12Queue& defaultQueue(
QueueType type) const override;
2836 [[nodiscard]]
SharedPtr<DirectX12FrameBuffer> makeFrameBuffer(
StringView name, const
Size2d& renderArea) const override;
2839 [[nodiscard]]
SharedPtr<DirectX12FrameBuffer> makeFrameBuffer(
StringView name, const
Size2d& renderArea, DirectX12FrameBuffer::allocation_callback_type allocationCallback) const override;
2846 double ticksPerMillisecond() const noexcept override;
2849 void wait() const override;
2852 void computeAccelerationStructureSizes(const DirectX12BottomLevelAccelerationStructure& blas,
UInt64& bufferSize,
UInt64& scratchSize,
bool forUpdate = false) const override;
2855 void computeAccelerationStructureSizes(const DirectX12TopLevelAccelerationStructure& tlas,
UInt64& bufferSize,
UInt64& scratchSize,
bool forUpdate = false) const override;
2861 void releaseGlobalDescriptors(const DirectX12DescriptorSet& descriptorSet) const override;
2864 void updateGlobalDescriptors(const DirectX12DescriptorSet& descriptorSet,
UInt32 binding,
UInt32 offset,
UInt32 descriptors) const override;
2867 void bindDescriptorSet(const DirectX12CommandBuffer& commandBuffer, const DirectX12DescriptorSet& descriptorSet, const DirectX12PipelineState& pipeline) const noexcept override;
2870 void bindGlobalDescriptorHeaps(const DirectX12CommandBuffer& commandBuffer) const noexcept override;
2872#if defined(LITEFX_BUILD_DEFINE_BUILDERS)
2875 [[nodiscard]] DirectX12RenderPassBuilder buildRenderPass(
UInt32 commandBuffers = 1)
const override;
2878 [[nodiscard]] DirectX12RenderPassBuilder buildRenderPass(
const String& name,
UInt32 commandBuffers = 1)
const override;
2884 [[nodiscard]] DirectX12RenderPipelineBuilder buildRenderPipeline(
const DirectX12RenderPass& renderPass,
const String& name)
const override;
2887 [[nodiscard]] DirectX12ComputePipelineBuilder buildComputePipeline(
const String& name)
const override;
2890 [[nodiscard]] DirectX12RayTracingPipelineBuilder buildRayTracingPipeline(
ShaderRecordCollection&& shaderRecords)
const override;
2893 [[nodiscard]] DirectX12RayTracingPipelineBuilder buildRayTracingPipeline(
const String& name,
ShaderRecordCollection&& shaderRecords)
const override;
2896 [[nodiscard]] DirectX12PipelineLayoutBuilder buildPipelineLayout()
const override;
2899 [[nodiscard]] DirectX12InputAssemblerBuilder buildInputAssembler()
const override;
2902 [[nodiscard]] DirectX12RasterizerBuilder buildRasterizer()
const override;
2905 [[nodiscard]] DirectX12ShaderProgramBuilder buildShaderProgram()
const override;
2908 [[nodiscard]] DirectX12BarrierBuilder buildBarrier()
const override;
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 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:31
Definition swapchain.cpp:10
Definition vertex_buffer_layout.cpp:10
The base class for an application.
Definition app.hpp:402
IResource() noexcept=default
An exception that is thrown, if a provided argument is not valid.
Definition exceptions.hpp:60
Implements the DirectX 12 RenderBackend.
Definition dx12.hpp:2915
UniquePtr< DirectX12Surface > createSurface(const HWND &hwnd) const
Creates a surface on a window handle.
Definition backend.cpp:156
BackendType type() const noexcept override
Gets the type of the backend.The type of the backend.BackendType
Definition backend.cpp:83
void registerDevice(const String &name, SharedPtr< DirectX12Device > &&device) override
Definition backend.cpp:116
void activate() override
Called by the parent App, if the backend is started.
Definition backend.cpp:93
StringView name() const noexcept override
Gets the name of the backend.The name of the backend.
Definition backend.cpp:88
virtual void enableAdvancedSoftwareRasterizer(bool enable=false)
Enables Windows Advanced Software Rasterization (WARP).
Definition backend.cpp:161
const DirectX12GraphicsAdapter * findAdapter(const Optional< UInt64 > &adapterId=std::nullopt) const noexcept override
Finds an adapter using its unique ID.Note that the adapter ID is optional, which allows the back-end ...
Definition backend.cpp:108
const Array< SharedPtr< const DirectX12GraphicsAdapter > > & adapters() const override
Definition backend.cpp:103
DirectX12Device * device(const String &name) noexcept override
Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could...
Definition backend.cpp:140
DirectX12Backend(const App &app, bool advancedSoftwareRasterizer=false)
Definition backend.cpp:72
void deactivate() override
Called by the parent App, if the backend is stopped.
Definition backend.cpp:98
DirectX12Backend(DirectX12Backend &&) noexcept
void releaseDevice(const String &name) override
Destroys and removes a device from the backend.
Definition backend.cpp:128
Implements a DirectX 12 resource barrier.
Definition dx12.hpp:484
DirectX12Barrier(DirectX12Barrier &&) noexcept
Barrier< IDirectX12Buffer, IDirectX12Image > base_type
Definition dx12.hpp:489
void transition(const IDirectX12Buffer &buffer, ResourceAccess accessBefore, ResourceAccess accessAfter) override
Definition barrier.cpp:76
DirectX12Barrier(PipelineStage syncBefore, PipelineStage syncAfter) noexcept
Initializes a new DirectX 12 barrier.
Definition barrier.cpp:35
void execute(const DirectX12CommandBuffer &commandBuffer) const
Adds the barrier to a command buffer and updates the resource target states.
Definition barrier.cpp:106
void wait(ResourceAccess accessBefore, ResourceAccess accessAfter) override
Inserts a global barrier that waits for previous commands to finish accesses described by accessBefor...
Definition barrier.cpp:71
Implements a DirectX 12 bottom-level acceleration structure (BLAS).
Definition dx12.hpp:302
SharedPtr< const IDirectX12Buffer > buffer() const noexcept
Definition blas.cpp:160
void clear() noexcept override
Clears all bounding boxes and triangle meshes from the acceleration structure.
Definition blas.cpp:330
void update(const DirectX12CommandBuffer &commandBuffer, const SharedPtr< const IDirectX12Buffer > &scratchBuffer=nullptr, const SharedPtr< const IDirectX12Buffer > &buffer=nullptr, UInt64 offset=0, UInt64 maxSize=0)
Definition blas.cpp:216
const Array< TriangleMesh > & triangleMeshes() const noexcept override
Returns an array of triangle meshes contained by the BLAS.The array of triangle meshes contained by t...
Definition blas.cpp:304
void build(const DirectX12CommandBuffer &commandBuffer, const SharedPtr< const IDirectX12Buffer > &scratchBuffer=nullptr, const SharedPtr< const IDirectX12Buffer > &buffer=nullptr, UInt64 offset=0, UInt64 maxSize=0)
Definition blas.cpp:178
friend class DirectX12Device
Definition dx12.hpp:304
void addTriangleMesh(const TriangleMesh &mesh) override
Adds a triangle mesh to the BLAS.
Definition blas.cpp:309
UInt64 size() const noexcept override
Returns the amount of memory in bytes inside buffer that store the acceleration structure....
Definition blas.cpp:170
void addBoundingBox(const BoundingBoxes &aabb) override
Adds a buffer containing axis-aligned bounding boxes to the BLAS.
Definition blas.cpp:322
UInt64 offset() const noexcept override
Returns the offset into buffer at which the acceleration structure is stored.The offset into buffer a...
Definition blas.cpp:165
bool remove(const TriangleMesh &mesh) noexcept override
Removes a triangle mesh from the acceleration structure.true, if the triangle mesh was removed,...
Definition blas.cpp:336
void copy(const DirectX12CommandBuffer &commandBuffer, DirectX12BottomLevelAccelerationStructure &destination, bool compress=false, const SharedPtr< const IDirectX12Buffer > &buffer=nullptr, UInt64 offset=0, bool copyBuildInfo=true) const
Definition blas.cpp:261
AccelerationStructureFlags flags() const noexcept override
Returns the flags that control how the acceleration structure should be built.The flags that control ...
Definition blas.cpp:155
friend class DirectX12CommandBuffer
Definition dx12.hpp:305
const Array< BoundingBoxes > & boundingBoxes() const noexcept override
Returns an array of buffers, each containing axis-aligned bounding boxes stored in the BLAS....
Definition blas.cpp:317
DirectX12BottomLevelAccelerationStructure(AccelerationStructureFlags flags=AccelerationStructureFlags::None, StringView name="")
Initializes a new DirectX 12 bottom-level acceleration structure (BLAS).
Definition blas.cpp:146
DirectX12BottomLevelAccelerationStructure(DirectX12BottomLevelAccelerationStructure &&) noexcept
Records commands for a DirectX12Queue.
Definition dx12.hpp:1435
void begin() const override
Sets the command buffer into recording state, so that it can receive command that should be submitted...
Definition command_buffer.cpp:192
static SharedPtr< DirectX12CommandBuffer > create(const DirectX12Queue &queue, bool begin=false, bool primary=true)
Initializes the command buffer from a command queue.
Definition dx12.hpp:1490
SharedPtr< const DirectX12Queue > queue() const noexcept
Definition command_buffer.cpp:187
CommandBuffer< DirectX12CommandBuffer, IDirectX12Buffer, IDirectX12VertexBuffer, IDirectX12IndexBuffer, IDirectX12Image, DirectX12Barrier, DirectX12PipelineState, DirectX12BottomLevelAccelerationStructure, DirectX12TopLevelAccelerationStructure > base_type
Definition dx12.hpp:1440
Implements a DirectX 12 ComputePipeline.
Definition dx12.hpp:1877
void use(const DirectX12CommandBuffer &commandBuffer) const noexcept override
Sets the current pipeline state on the commandBuffer .
Definition compute_pipeline.cpp:108
DirectX12ComputePipeline(DirectX12ComputePipeline &&) noexcept
SharedPtr< const DirectX12ShaderProgram > program() const noexcept override
Definition compute_pipeline.cpp:98
DirectX12ComputePipeline(const DirectX12Device &device, const SharedPtr< DirectX12PipelineLayout > &layout, const SharedPtr< DirectX12ShaderProgram > &shaderProgram, const String &name="")
Initializes a new DirectX 12 compute pipeline.
Definition compute_pipeline.cpp:80
SharedPtr< const DirectX12PipelineLayout > layout() const noexcept override
Definition compute_pipeline.cpp:103
Implements a DirectX 12 IDescriptorLayout.
Definition dx12.hpp:777
bool unbounded() const noexcept override
Returns true, if the descriptor defines an unbounded descriptor array.true, if the descriptor defines...
Definition descriptor_layout.cpp:93
DirectX12DescriptorLayout(DirectX12DescriptorLayout &&) noexcept
UInt32 binding() const noexcept override
Returns the binding point, the buffer will be bound to.In GLSL, the binding point is identified by th...
Definition descriptor_layout.cpp:98
bool local() const noexcept
Returns true, if the descriptor belongs to the local root signature of a ray-tracing pipeline or fals...
Definition descriptor_layout.cpp:78
UInt32 descriptors() const noexcept override
Returns the number of descriptors in the descriptor array.If unbounded is set to true,...
Definition descriptor_layout.cpp:88
size_t elementSize() const noexcept override
Returns the size of a single element within the buffer.The size of a single element within the buffer...
Definition descriptor_layout.cpp:83
DescriptorType descriptorType() const noexcept override
Returns the type of the descriptor.The type of the descriptor.
Definition descriptor_layout.cpp:108
const IDirectX12Sampler * staticSampler() const noexcept override
If the descriptor describes a static sampler, this method returns the state of the sampler....
Definition descriptor_layout.cpp:113
BufferType type() const noexcept override
Returns the buffer type of the buffer.The buffer type of the buffer.
Definition descriptor_layout.cpp:103
DirectX12DescriptorLayout(DescriptorType type, UInt32 binding, size_t elementSize, UInt32 descriptors=1, bool unbounded=false, bool local=false)
Initializes a new DirectX 12 descriptor layout.
Definition descriptor_layout.cpp:62
Implements a DirectX 12 DescriptorSet.
Definition dx12.hpp:697
virtual const DirectX12DescriptorSetLayout & layout() const noexcept
Returns the parent descriptor set layout.
Definition descriptor_set.cpp:460
DirectX12DescriptorSet(DirectX12DescriptorSet &&) noexcept=delete
virtual const ComPtr< ID3D12DescriptorHeap > localHeap(DescriptorHeapType heapType) const noexcept
Returns the local (CPU-visible) heap that contains the set's descriptors.
Definition descriptor_set.cpp:611
DirectX12DescriptorSet(const DirectX12DescriptorSetLayout &layout, ComPtr< ID3D12DescriptorHeap > &&resourceHeap=nullptr, ComPtr< ID3D12DescriptorHeap > &&samplerHeap=nullptr)
Initializes a new descriptor set.
Definition descriptor_set.cpp:444
void update(UInt32 binding, const IDirectX12Buffer &buffer, UInt32 bufferElement=0, UInt32 elements=0, UInt32 firstDescriptor=0, Format texelFormat=Format::None) const override
Definition descriptor_set.cpp:509
DescriptorSet< IDirectX12Buffer, IDirectX12Image, IDirectX12Sampler, IDirectX12AccelerationStructure > base_type
Definition dx12.hpp:701
UInt32 bindToHeap(DescriptorType bindingType, UInt32 descriptor, const IDirectX12Buffer &buffer, UInt32 bufferElement=0, UInt32 elements=0, Format texelFormat=Format::None) const override
Definition descriptor_set.cpp:470
VirtualAllocator::Allocation globalHeapAllocation(DescriptorHeapType heapType) const noexcept override
Returns the allocation information for the descriptor set in the global descriptor heap indicated by ...
Definition descriptor_set.cpp:465
Implements a DirectX 12 DescriptorSetLayout.
Definition dx12.hpp:857
friend class DirectX12PipelineLayout
Definition dx12.hpp:860
static auto create(const DirectX12Device &device, const Enumerable< DirectX12DescriptorLayout > &descriptorLayouts, UInt32 space, ShaderStage stages)
Creates a DirectX 12 descriptor set layout.
Definition dx12.hpp:910
static auto create(const DirectX12DescriptorSetLayout &other)
Creates a copy of a DirectX 12 descriptor set layout.
Definition dx12.hpp:919
DescriptorSetLayout< DirectX12DescriptorLayout, DirectX12DescriptorSet > base_type
Definition dx12.hpp:864
virtual SharedPtr< const DirectX12Device > device() const noexcept
Returns the parent device or nullptr, if it has been released.
Definition descriptor_set_layout.cpp:245
UInt32 space() const noexcept override
Returns the space index of the descriptor set.The descriptor set space maps to the space index in HLS...
Definition descriptor_set_layout.cpp:263
Implements a DirectX 12 graphics device.
Definition dx12.hpp:2667
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:2728
static SharedPtr< DirectX12Device > create(const DirectX12Backend &backend, const DirectX12GraphicsAdapter &adapter, UniquePtr< DirectX12Surface > &&surface, GraphicsDeviceFeatures features={})
Initializes the device instance.
Definition dx12.hpp:2710
friend class DirectX12Backend
Definition dx12.hpp:2670
const DirectX12Surface & surface() const noexcept override
Returns the surface, the device draws to.A reference of the surface, the device draws to.
Definition device.cpp:534
const DirectX12GraphicsAdapter & adapter() const noexcept override
Returns the graphics adapter, the device uses for drawing.A reference of the graphics adapter,...
Definition device.cpp:539
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:2161
static SharedPtr< DirectX12FrameBuffer > create(const DirectX12Device &device, const Size2d &renderArea, allocation_callback_type allocationCallback, StringView name="")
Initializes a DirectX 12 frame buffer.
Definition dx12.hpp:2086
IFrameBuffer::allocation_callback_type< image_type > allocation_callback_type
Definition rendering.hpp:1082
static SharedPtr< DirectX12FrameBuffer > create(const DirectX12Device &device, const Size2d &renderArea, StringView name="")
Initializes a DirectX 12 frame buffer.
Definition dx12.hpp:2074
const IDirectX12Image & resolveImage(UInt64 hash) const override
Resolves a render target name hash and returns the image mapped to it.The image mapped to the render ...
Definition frame_buffer.cpp:251
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:2148
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:2156
Implements a DirectX12 IGraphicsAdapter.
Definition dx12_api.hpp:224
A graphics factory that produces objects for a DirectX12Device.
Definition dx12.hpp:2516
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
bool tryCreateTexture(SharedPtr< IDirectX12Image > &image, Format format, const Size3d &size, ImageDimensions dimension=ImageDimensions::DIM_2, UInt32 levels=1, UInt32 layers=1, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
SharedPtr< IDirectX12Sampler > createSampler(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
SharedPtr< IDirectX12IndexBuffer > createIndexBuffer(const DirectX12IndexBufferLayout &layout, ResourceHeap heap, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
bool endDefragmentationPass() const override
Ends a defragmentation pass.Before calling this method, make sure you have started a defragmentation ...
Generator< ResourceAllocationResult > allocate(Enumerable< const ResourceAllocationInfo & > allocationInfos, AllocationBehavior allocationBehavior=AllocationBehavior::Default, bool alias=false) const override
Allocates a set of resources as described by allocationInfos .If the alias parameter is set to true,...
Generator< SharedPtr< IDirectX12Sampler > > createSamplers(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
UniquePtr< DirectX12TopLevelAccelerationStructure > createTopLevelAccelerationStructure(StringView name, AccelerationStructureFlags flags=AccelerationStructureFlags::None) const override
bool tryCreateIndexBuffer(SharedPtr< IDirectX12IndexBuffer > &buffer, const String &name, const DirectX12IndexBufferLayout &layout, ResourceHeap heap, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
SharedPtr< IDirectX12Image > createTexture(const String &name, Format format, const Size3d &size, ImageDimensions dimension=ImageDimensions::DIM_2, UInt32 levels=1, UInt32 layers=1, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
UInt64 beginDefragmentationPass() const override
Starts a new defragmentation pass.Before calling this method, make sure you have started a defragment...
friend class DirectX12Device
Definition dx12.hpp:2518
UniquePtr< DirectX12BottomLevelAccelerationStructure > createBottomLevelAccelerationStructure(StringView name, AccelerationStructureFlags flags=AccelerationStructureFlags::None) const override
bool tryCreateVertexBuffer(SharedPtr< IDirectX12VertexBuffer > &buffer, const DirectX12VertexBufferLayout &layout, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
VirtualAllocator createAllocator(UInt64 overallMemory, AllocationAlgorithm algorithm=AllocationAlgorithm::Default) const override
Creates a virtual allocator that can be used to manage allocation from a custom block of memory....
SharedPtr< IDirectX12Buffer > createBuffer(const String &name, BufferType type, ResourceHeap heap, size_t elementSize, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
bool tryCreateBuffer(SharedPtr< IDirectX12Buffer > &buffer, BufferType type, ResourceHeap heap, size_t elementSize, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
SharedPtr< IDirectX12VertexBuffer > createVertexBuffer(const DirectX12VertexBufferLayout &layout, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
GraphicsFactory< DirectX12DescriptorLayout, IDirectX12Buffer, IDirectX12VertexBuffer, IDirectX12IndexBuffer, IDirectX12Image, IDirectX12Sampler, DirectX12BottomLevelAccelerationStructure, DirectX12TopLevelAccelerationStructure > base_type
Definition dx12.hpp:2522
SharedPtr< IDirectX12IndexBuffer > createIndexBuffer(const String &name, const DirectX12IndexBufferLayout &layout, ResourceHeap heap, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
SharedPtr< IDirectX12Buffer > createBuffer(BufferType type, ResourceHeap heap, size_t elementSize, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
bool tryCreateTexture(SharedPtr< IDirectX12Image > &image, const String &name, Format format, const Size3d &size, ImageDimensions dimension=ImageDimensions::DIM_2, UInt32 levels=1, UInt32 layers=1, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
SharedPtr< IDirectX12VertexBuffer > createVertexBuffer(const String &name, const DirectX12VertexBufferLayout &layout, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
bool canAlias(Enumerable< const ResourceAllocationInfo & > allocationInfos) const override
Checks if the resources described by allocationInfos can be overlapped.true, if the resources descri...
bool tryCreateIndexBuffer(SharedPtr< IDirectX12IndexBuffer > &buffer, const DirectX12IndexBufferLayout &layout, ResourceHeap heap, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
bool tryCreateVertexBuffer(SharedPtr< IDirectX12VertexBuffer > &buffer, const String &name, const DirectX12VertexBufferLayout &layout, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
void beginDefragmentation(const ICommandQueue &queue, DefragmentationStrategy strategy=DefragmentationStrategy::Balanced, UInt64 maxBytesToMove=0u, UInt32 maxAllocationsToMove=0u) const override
Starts a defragmentation process for the resources allocated from the factory.Defragmentation is an i...
bool tryCreateBuffer(SharedPtr< IDirectX12Buffer > &buffer, const String &name, BufferType type, ResourceHeap heap, size_t elementSize, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
Array< MemoryHeapStatistics > memoryStatistics() const override
Returns an array of objects, that contain information about the current memory usage and available me...
DetailedMemoryStatistics detailedMemoryStatistics() const override
Returns detailed memory statistics.Only call this method for debugging purposes, as it is significant...
SharedPtr< IDirectX12Image > createTexture(Format format, const Size3d &size, ImageDimensions dimension=ImageDimensions::DIM_2, UInt32 levels=1, UInt32 layers=1, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
Generator< SharedPtr< IDirectX12Image > > createTextures(Format format, const Size3d &size, ImageDimensions dimension=ImageDimensions::DIM_2, UInt32 levels=1, UInt32 layers=1, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const override
bool supportsResizableBaseAddressRegister() const noexcept override
Returns true, if the GPU supports resizable base address register (ReBAR) and false otherwise....
Implements a DirectX 12 index buffer layout.
Definition dx12.hpp:119
static auto create(IndexType type)
Creates a new index buffer layout.
Definition dx12.hpp:153
static auto create(const DirectX12IndexBufferLayout &other)
Creates a copy of an index buffer layout.
Definition dx12.hpp:162
BufferType type() const noexcept override
Returns the buffer type of the buffer.The buffer type of the buffer.
Definition index_buffer_layout.cpp:45
Implements a DirectX 12 PipelineLayout.
Definition dx12.hpp:1130
static auto create(const DirectX12Device &device, const Enumerable< SharedPtr< DirectX12DescriptorSetLayout > > &descriptorSetLayouts, UniquePtr< DirectX12PushConstantsLayout > &&pushConstantsLayout)
Creates a new DirectX 12 render pipeline layout.
Definition dx12.hpp:1175
const DirectX12Device & device() const noexcept
Definition pipeline_layout.cpp:328
Defines the base class for DirectX 12 pipeline state objects.
Definition dx12.hpp:1411
DirectX12PipelineState(DirectX12PipelineState &&) noexcept=default
virtual void use(const DirectX12CommandBuffer &commandBuffer) const =0
Sets the current pipeline state on the commandBuffer .
Implements the DirectX 12 PushConstantsLayout.
Definition dx12.hpp:1073
DirectX12PushConstantsLayout(DirectX12PushConstantsLayout &&) noexcept
friend class DirectX12PipelineLayout
Definition dx12.hpp:1076
const Array< UniquePtr< DirectX12PushConstantsRange > > & ranges() const override
Definition push_constants_layout.cpp:82
DirectX12PushConstantsLayout(Enumerable< UniquePtr< DirectX12PushConstantsRange > > &&ranges, UInt32 size)
Initializes a new push constants layout.
Definition push_constants_layout.cpp:49
const DirectX12PushConstantsRange & range(ShaderStage stage) const override
Returns the push constant range associated with the shader stage provided in stage ....
Definition push_constants_layout.cpp:69
UInt32 size() const noexcept override
Returns the size (in bytes) of the push constants backing memory.The size (in bytes) of the push cons...
Definition push_constants_layout.cpp:64
Implements the DirectX 12 IPushConstantsRange.
Definition dx12.hpp:1015
friend class DirectX12PipelineLayout
Definition dx12.hpp:1017
UInt32 size() const noexcept override
Returns the size (in bytes) of the range.The size (in bytes) of the range.offset
Definition push_constants_range.cpp:62
UInt32 space() const noexcept override
Returns the shader space the push constants can be accessed from.The shader space the push constants ...
Definition push_constants_range.cpp:47
UInt32 binding() const noexcept override
Returns the binding point or register, the push constants are made available at.The binding point or ...
Definition push_constants_range.cpp:52
DirectX12PushConstantsRange(DirectX12PushConstantsRange &&) noexcept
UInt32 offset() const noexcept override
Returns the offset from the push constants backing memory block, the range starts at....
Definition push_constants_range.cpp:57
ShaderStage stage() const noexcept override
Returns the shader stage(s), the range is accessible from.The shader stage(s), the range is accessibl...
Definition push_constants_range.cpp:67
DirectX12PushConstantsRange(ShaderStage shaderStages, UInt32 offset, UInt32 size, UInt32 space, UInt32 binding)
Initializes a new push constants range.
Definition push_constants_range.cpp:36
Implements a DirectX 12 command queue.
Definition dx12.hpp:1688
QueueType type() const noexcept override
Returns the type of the queue.The type of the queue.
Definition queue.cpp:119
static SharedPtr< DirectX12Queue > create(const DirectX12Device &device, QueueType type, QueuePriority priority)
Creates the DirectX 12 command queue.
Definition dx12.hpp:1730
CommandQueue< DirectX12CommandBuffer > base_type
Definition dx12.hpp:1693
QueuePriority priority() const noexcept override
Returns the priority of the queue.The priority of the queue.
Definition queue.cpp:141
virtual SharedPtr< const DirectX12Device > device() const noexcept
Returns a pointer to the device that provides this queue or nullptr, if the device has already been r...
Definition queue.cpp:114
Implements a DirectX 12 IRasterizer.
Definition dx12.hpp:1332
static auto create(const DirectX12Rasterizer &other)
Creates a new DirectX 12 rasterizer state by copying an existing one.
Definition dx12.hpp:1392
static auto create(PolygonMode polygonMode, CullMode cullMode, CullOrder cullOrder, Float lineWidth=1.f, bool depthClip=true, const DepthStencilState &depthStencilState={}, bool conservativeRasterization=false)
Creates a new DirectX 12 rasterizer state.
Definition dx12.hpp:1383
Implements a DirectX 12 RayTracingPipeline.
Definition dx12.hpp:1938
UInt32 maxRecursionDepth() const noexcept override
Returns the maximum number of ray bounces.The shader record collection of the ray tracing pipeline.
Definition ray_tracing_pipeline.cpp:542
void use(const DirectX12CommandBuffer &commandBuffer) const noexcept override
Sets the current pipeline state on the commandBuffer .
Definition ray_tracing_pipeline.cpp:567
UInt32 maxPayloadSize() const noexcept override
Returns the maximum size of a single ray payload.A ray payload is the data that is passed down the Tr...
Definition ray_tracing_pipeline.cpp:547
DirectX12RayTracingPipeline(DirectX12RayTracingPipeline &&) noexcept
SharedPtr< const DirectX12PipelineLayout > layout() const noexcept override
Definition ray_tracing_pipeline.cpp:532
SharedPtr< const DirectX12ShaderProgram > program() const noexcept override
Definition ray_tracing_pipeline.cpp:527
DirectX12RayTracingPipeline(const DirectX12Device &device, const SharedPtr< DirectX12PipelineLayout > &layout, const SharedPtr< DirectX12ShaderProgram > &shaderProgram, ShaderRecordCollection &&shaderRecords, UInt32 maxRecursionDepth=10, UInt32 maxPayloadSize=0, UInt32 maxAttributeSize=32, const String &name="")
Initializes a new DirectX 12 ray-tracing pipeline.
Definition ray_tracing_pipeline.cpp:509
SharedPtr< IDirectX12Buffer > allocateShaderBindingTable(ShaderBindingTableOffsets &offsets, ShaderBindingGroup groups=ShaderBindingGroup::All) const override
Definition ray_tracing_pipeline.cpp:562
ComPtr< ID3D12StateObject > stateObject() const noexcept
Returns the handle of the ray tracing pipeline state object.
Definition ray_tracing_pipeline.cpp:557
UInt32 maxAttributeSize() const noexcept override
Returns the maximum size of a single ray attribute.A ray attribute is the data that is passed to a hi...
Definition ray_tracing_pipeline.cpp:552
const ShaderRecordCollection & shaderRecords() const noexcept override
Returns the shader record collection of the ray tracing pipeline.The shader record collection of the ...
Definition ray_tracing_pipeline.cpp:537
Implements a DirectX 12 render pass.
Definition dx12.hpp:2182
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, UInt32 viewMask=0b0000)
Creates and initializes a new DirectX 12 render pass instance.
Definition dx12.hpp:2321
RenderPass< DirectX12Queue, DirectX12FrameBuffer > base_type
Definition dx12.hpp:2188
static SharedPtr< DirectX12RenderPass > create(const DirectX12Device &device, const String &name, Span< RenderTarget > renderTargets, Span< RenderPassDependency > inputAttachments={ }, Optional< DescriptorBindingPoint > inputAttachmentSamplerBinding=std::nullopt, UInt32 secondaryCommandBuffers=1u, UInt32 viewMask=0b0000)
Creates and initializes a new DirectX 12 render pass instance that executes on the default graphics q...
Definition dx12.hpp:2288
const Array< RenderPassDependency > & inputAttachments() const noexcept override
Returns the input attachment the render pass is consuming.An array of input attachment mappings,...
Definition render_pass.cpp:324
static SharedPtr< DirectX12RenderPass > create(const DirectX12Device &device, Span< RenderTarget > renderTargets, Span< RenderPassDependency > inputAttachments={ }, Optional< DescriptorBindingPoint > inputAttachmentSamplerBinding=std::nullopt, UInt32 secondaryCommandBuffers=1u, UInt32 viewMask=0b0000)
Creates and initializes a new DirectX 12 render pass instance that executes on the default graphics q...
Definition dx12.hpp:2272
const DirectX12Device & device() const noexcept
Returns a reference of the device that provides this queue.
Definition render_pass.cpp:262
const Array< RenderTarget > & renderTargets() const noexcept override
Returns the list of render targets, the render pass renders into.Note that the actual render target i...
Definition render_pass.cpp:306
static SharedPtr< DirectX12RenderPass > create(const DirectX12Device &device, const DirectX12Queue &queue, Span< RenderTarget > renderTargets, Span< RenderPassDependency > inputAttachments={ }, Optional< DescriptorBindingPoint > inputAttachmentSamplerBinding=std::nullopt, UInt32 secondaryCommandBuffers=1u, UInt32 viewMask=0b0000)
Creates and initializes a new DirectX 12 render pass instance.
Definition dx12.hpp:2304
Implements a DirectX 12 RenderPipeline.
Definition dx12.hpp:1800
SharedPtr< const DirectX12ShaderProgram > program() const noexcept override
Definition render_pipeline.cpp:561
void updateSamples(MultiSamplingLevel samples) override
Changes the multi-sampling level of the pipeline.Changing the multi-sampling level of a pipeline caus...
Definition render_pipeline.cpp:591
DirectX12RenderPipeline(DirectX12RenderPipeline &&) noexcept=delete
SharedPtr< DirectX12InputAssembler > inputAssembler() const noexcept override
Definition render_pipeline.cpp:571
bool alphaToCoverage() const noexcept override
Returns true, if the pipeline uses Alpha-to-Coverage multi-sampling.Alpha-to-Coverage is a multi-samp...
Definition render_pipeline.cpp:581
void use(const DirectX12CommandBuffer &commandBuffer) const override
Sets the current pipeline state on the commandBuffer .
Definition render_pipeline.cpp:603
SharedPtr< DirectX12Rasterizer > rasterizer() const noexcept override
Definition render_pipeline.cpp:576
MultiSamplingLevel samples() const noexcept override
Returns the multi-sampling level of the pipeline.When using the pipeline, the multi-sampling level mu...
Definition render_pipeline.cpp:586
DirectX12RenderPipeline(const DirectX12RenderPass &renderPass, const SharedPtr< DirectX12PipelineLayout > &layout, const SharedPtr< DirectX12ShaderProgram > &shaderProgram, const SharedPtr< DirectX12InputAssembler > &inputAssembler, const SharedPtr< DirectX12Rasterizer > &rasterizer, MultiSamplingLevel samples=MultiSamplingLevel::x1, bool enableAlphaToCoverage=false, const String &name="")
Initializes a new DirectX 12 render pipeline.
Definition render_pipeline.cpp:541
SharedPtr< const DirectX12PipelineLayout > layout() const noexcept override
Definition render_pipeline.cpp:566
Implements a DirectX 12 IShaderModule.
Definition dx12.hpp:563
DirectX12ShaderModule(DirectX12ShaderModule &&) noexcept
const Optional< DescriptorBindingPoint > & shaderLocalDescriptor() const noexcept override
For ray-tracing shader modules returns the binding point for the descriptor that receives shader-loca...
Definition shader_module.cpp:88
const String & fileName() const noexcept override
Returns the file name of the shader module.The file name of the shader module.
Definition shader_module.cpp:78
ShaderStage type() const noexcept override
Returns the type of the shader module.The type of the shader module.
Definition shader_module.cpp:73
const String & entryPoint() const noexcept override
Returns the name of the shader module entry point.The name of the shader module entry point.
Definition shader_module.cpp:83
DirectX12ShaderModule(const DirectX12Device &device, ShaderStage type, const String &fileName, const String &entryPoint="main", const Optional< DescriptorBindingPoint > &shaderLocalDescriptor=std::nullopt)
Initializes a new DirectX 12 shader module.
Definition shader_module.cpp:57
Implements a DirectX 12 ShaderProgram.
Definition dx12.hpp:623
static auto create(const DirectX12Device &device, Enumerable< UniquePtr< DirectX12ShaderModule > > &&modules) -> SharedPtr< DirectX12ShaderProgram >
Creates a new shader program instance.
Definition dx12.hpp:667
const Array< UniquePtr< const DirectX12ShaderModule > > & modules() const noexcept override
Definition shader_program.cpp:680
Implements a DirectX12 ISurface.
Definition dx12_api.hpp:290
Implements a DirectX 12 swap chain.
Definition dx12.hpp:2401
const Array< SharedPtr< const TimingEvent > > & timingEvents() const override
Returns all registered timing events.An array, containing all registered timing events.
Definition swapchain.cpp:240
UInt32 resolveQueryId(SharedPtr< const TimingEvent > timingEvent) const override
Returns the query ID for the timing event.The query ID for the timingEvent .TimingEvent::queryId
Definition swapchain.cpp:264
virtual bool supportsVariableRefreshRate() const noexcept
Returns true, if the adapter supports variable refresh rates (i.e. tearing is allowed).
Definition swapchain.cpp:230
friend class DirectX12RenderPass
Definition dx12.hpp:2403
const Size2d & renderArea() const noexcept override
Returns the size of the render area.The size of the render area.
Definition swapchain.cpp:295
friend class DirectX12Image
Definition dx12.hpp:2404
SwapChain< IDirectX12Image > base_type
Definition dx12.hpp:2408
Enumerable< Format > getSurfaceFormats() const override
Returns an array of supported formats, that can be drawn to the surface.An array of supported formats...
Definition swapchain.cpp:335
UInt64 readTimingEvent(SharedPtr< const TimingEvent > timingEvent) const override
Reads the current time stamp value (in ticks) of a timing event.In order to convert the number of tic...
Definition swapchain.cpp:253
DirectX12SwapChain(DirectX12SwapChain &&) noexcept=delete
UInt32 swapBackBuffer() const override
Swaps the front buffer with the next back buffer in order.A reference of the front buffer after the b...
Definition swapchain.cpp:368
friend class DirectX12Device
Definition dx12.hpp:2405
void addTimingEvent(SharedPtr< const TimingEvent > timingEvent) override
Definition swapchain.cpp:350
void present(UInt64 fence) const override
Queues a present that gets executed after fence has been signaled on the default graphics queue....
Definition swapchain.cpp:323
IDirectX12Image * image(UInt32 backBuffer) const override
Returns the swap chain present image for backBuffer .A pointer to the back buffers swap chain present...
Definition swapchain.cpp:305
Format surfaceFormat() const noexcept override
Returns the swap chain image format.The swap chain image format.
Definition swapchain.cpp:285
void reset(Format surfaceFormat, const Size2d &renderArea, UInt32 buffers, bool enableVsync=false) override
Causes the swap chain to be re-created. All frame and command buffers will be invalidated and rebuilt...
Definition swapchain.cpp:362
UInt32 buffers() const noexcept override
Returns the number of images in the swap chain.The number of images in the swap chain.
Definition swapchain.cpp:290
SharedPtr< const TimingEvent > timingEvent(UInt32 queryId) const override
Returns the timing event registered for queryId .The timing event registered for queryId .
Definition swapchain.cpp:245
const Array< SharedPtr< IDirectX12Image > > & images() const noexcept override
Definition swapchain.cpp:318
const IGraphicsDevice & device() const override
Returns the swap chain's parent device instance.A reference of the swap chain's parent device instanc...
Definition swapchain.cpp:275
bool verticalSynchronization() const noexcept override
Returns true, if vertical synchronization should be used, otherwise false.true, if vertical synchroni...
Definition swapchain.cpp:300
virtual ID3D12QueryHeap * timestampQueryHeap() const noexcept
Returns the query heap for the current frame.
Definition swapchain.cpp:235
Implements a DirectX 12 top-level acceleration structure (TLAS).
Definition dx12.hpp:396
DirectX12TopLevelAccelerationStructure(AccelerationStructureFlags flags=AccelerationStructureFlags::None, StringView name="")
Initializes a new DirectX 12 top-level acceleration structure (BLAS).
Definition tlas.cpp:96
DirectX12TopLevelAccelerationStructure(DirectX12TopLevelAccelerationStructure &&) noexcept
void copy(const DirectX12CommandBuffer &commandBuffer, DirectX12TopLevelAccelerationStructure &destination, bool compress=false, const SharedPtr< const IDirectX12Buffer > &buffer=nullptr, UInt64 offset=0, bool copyBuildInfo=true) const
Definition tlas.cpp:213
AccelerationStructureFlags flags() const noexcept override
Returns the flags that control how the acceleration structure should be built.The flags that control ...
Definition tlas.cpp:105
void build(const DirectX12CommandBuffer &commandBuffer, const SharedPtr< const IDirectX12Buffer > &scratchBuffer=nullptr, const SharedPtr< const IDirectX12Buffer > &buffer=nullptr, UInt64 offset=0, UInt64 maxSize=0)
Definition tlas.cpp:130
UInt64 offset() const noexcept override
Returns the offset into buffer at which the acceleration structure is stored.The offset into buffer a...
Definition tlas.cpp:115
friend class DirectX12Device
Definition dx12.hpp:398
const Array< Instance > & instances() const noexcept override
Returns an array of instances in the TLAS.The array of instances in the TLAS.
Definition tlas.cpp:253
SharedPtr< const IDirectX12Buffer > buffer() const noexcept
Definition tlas.cpp:110
void clear() noexcept override
Clears all instances from the acceleration structure.
Definition tlas.cpp:266
void update(const DirectX12CommandBuffer &commandBuffer, const SharedPtr< const IDirectX12Buffer > &scratchBuffer=nullptr, const SharedPtr< const IDirectX12Buffer > &buffer=nullptr, UInt64 offset=0, UInt64 maxSize=0)
Definition tlas.cpp:168
friend class DirectX12CommandBuffer
Definition dx12.hpp:399
bool remove(const Instance &instance) noexcept override
Removes an instance from the acceleration structure.true, if the instance has been removed,...
Definition tlas.cpp:271
UInt64 size() const noexcept override
Returns the amount of memory in bytes inside buffer that store the acceleration structure....
Definition tlas.cpp:120
void addInstance(const Instance &instance) override
Adds an instance to the TLAS.
Definition tlas.cpp:258
Implements a DirectX 12 vertex buffer layout.
Definition dx12.hpp:21
static auto create(size_t vertexSize, const Enumerable< BufferAttribute > &attributes, UInt32 binding=0, VertexBufferInputRate inputRate=VertexBufferInputRate::Vertex)
Creates a new vertex buffer layout.
Definition dx12.hpp:81
static auto create(const DirectX12VertexBufferLayout &other)
Creates a copy of a vertex buffer layout.
Definition dx12.hpp:90
UInt32 binding() const noexcept override
Returns the binding point, the buffer will be bound to.In GLSL, the binding point is identified by th...
Definition vertex_buffer_layout.cpp:56
static auto create(size_t vertexSize, UInt32 binding=0, VertexBufferInputRate inputRate=VertexBufferInputRate::Vertex)
Creates a new vertex buffer layout.
Definition dx12.hpp:69
const Array< BufferAttribute > & attributes() const override
Returns the vertex buffer attributes.The vertex buffer attributes.
Definition vertex_buffer_layout.cpp:66
VertexBufferInputRate inputRate() const noexcept override
Returns the vertex buffer input rate that describes how the data is made available to the vertex shad...
Definition vertex_buffer_layout.cpp:71
Represents the base interface for a DirectX 12 acceleration structure implementation.
Definition dx12.hpp:286
IDirectX12AccelerationStructure() noexcept=default
Represents the base interface for a DirectX 12 buffer implementation.
Definition dx12.hpp:190
IDirectX12Buffer() noexcept=default
Represents a DirectX 12 sampled image or the base interface for a texture.
Definition dx12.hpp:249
IDirectX12Image() noexcept=default
Represents a DirectX 12 index buffer.
Definition dx12.hpp:227
virtual const D3D12_INDEX_BUFFER_VIEW & view() const noexcept=0
IDirectX12IndexBuffer() noexcept=default
Represents a DirectX 12 sampler.
Definition dx12.hpp:268
IDirectX12Sampler() noexcept=default
Represents a DirectX 12 vertex buffer.
Definition dx12.hpp:207
IDirectX12VertexBuffer() noexcept=default
virtual const D3D12_VERTEX_BUFFER_VIEW & view() const noexcept=0
virtual constexpr void transition(const buffer_type &buffer, ResourceAccess accessBefore, ResourceAccess accessAfter)=0
Barrier() noexcept=default
virtual void drawIndexedIndirect(const buffer_type &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept=0
virtual void buildAccelerationStructure(bottom_level_acceleration_structure_type &blas, const SharedPtr< const buffer_type > &scratchBuffer, const buffer_type &buffer, UInt64 offset=0) const=0
virtual void draw(const vertex_buffer_type &vertexBuffer, UInt32 instances=1, UInt32 firstVertex=0, UInt32 firstInstance=0) const
Definition rendering.hpp:755
virtual void updateAccelerationStructure(bottom_level_acceleration_structure_type &blas, const SharedPtr< const buffer_type > &scratchBuffer, const buffer_type &buffer, UInt64 offset=0) const=0
virtual void dispatchMesh(const Vector3u &threadGroupCount) const noexcept=0
virtual void dispatchIndirect(const buffer_type &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept=0
virtual void barrier(const barrier_type &barrier) const noexcept=0
virtual void use(const pipeline_type &pipeline) const noexcept=0
virtual void transfer(const buffer_type &source, const buffer_type &target, UInt32 sourceElement=0, UInt32 targetElement=0, UInt32 elements=1) const=0
virtual void bind(const descriptor_set_type &descriptorSet) const=0
virtual void dispatch(const Vector3u &threadGroupCount) const noexcept=0
virtual void drawIndirect(const buffer_type &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept=0
virtual void copyAccelerationStructure(const bottom_level_acceleration_structure_type &from, const bottom_level_acceleration_structure_type &to, bool compress=false) const noexcept=0
virtual void pushConstants(const push_constants_layout_type &layout, const void *const memory) const=0
virtual void drawIndexed(const index_buffer_type &indexBuffer, UInt32 instances=1, UInt32 firstIndex=0, Int32 vertexOffset=0, UInt32 firstInstance=0) const
Definition rendering.hpp:761
virtual UInt64 submit(const SharedPtr< command_buffer_type > &commandBuffer) const
Definition rendering.hpp:1134
CommandQueue() noexcept=default
ComputePipeline() noexcept=default
Stores the depth/stencil state of a see IRasterizer.
Definition rendering_api.hpp:3751
virtual void update(UInt32 binding, const buffer_type &buffer, UInt32 bufferElement=0, UInt32 elements=0, UInt32 firstDescriptor=0, Format texelFormat=Format::None) const=0
DescriptorSet() noexcept=default
DescriptorSetLayout() noexcept=default
virtual void free(const descriptor_set_type &descriptorSet) const=0
virtual UniquePtr< descriptor_set_type > allocate(std::initializer_list< DescriptorBinding > bindings={ }) const
Definition rendering.hpp:262
A class that can be used to manage the state of a IGraphicsDevice.
Definition rendering_api.hpp:2697
IFrameBuffer::allocation_callback_type< image_type > allocation_callback_type
Definition rendering.hpp:1082
FrameBuffer() noexcept=default
auto addImage(this TSelf &&self, Format format, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::FrameBufferImage) -> TSelf &&
Adds an image to the frame buffer.
Definition rendering_api.hpp:9180
GraphicsDevice() noexcept=default
GraphicsFactory() noexcept=default
virtual SharedPtr< IDirectX12Buffer > createBuffer(BufferType type, ResourceHeap heap, size_t elementSize, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const=0
virtual SharedPtr< IDirectX12Sampler > createSampler(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=0
virtual bool tryCreateIndexBuffer(SharedPtr< IDirectX12IndexBuffer > &buffer, const index_buffer_layout_type &layout, ResourceHeap heap, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const=0
virtual bool tryCreateTexture(SharedPtr< IDirectX12Image > &image, Format format, const Size3d &size, ImageDimensions dimension=ImageDimensions::DIM_2, UInt32 levels=1, UInt32 layers=1, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const=0
virtual SharedPtr< IDirectX12IndexBuffer > createIndexBuffer(const index_buffer_layout_type &layout, ResourceHeap heap, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const=0
virtual SharedPtr< IDirectX12VertexBuffer > createVertexBuffer(const vertex_buffer_layout_type &layout, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const=0
virtual Generator< SharedPtr< IDirectX12Image > > createTextures(Format format, const Size3d &size, ImageDimensions dimension=ImageDimensions::DIM_2, UInt32 layers=1, UInt32 levels=1, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const=0
virtual bool tryCreateBuffer(SharedPtr< IDirectX12Buffer > &buffer, BufferType type, ResourceHeap heap, size_t elementSize, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const=0
virtual bool tryCreateVertexBuffer(SharedPtr< IDirectX12VertexBuffer > &buffer, const vertex_buffer_layout_type &layout, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const=0
virtual Generator< SharedPtr< IDirectX12Sampler > > createSamplers(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=0
virtual SharedPtr< IDirectX12Image > createTexture(Format format, const Size3d &size, ImageDimensions dimension=ImageDimensions::DIM_2, UInt32 levels=1, UInt32 layers=1, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const=0
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:5341
IAccelerationStructure() noexcept=default
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:5305
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:5618
IBottomLevelAccelerationStructure() noexcept=default
Base interface for buffer objects.
Definition rendering_api.hpp:4997
IBuffer() noexcept=default
The interface for a command buffer.
Definition rendering_api.hpp:7682
The interface for a command queue.
Definition rendering_api.hpp:9742
IDescriptorLayout() noexcept=default
The interface for a descriptor set.
Definition rendering_api.hpp:6064
void mapRenderTargets(Span< const RenderTarget > renderTargets)
Maps a set of render targets to the frame buffer images, using the names of the render targets to loo...
Definition rendering_api.hpp:9094
virtual void mapRenderTarget(const RenderTarget &renderTarget, UInt32 index)=0
Maps a render target to a frame buffer image.
The interface for a graphics device that.
Definition rendering_api.hpp:11050
virtual ResourceAllocationResult allocate(const ResourceAllocationInfo &allocationInfo, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Allocates a single resource as described by allocationInfo .
Definition rendering_api.hpp:10211
Describes a generic image.
Definition rendering_api.hpp:5019
IImage() noexcept=default
IIndexBufferLayout() noexcept=default
IPushConstantsRange() noexcept=default
Describes a texture sampler.
Definition rendering_api.hpp:5135
ISampler() noexcept=default
The interface of a scissor.
Definition rendering_api.hpp:4207
IShaderModule() noexcept=default
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:5827
ITopLevelAccelerationStructure() noexcept=default
IVertexBufferLayout() noexcept=default
Interface for a viewport.
Definition rendering_api.hpp:4089
IndexBuffer() noexcept=default
Pipeline() noexcept=default
PipelineLayout() noexcept=default
PushConstantsLayout() noexcept=default
Float lineWidth() const noexcept override
Returns the line width of the rasterizer state.Note that line width is not supported in DirectX and i...
Definition rasterizer.cpp:58
CullMode cullMode() const noexcept override
Returns the cull mode of the rasterizer state.The cull mode of the rasterizer state.
Definition rasterizer.cpp:48
const DepthStencilState & depthStencilState() const noexcept override
Returns the depth/stencil state of the rasterizer.The depth/stencil state of the rasterizer.
Definition rasterizer.cpp:63
CullOrder cullOrder() const noexcept override
Returns the cull mode of the rasterizer state.The cull mode of the rasterizer state.
Definition rasterizer.cpp:53
PolygonMode polygonMode() const noexcept override
Returns the polygon mode of the rasterizer state.The polygon mode of the rasterizer state.
Definition rasterizer.cpp:43
bool depthClip() const noexcept override
Returns true, if z-clipping should be used during distance clipping.true, if z-clipping should be use...
Definition rasterizer.cpp:68
Rasterizer(PolygonMode polygonMode, CullMode cullMode, CullOrder cullOrder, Float lineWidth=1.f, bool depthClip=true, const DepthStencilState &depthStencilState={}, bool conservativeRasterization=false) noexcept
Initializes a new rasterizer instance.
Definition rasterizer.cpp:32
RayTracingPipeline() noexcept=default
RenderBackend() noexcept=default
Represents a mapping between a set of RenderTarget instances and the input attachments of a IRenderPa...
Definition rendering_api.hpp:3684
RenderPass() noexcept=default
RenderPipeline() noexcept=default
Implements a render target.
Definition rendering_api.hpp:3584
ShaderProgram() noexcept=default
Stores a set of IShaderRecords in that later form a shader binding table used for ray-tracing.
Definition rendering_api.hpp:6923
StateResource()
Initializes a new state resource instance with a default name.
Definition state_resource.cpp:27
String & name() noexcept
Definition state_resource.cpp:41
SwapChain() noexcept=default
An event that is used to measure timestamps in a command queue.
Definition rendering_api.hpp:4371
VertexBuffer() noexcept=default
Represents a virtual allocator that manages memory distribution from a piece of raw memory.
Definition rendering_api.hpp:3032
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
Contains additional exported vector types.
Definition math.hpp:617
TVector3< UInt8 > ByteVector3
A vector that contains three bytes.
Definition math.hpp:631
uint64_t UInt64
A type for an unsigned 64 bit integer.
Definition math.hpp:71
float_t Float
A type for a floating point value with single precision.
Definition math.hpp:76
uint32_t UInt32
A type for an unsigned 32 bit integer.
Definition math.hpp:61
int32_t Int32
A type for a signed 32 bit integer.
Definition math.hpp:56
Resource< ComPtr< THandle > > ComResource
A resource that is hold by a ComPtr.
Definition dx12_api.hpp:105
BorderMode
Describes how to treat texture coordinates that are outside the domain [0..1].
Definition rendering_api.hpp:1356
@ Repeat
Repeat the texture.
Definition rendering_api.hpp:1360
CullOrder
Describes the order or vertex winding, that is used to determine, whether a polygon is facing towards...
Definition rendering_api.hpp:1190
DescriptorHeapType
The target heap type for a descriptor.
Definition rendering_api.hpp:580
ImageLayout
Specifies the layout of an IImage resource.
Definition rendering_api.hpp:1858
MipMapMode
Describes the filter operation between two mip-map levels.
Definition rendering_api.hpp:1341
@ Nearest
Take the texel from the mip-map level that is closest to the actual depth.
Definition rendering_api.hpp:1345
CullMode
Describes which faces are culled by the Rasterizer stage.
Definition rendering_api.hpp:1163
ShaderStage
Describes the valid shader stages of a graphics pipeline.
Definition rendering_api.hpp:971
IndexType
Describes the element type of an index buffer.
Definition rendering_api.hpp:906
PrimitiveTopology
Describes the topology of a mesh primitive.
Definition rendering_api.hpp:937
@ TriangleList
A list of triangles, where each triplet of vertices refers to a whole triangle.
Definition rendering_api.hpp:953
ShaderBindingGroup
Describes a group or combination of groups of a shader binding table.
Definition rendering_api.hpp:1111
@ All
Refers to a combination of all possible groups that can be stored in a shader binding table.
Definition rendering_api.hpp:1135
PolygonMode
Describes the draw mode for polygons.
Definition rendering_api.hpp:1142
BufferType
Describes the type of a IBuffer.
Definition rendering_api.hpp:601
DefragmentationStrategy
The strategy to apply to a defragmentation pass.
Definition rendering_api.hpp:886
@ Balanced
Provides a balance between fragment computation time and packing efficiency.
Definition rendering_api.hpp:895
ResourceUsage
Describes the intended usage for a resource.
Definition rendering_api.hpp:761
@ FrameBufferImage
Default usage for frame buffer images.
Definition rendering_api.hpp:815
@ Default
Shortcut for commonly used TransferSource | TransferDestination combination.
Definition rendering_api.hpp:809
ImageDimensions
Describes the dimensions of a image resource, i.e. the dimensions that are required to access a texel...
Definition rendering_api.hpp:1258
@ DIM_2
Represents a 2D image.
Definition rendering_api.hpp:1267
AllocationAlgorithm
The allocation algorithm used by VirtualAllocators.
Definition rendering_api.hpp:852
@ Default
The default algorithm without any constraints on the memory layout.
Definition rendering_api.hpp:856
DescriptorType
Describes the type of a IDescriptor.
Definition rendering_api.hpp:442
QueuePriority
Specifies the priority with which a queue is scheduled on the GPU.
Definition rendering_api.hpp:160
QueueType
Represents the type of a CommandQueue.
Definition rendering_api.hpp:114
ResourceHeap
Defines where a resource (buffer or image) memory is located and from where it can be accessed.
Definition rendering_api.hpp:710
AccelerationStructureFlags
Controls how an acceleration structure should be built.
Definition rendering_api.hpp:1988
@ None
Use default options for building the acceleration structure.
Definition rendering_api.hpp:1992
FilterMode
Describes the filter operation when accessing a pixel from a texture coordinate.
Definition rendering_api.hpp:1324
@ Nearest
Take the nearest texel with respect to the texture coordinate.
Definition rendering_api.hpp:1328
AllocationBehavior
Controls the allocation behavior of IGraphicsFactory.
Definition rendering_api.hpp:830
@ Default
Represents the default behavior, which might fall back to slower memory types, if required.
Definition rendering_api.hpp:834
VertexBufferInputRate
The rate at which a vertex buffer of a certain IVertexBufferLayout is made available for vertex shade...
Definition rendering_api.hpp:922
@ Vertex
The vertex buffer layout describes data that is made available per individual vertex.
Definition rendering_api.hpp:926
PipelineStage
Defines pipeline stages as points where synchronization may occur.
Definition rendering_api.hpp:1545
ResourceAccess
Defines how a IBuffer or IImage resource is accessed.
Definition rendering_api.hpp:1709
Format
Describes a texel format.
Definition rendering_api.hpp:183
@ B8G8R8A8_SRGB
Definition rendering_api.hpp:234
MultiSamplingLevel
Describes the number of samples with which a IImage is sampled.
Definition rendering_api.hpp:1283
@ x1
The default number of samples. Multi-sampling will be deactivated, if this sampling level is used.
Definition rendering_api.hpp:1287
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
@ None
Definition app_api.hpp:30
An input range over another range, where the returned values of type T are covariants of the values ...
Definition containers.hpp:529
Describes a resource binding to a descriptor or descriptor set.
Definition rendering_api.hpp:6218
Describes a single descriptor binding point within a IShaderModule.
Definition rendering_api.hpp:3309
Stores extended memory statistics, that can be queried by calling IGraphicsFactory::detailedMemorySta...
Definition rendering_api.hpp:10040
Describes optional features that can be supported by a device.
Definition rendering_api.hpp:10983
Stores a buffer that contains axis-aligned bounding boxes.
Definition rendering_api.hpp:5481
Represents a triangle mesh.
Definition rendering_api.hpp:5404
Represents an instance of an IBottomLevelAccelerationStructure.
Definition rendering_api.hpp:5688
Stores simple memory heap statistics, that can be quickly queried by calling IGraphicsFactory::memory...
Definition rendering_api.hpp:9985
A hint used during shader reflection to control the pipeline layout.
Definition rendering_api.hpp:7174
Describes the offsets and sizes of a shader group within a shader binding table buffer.
Definition rendering_api.hpp:4291
An allocator used to allocate the shared object.
Definition containers.hpp:1098
Definition alloc_buffer.cpp:13