3#include <litefx/config.h>
5#if !defined (LITEFX_RENDERING_API)
6# if defined(LiteFX_Rendering_EXPORTS) && (defined _WIN32 || defined WINCE)
7# define LITEFX_RENDERING_API __declspec(dllexport)
8# elif (defined(LiteFX_Rendering_EXPORTS) || defined(__APPLE__)) && defined __GNUC__ && __GNUC__ >= 4
9# define LITEFX_RENDERING_API __attribute__ ((visibility ("default")))
10# elif !defined(LiteFX_Rendering_EXPORTS) && (defined _WIN32 || defined WINCE)
11# define LITEFX_RENDERING_API __declspec(dllimport)
15#ifndef LITEFX_RENDERING_API
16# define LITEFX_RENDERING_API
19#include <litefx/app.hpp>
20#include <litefx/math.hpp>
23 using namespace LiteFX;
69#pragma region "Enumerations"
497 Sampler = 0x00000004,
666 Indirect = 0x00000008,
1638 Indirect = 0x00000100,
1790 Indirect = 0x00000100,
2068#pragma region "Flags"
2085#pragma region "Helper Functions"
2092 return static_cast<UInt32>(format) & 0x000000FF;
2100 return (
static_cast<UInt32>(format) & 0xFF000000) >> 24;
2108 return (
static_cast<UInt32>(format) & 0x0000FF00) >> 8;
2285 constexpr std::array<Format, 6> depthFormats {
2294 return std::any_of(std::begin(depthFormats), std::end(depthFormats), [&](
Format f) {
return f == format; });
2302 constexpr std::array<Format, 4> stencilFormats {
2309 return std::any_of(std::begin(stencilFormats), std::end(stencilFormats), [&](
Format f) {
return f == format; });
2314#pragma region "Data Types"
2321 struct LITEFX_RENDERING_API
alignas(16) IndirectBatch {
2347#pragma warning(push)
2348#pragma warning(disable: 4324)
2354 struct LITEFX_RENDERING_API alignas(16) IndirectIndexedBatch {
2359 UInt32 IndexCount{ };
2376 Int32 VertexOffset{ };
2390 struct LITEFX_RENDERING_API
alignas(16) IndirectDispatchBatch {
2565 m_resource(std::move(
image)) { }
2572 m_resource(std::move(
buffer)) { }
2588 template <std::derived_from<
IImage> TImage>
2591 throw RuntimeException(
"The allocation result does not contain an image.");
2595 if (
image ==
nullptr)
2596 throw RuntimeException(
"The allocated image resource is not of the requested image type.");
2607 template <std::derived_from<IBuffer> TBuffer>
2610 throw RuntimeException(
"The allocation result does not contain a buffer.");
2615 throw RuntimeException(
"The allocated buffer resource is not of the requested buffer type.");
2683 const
String&
name() const noexcept override;
3032 class LITEFX_RENDERING_API VirtualAllocator final {
3058 struct AllocatorImplBase {
3070 m_size(overallMemory), m_algorithm(algorithm)
3074 AllocatorImplBase(
const AllocatorImplBase&) =
delete;
3075 AllocatorImplBase(AllocatorImplBase&&) noexcept = delete;
3076 AllocatorImplBase& operator=(const AllocatorImplBase&) = delete;
3077 AllocatorImplBase& operator=(AllocatorImplBase&&) noexcept = delete;
3080 virtual ~AllocatorImplBase() noexcept = default;
3087 inline
UInt64 size() const noexcept {
3095 inline AllocationAlgorithm algorithm() const noexcept {
3107 [[nodiscard]]
virtual Allocation allocate(UInt64 size, UInt32 alignment = 1u, AllocationStrategy strategy = AllocationStrategy::OptimizePacking,
void* privateData =
nullptr)
const = 0;
3113 virtual void free(Allocation&& allocation)
const = 0;
3120 virtual void* privateData(
const Allocation& allocation)
const = 0;
3127 template <
typename TBackend>
3128 struct AllocatorImpl final :
public AllocatorImplBase {
3129 static_assert(
false,
"Attempting to use a non-specialized virtual allocator is invalid.");
3135 UniquePtr<AllocatorImplBase> m_impl;
3141 VirtualAllocator(UniquePtr<AllocatorImplBase>&& pImpl) :
3142 m_impl(std::move(pImpl))
3149 VirtualAllocator& operator=(const VirtualAllocator&) = delete;
3150 VirtualAllocator& operator=(VirtualAllocator&&) noexcept = delete;
3151 ~VirtualAllocator() noexcept = default;
3160 template <typename TBackend>
3171 return m_impl->size();
3179 return m_impl->algorithm();
3202 m_impl->free(std::forward<Allocation>(allocation));
3211 return m_impl->privateData(allocation);
3333 if (this->Space < other.Space)
3334 return std::strong_ordering::less;
3335 else if (this->Space > other.Space)
3336 return std::strong_ordering::greater;
3337 else if (this->Register < other.Register)
3338 return std::strong_ordering::less;
3339 else if(this->Register > other.Register)
3340 return std::strong_ordering::greater;
3342 return std::strong_ordering::equal;
3352 return other.Space == this->Space && other.Register == this->Register;
3651 const
String&
name() const noexcept override;
3884 explicit DepthStencilState(
const DepthState& depthState,
const DepthBias& depthBias,
const StencilState& stencilState)
noexcept;
4071 bool depthClip() const noexcept override;
4243 explicit Scissor(
const RectF& scissorRect = { })
noexcept;
4390 TimingEvent(TimingEvent&&) noexcept = delete;
4391 TimingEvent(const TimingEvent&) = delete;
4392 auto operator=(TimingEvent&&) noexcept = delete;
4393 auto operator=(const TimingEvent&) = delete;
4423 UInt64 readTimestamp() const;
4710 virtual
void map(const
void* const data,
size_t size,
UInt32 element = 0) = 0;
4718 virtual
void map(
Span<const
void* const> data,
size_t elementSize,
UInt32 firstElement = 0) = 0;
4727 virtual
void map(
void* data,
size_t size,
UInt32 element = 0,
bool write = true) = 0;
4744 virtual
void write(const
void* const data,
size_t size,
size_t offset = 0) = 0;
4752 virtual
void read(
void* data,
size_t size,
size_t offset = 0) = 0;
4921 virtual
size_t size() const noexcept = 0;
5126 plane = subresource / resourcesPerPlane;
5127 layer = (subresource % resourcesPerPlane) /
levels;
5128 level = subresource %
levels;
5306 this->doBuild(commandBuffer, scratchBuffer,
buffer,
offset, maxSize);
5342 this->doUpdate(commandBuffer, scratchBuffer,
buffer,
offset, maxSize);
5352 return this->getBuffer();
5415 if (vertexBuffer ==
nullptr) [[unlikely]]
5619 this->doCopy(commandBuffer, destination, compress,
buffer,
offset, copyBuildInfo);
5629 template <
typename TSelf>
5631 self.addTriangleMesh(mesh);
5632 return std::forward<TSelf>(self);
5644 template <
typename TSelf>
5646 return std::forward<TSelf>(self).withTriangleMesh(
TriangleMesh(vertexBuffer, indexBuffer, transformBuffer,
flags));
5655 template <
typename TSelf>
5657 self.addBoundingBox(aabb);
5658 return std::forward<TSelf>(self);
5668 template <
typename TSelf>
5683#pragma warning(push)
5684#pragma warning(disable: 4324)
5688 struct alignas(16) Instance final {
5692 SharedPtr<const IBottomLevelAccelerationStructure> BottomLevelAccelerationStructure;
5765 this->
addInstance(
Instance { .BottomLevelAccelerationStructure = blas, .Id = id, .Mask = mask, .HitGroupOffset = hitGroupOffset, .Flags =
flags });
5778 this->
addInstance(
Instance { .BottomLevelAccelerationStructure = blas, .Transform = transform, .Id = id, .Mask = mask, .HitGroupOffset = hitGroupOffset, .Flags =
flags });
5828 this->doCopy(commandBuffer, destination, compress,
buffer,
offset, copyBuildInfo);
5837 template<
typename TSelf>
5839 self.addInstance(instance);
5840 return std::forward<TSelf>(self);
5852 template<
typename TSelf>
5854 self.addInstance(
Instance { .BottomLevelAccelerationStructure = blas, .Id = id, .Mask = mask, .HitGroupOffset = hitGroupOffset, .Flags =
flags });
5855 return std::forward<TSelf>(self);
5868 template<
typename TSelf>
5870 self.addInstance(
Instance { .BottomLevelAccelerationStructure = blas, .Transform = transform, .Id = id, .Mask = mask, .HitGroupOffset = hitGroupOffset, .Flags =
flags });
5871 return std::forward<TSelf>(self);
5961 this->doTransition(buffer, accessBefore, accessAfter);
5977 this->doTransition(buffer, element, accessBefore, accessAfter);
5990 this->doTransition(image, accessBefore, accessAfter, layout);
6008 this->doTransition(image, level, levels, layer, layers, plane, accessBefore, accessAfter, layout);
6026 this->doTransition(image, accessBefore, accessAfter, fromLayout, toLayout);
6049 this->doTransition(image, level, levels, layer, layers, plane, accessBefore, accessAfter, fromLayout, toLayout);
6102 return this->doBind(bindingType, descriptor, buffer, bufferElement, elements, texelFormat);
6125 return this->doBind(bindingType, descriptor, image, firstLevel, levels, firstLayer, layers);
6142 return this->doBind(descriptor, sampler);
6155 this->doUpdate(binding, buffer, bufferElement, elements, firstDescriptor, texelFormat);
6180 this->doUpdate(binding, texture, descriptor, firstLevel, levels, firstLayer, layers);
6190 this->doUpdate(binding, sampler, descriptor);
6200 this->doUpdate(binding, accelerationStructure, descriptor);
6307 return this->getDescriptors();
6436 return this->getDescriptorSet(0, bindings);
6441 return this->getDescriptorSet(0, bindings);
6446 return this->getDescriptorSet(0, std::move(bindings));
6458 return this->getDescriptorSet(
descriptors, bindings);
6463 return this->getDescriptorSet(
descriptors, bindings);
6474 return this->getDescriptorSet(
descriptors, std::move(bindings));
6485 return this->getDescriptorSets(descriptorSets, 0, bindings);
6488#ifdef __cpp_lib_mdspan
6491 return this->getDescriptorSets(descriptorSets, 0, bindings);
6503 return this->getDescriptorSets(descriptorSets, 0, std::move(bindingFactory));
6515 return this->getDescriptorSets(descriptorSets, descriptors, bindings);
6518#ifdef __cpp_lib_mdspan
6521 return this->getDescriptorSets(descriptorSets, descriptors, bindings);
6534 return this->getDescriptorSets(descriptorSets,
descriptors, std::move(bindingFactory));
6542 this->releaseDescriptorSet(descriptorSet);
6551#ifdef __cpp_lib_mdspan
6555 virtual void releaseDescriptorSet(
const IDescriptorSet& descriptorSet)
const = 0;
6643 return this->getRanges();
6707 if (std::holds_alternative<MeshGeometryHitGroup>(group))
6711 else if (std::holds_alternative<const IShaderModule*>(group))
6713 switch (std::get<const IShaderModule*>(group)->
type())
6742 constexpr virtual const
void*
localData() const noexcept = 0;
6757 template <typename... TLocalData>
6775 template <
typename TLocalData>
requires
6776 (std::alignment_of_v<TLocalData> == SHADER_RECORD_LOCAL_DATA_ALIGNMENT) &&
6777 std::is_standard_layout_v<TLocalData>
6786 TLocalData m_payload;
6796 return m_shaderGroup;
6801 return static_cast<const void*
>(&m_payload);
6806 return sizeof(TLocalData);
6821 m_payload(payload), m_shaderGroup(group) { }
6867 return m_shaderGroup;
6891 m_shaderGroup(group) { }
6923 class LITEFX_RENDERING_API ShaderRecordCollection final {
6935 m_program(std::move(shaderProgram))
6945 ShaderRecordCollection& operator=(ShaderRecordCollection&&) noexcept = default;
6946 ShaderRecordCollection(const ShaderRecordCollection&) = delete;
6947 ShaderRecordCollection& operator=(const ShaderRecordCollection&) = delete;
6948 ~ShaderRecordCollection() noexcept = default;
6992 auto shaderModule = this->findShaderModule(shaderName);
6994 if (shaderModule ==
nullptr) [[unlikely]]
6995 throw InvalidArgumentException(
"shaderName",
"The parent shader program does not contain a shader named \"{}\".", shaderName);
7018 auto shaderModule = this->findShaderModule(shaderName);
7020 if (shaderModule ==
nullptr) [[unlikely]]
7021 throw InvalidArgumentException(
"shaderName",
"The parent shader program does not contain a shader named \"{}\".", shaderName);
7039 .ClosestHitShader = closestHitShaderName.has_value() ? this->findShaderModule(closestHitShaderName.value()) :
nullptr,
7040 .AnyHitShader = anyHitShaderName.has_value() ? this->findShaderModule(anyHitShaderName.value()) :
nullptr
7057 .ClosestHitShader = closestHitShaderName.has_value() ? this->findShaderModule(closestHitShaderName.value()) :
nullptr,
7058 .AnyHitShader = anyHitShaderName.has_value() ? this->findShaderModule(anyHitShaderName.value()) :
nullptr
7094 return std::forward<ShaderRecordCollection>(*
this);
7111 return std::forward<ShaderRecordCollection>(*
this);
7122 return std::forward<ShaderRecordCollection>(*
this);
7134 inline ShaderRecordCollection&&
withMeshGeometryHitGroupRecord(std::optional<StringView> anyHitShaderName, std::optional<StringView> closestHitShaderName, TLocalData payload) {
7136 return std::forward<ShaderRecordCollection>(*
this);
7146 return std::forward<ShaderRecordCollection>(*
this);
7159 return std::forward<ShaderRecordCollection>(*
this);
7285 return { .Binding = { .Register = binding, .Space = space }, .Hint =
UnboundedArrayHint { maxDescriptors } };
7304 return { .Binding = { .Register = binding, .Space = space }, .Hint =
PushConstantsHint {
true } };
7325 return { .Binding = { .Register = binding, .Space = space }, .Hint =
StaticSamplerHint { std::move(sampler) } };
7394 return { .Binding = {.Register = binding, .Space = space }, .Hint =
ShaderStageHint { shaderStages } };
7456 auto modules = this->getModules();
7458 if (
auto match = std::ranges::find_if(
modules, [name](
auto& module) {
return module.fileName().compare(name) == 0; }); match !=
modules.end())
7459 return std::addressof(*match);
7470 auto modules = this->getModules();
7471 return std::ranges::find_if(
modules, [name](
const auto& module) {
return module.fileName().compare(name) == 0; }) !=
modules.end();
7480 auto modules = this->getModules();
7481 return std::ranges::find_if(
modules, [&module](
const auto& m) {
return std::addressof(m) == std::addressof(module); }) !=
modules.end();
7489 return this->getModules();
7519 return this->parsePipelineLayout(hints);
7568 return this->getDescriptorSets();
7613 return this->getVertexBufferLayouts();
7663 return this->getProgram();
7671 return this->getLayout();
7769 return this->getQueue();
7779 return this->getBarrier(syncBefore, syncAfter);
7810 this->cmdTransfer(source, target, sourceElement, targetElement, elements);
7834 this->cmdTransfer(source, target, sourceElement, targetElement, elements);
7851 this->cmdTransfer(data, size, target, targetElement, elements);
7867 this->cmdTransfer(data, elementSize, target, targetElement);
7906 this->cmdTransfer(source, target, sourceElement, firstSubresource, elements);
7952 this->cmdTransfer(source, target, sourceElement, firstSubresource, elements);
7969 this->cmdTransfer(data, size, target, subresource);
7986 this->cmdTransfer(data, elementSize, target, firstSubresource, elements);
8003 this->cmdTransfer(source, target, sourceSubresource, targetSubresource, subresources);
8027 this->cmdTransfer(source, target, sourceSubresource, targetSubresource, subresources);
8066 this->cmdTransfer(source, target, firstSubresource, targetElement, subresources);
8112 this->cmdTransfer(source, target, firstSubresource, targetElement, subresources);
8119 this->cmdUse(pipeline);
8129 this->cmdBind(descriptorSet);
8141 template <
typename TSelf,
typename T>
8142 inline void bind(
this const TSelf& self, std::initializer_list<const T*> descriptorSets)
requires
8143 std::derived_from<T, IDescriptorSet>
8158 template <
typename TSelf>
8159 inline void bind(
this const TSelf& self, std::ranges::input_range
auto&& descriptorSets)
requires
8160 std::derived_from<std::remove_cv_t<std::remove_pointer_t<std::iter_value_t<std::ranges::iterator_t<std::remove_cv_t<std::remove_reference_t<
decltype(descriptorSets)>>>>>>,
IDescriptorSet>
8162 using descriptor_set_type = std::remove_cv_t<std::remove_pointer_t<std::iter_value_t<std::ranges::iterator_t<std::remove_cv_t<std::remove_reference_t<
decltype(descriptorSets)>>>>>>;
8163 auto sets = descriptorSets | std::ranges::to<Array<const descriptor_set_type*>>();
8175 this->cmdBind(descriptorSets);
8184 this->cmdBind(descriptorSet, pipeline);
8197 template <
typename TSelf,
typename T>
8198 inline void bind(
this const TSelf& self, std::initializer_list<const T*> descriptorSets,
const typename TSelf::pipeline_type& pipeline)
8213 template <
typename TSelf>
8214 inline void bind(
this const TSelf& self, std::ranges::input_range
auto&& descriptorSets,
const typename TSelf::pipeline_type& pipeline)
requires
8215 std::derived_from<std::remove_cv_t<std::remove_pointer_t<std::iter_value_t<std::ranges::iterator_t<std::remove_cv_t<std::remove_reference_t<
decltype(descriptorSets)>>>>>>,
IDescriptorSet>
8217 using descriptor_set_type = std::remove_cv_t<std::remove_pointer_t<std::iter_value_t<std::ranges::iterator_t<std::remove_cv_t<std::remove_reference_t<
decltype(descriptorSets)>>>>>>;
8218 auto sets = descriptorSets | std::ranges::to<Array<const descriptor_set_type*>>();
8231 this->cmdBind(descriptorSets, pipeline);
8245 this->cmdBind(buffer);
8258 this->cmdBind(buffer);
8286 this->cmdDispatchIndirect(batchBuffer, batchCount, offset);
8319 this->cmdDispatchMeshIndirect(batchBuffer, batchCount, offset);
8332 this->cmdDispatchMeshIndirect(batchBuffer, countBuffer, offset, countOffset, maxBatches);
8350 this->cmdTraceRays(width, height, depth, offsets, rayGenerationShaderBindingTable, missShaderBindingTable, hitShaderBindingTable, callableShaderBindingTable);
8366 this->
traceRays(dimensions.
x(), dimensions.
y(), dimensions.
z(), offsets, rayGenerationShaderBindingTable, missShaderBindingTable, hitShaderBindingTable, callableShaderBindingTable);
8390 this->cmdDraw(vertexBuffer, instances, firstVertex, firstInstance);
8401 this->cmdDrawIndirect(batchBuffer, batchCount, offset);
8414 this->cmdDrawIndirect(batchBuffer, countBuffer, offset, countOffset, maxBatches);
8440 this->cmdDrawIndexed(indexBuffer, instances, firstIndex, vertexOffset, firstInstance);
8456 this->cmdDrawIndexed(vertexBuffer, indexBuffer, instances, firstIndex, vertexOffset, firstInstance);
8467 this->cmdDrawIndexedIndirect(batchBuffer, batchCount, offset);
8480 this->cmdDrawIndexedIndirect(batchBuffer, countBuffer, offset, countOffset, maxBatches);
8489 this->cmdPushConstants(layout, memory);
8562 this->cmdExecute(commandBuffer);
8570 this->cmdExecute(std::move(commandBuffers));
8586 this->cmdBuildAccelerationStructure(blas, scratchBuffer, buffer, offset);
8602 this->cmdBuildAccelerationStructure(tlas, scratchBuffer, buffer, offset);
8618 this->cmdUpdateAccelerationStructure(blas, scratchBuffer, buffer, offset);
8634 this->cmdUpdateAccelerationStructure(tlas, scratchBuffer, buffer, offset);
8651 this->cmdCopyAccelerationStructure(from, to, compress);
8668 this->cmdCopyAccelerationStructure(from, to, compress);
8683 virtual
void cmdTransfer(const
IImage& source, const
IImage& target,
UInt32 sourceSubresource,
UInt32 targetSubresource,
UInt32 subresources) const = 0;
8689 virtual
void cmdTransfer(const
void* const data,
size_t size, const
IBuffer& target,
UInt32 targetElement,
UInt32 elements) const = 0;
8690 virtual
void cmdTransfer(
Span<const
void* const> data,
size_t elementSize, const
IBuffer& target,
UInt32 targetElement) const = 0;
8691 virtual
void cmdTransfer(const
void* const data,
size_t size, const
IImage& target,
UInt32 subresource) const = 0;
8692 virtual
void cmdTransfer(
Span<const
void* const> data,
size_t elementSize, const
IImage& target,
UInt32 firstSubresource,
UInt32 elements) const = 0;
8693 virtual
void cmdUse(const
IPipeline& pipeline) const noexcept = 0;
8694 virtual
void cmdBind(const
IDescriptorSet& descriptorSet) const = 0;
8698 virtual
void cmdBind(const
IVertexBuffer& buffer) const = 0;
8699 virtual
void cmdBind(const
IIndexBuffer& buffer) const = 0;
8700 virtual
void cmdPushConstants(const
IPushConstantsLayout& layout, const
void* const memory) const = 0;
8701 virtual
void cmdDispatchIndirect(const
IBuffer& batchBuffer,
UInt32 batchCount,
UInt64 offset) const noexcept = 0;
8702 virtual
void cmdDispatchMeshIndirect(const
IBuffer& batchBuffer,
UInt32 batchCount,
UInt64 offset) const noexcept = 0;
8703 virtual
void cmdDispatchMeshIndirect(const
IBuffer& batchBuffer, const
IBuffer& countBuffer,
UInt64 offset,
UInt64 countOffset,
UInt32 maxBatches) const noexcept = 0;
8705 virtual
void cmdDrawIndirect(const
IBuffer& batchBuffer,
UInt32 batchCount,
UInt64 offset) const noexcept = 0;
8706 virtual
void cmdDrawIndirect(const
IBuffer& batchBuffer, const
IBuffer& countBuffer,
UInt64 offset,
UInt64 countOffset,
UInt32 maxBatches) const noexcept = 0;
8709 virtual
void cmdDrawIndexedIndirect(const
IBuffer& batchBuffer,
UInt32 batchCount,
UInt64 offset) const noexcept = 0;
8710 virtual
void cmdDrawIndexedIndirect(const
IBuffer& batchBuffer, const
IBuffer& countBuffer,
UInt64 offset,
UInt64 countOffset,
UInt32 maxBatches) const noexcept = 0;
8742 return this->getInputAssembler();
8750 return this->getRasterizer();
8874 return this->getShaderBindingTable(offsets, groups);
8924 template <
typename TImage>
9095 std::ranges::for_each(renderTargets, [
this](
auto& renderTarget) { this->
mapRenderTarget(renderTarget); });
9113 return this->getImages();
9179 template <
typename TSelf>
9181 self.addImage(format, samples, usage);
9182 return std::forward<TSelf>(self);
9192 this->
addImage(
"", format, samples, usage);
9202 template <
typename TSelf>
9204 self.addImage(
name, format, samples, usage);
9205 return std::forward<TSelf>(self);
9224 template <
typename TSelf>
9226 self.addImage(renderTarget, samples, usage);
9227 return std::forward<TSelf>(self);
9237 this->
addImage(renderTarget.
name(), renderTarget, samples, usage);
9247 template <
typename TSelf>
9249 self.addImage(
name, renderTarget, samples, usage);
9250 return std::forward<TSelf>(self);
9271 template <
typename TSelf>
9273 std::ranges::for_each(renderTargets, [&](
auto& renderTarget) { self.addImage(renderTarget.
name(), renderTarget, samples, usage); });
9274 return std::forward<TSelf>(self);
9317 return *m_frameBuffer;
9362 return this->getActiveFrameBuffer();
9370 return this->getCommandQueue();
9382 return this->getCommandBuffers();
9394 return this->getCommandBuffer(index);
9454 this->beginRenderPass(frameBuffer);
9475 virtual
void beginRenderPass(const
IFrameBuffer& frameBuffer) const = 0;
9476 virtual const
ICommandQueue& getCommandQueue() const noexcept = 0;
9511 return m_surfaceFormat;
9519 return m_renderArea;
9562 return m_backBuffer;
9587 auto timingEvent = TimingEvent::create(*
this, name);
9675 return this->getImages();
9767 return m_commandBuffers;
9881 return this->getCommandBuffer(beginRecording, secondary);
9897 return this->submitCommandBuffer(commandBuffer);
9913 return this->submitCommandBuffer(commandBuffer);
9929 return this->submitCommandBuffers(std::move(commandBuffers));
9952 this->waitForQueue(queue, fence);
9978 commandBuffer.releaseSharedState();
10212 if (std::holds_alternative<ResourceAllocationInfo::ImageInfo>(allocationInfo.ResourceInfo))
10214 auto& imageInfo = std::get<ResourceAllocationInfo::ImageInfo>(allocationInfo.ResourceInfo);
10215 return this->createTexture(allocationInfo.Name, imageInfo.Format, imageInfo.Size, imageInfo.Dimensions, imageInfo.Levels, imageInfo.Layers, imageInfo.Samples, allocationInfo.Usage, allocationBehavior);
10219 auto& bufferInfo = std::get<ResourceAllocationInfo::BufferInfo>(allocationInfo.ResourceInfo);
10221 if (bufferInfo.Type == BufferType::Vertex && bufferInfo.VertexBufferLayout != nullptr)
10222 return std::dynamic_pointer_cast<IBuffer>(
10223 this->createVertexBuffer(allocationInfo.Name, *bufferInfo.VertexBufferLayout, bufferInfo.Heap, bufferInfo.Elements, allocationInfo.Usage, allocationBehavior));
10224 else if (bufferInfo.Type == BufferType::Index && bufferInfo.IndexBufferLayout != nullptr)
10225 return std::dynamic_pointer_cast<IBuffer>(
10226 this->createIndexBuffer(allocationInfo.Name, *bufferInfo.IndexBufferLayout, bufferInfo.Heap, bufferInfo.Elements, allocationInfo.Usage, allocationBehavior));
10228 return this->createBuffer(allocationInfo.Name, bufferInfo.Type, bufferInfo.Heap, bufferInfo.ElementSize, bufferInfo.Elements, allocationInfo.Usage, allocationBehavior);
10275 return this->getBuffer(type, heap, elementSize, elements, usage, allocationBehavior);
10290 return this->tryGetBuffer(buffer, type, heap, elementSize, elements, usage, allocationBehavior);
10304 auto& descriptor = descriptorSet.
descriptor(binding);
10305 return this->
createBuffer(descriptor.type(), heap, descriptor.elementSize(), elements, usage, allocationBehavior);
10320 auto& descriptor = descriptorSet.
descriptor(binding);
10321 return this->
tryCreateBuffer(buffer, descriptor.type(), heap, descriptor.elementSize(), elements, usage, allocationBehavior);
10335 auto& descriptor = descriptorSet.
descriptor(binding);
10336 return this->
createBuffer(descriptor.type(), heap, elementSize, elements, usage, allocationBehavior);
10351 auto& descriptor = descriptorSet.
descriptor(binding);
10352 return this->
tryCreateBuffer(buffer, descriptor.type(), heap, elementSize, elements, usage, allocationBehavior);
10367 return this->
createBuffer(pipeline.
layout()->descriptorSet(space), binding, heap, elementSize, elements, usage, allocationBehavior);
10383 return this->
tryCreateBuffer(buffer, pipeline.
layout()->descriptorSet(space), binding, heap, elementSize, elements, usage, allocationBehavior);
10398 return this->
createBuffer(pipeline.
layout()->descriptorSet(space), binding, heap, elements, usage, allocationBehavior);
10414 return this->
tryCreateBuffer(buffer, pipeline.
layout()->descriptorSet(space), binding, heap, elements, usage, allocationBehavior);
10429 return this->getBuffer(name, type, heap, elementSize, elements, usage, allocationBehavior);
10445 return this->tryGetBuffer(buffer, name, type, heap, elementSize, elements, usage, allocationBehavior);
10460 auto& descriptor = descriptorSet.
descriptor(binding);
10461 return this->
createBuffer(name, descriptor.type(), heap, descriptor.elementSize(), elements, usage, allocationBehavior);
10477 auto& descriptor = descriptorSet.
descriptor(binding);
10478 return this->
tryCreateBuffer(buffer, name, descriptor.type(), heap, descriptor.elementSize(), elements, usage, allocationBehavior);
10494 auto& descriptor = descriptorSet.
descriptor(binding);
10495 return this->
createBuffer(name, descriptor.type(), heap, elementSize, elements, usage, allocationBehavior);
10512 auto& descriptor = descriptorSet.
descriptor(binding);
10513 return this->
tryCreateBuffer(buffer, name, descriptor.type(), heap, elementSize, elements, usage, allocationBehavior);
10529 return this->
createBuffer(name, pipeline.
layout()->descriptorSet(space), binding, heap, elements, usage, allocationBehavior);
10546 return this->
tryCreateBuffer(buffer, name, pipeline.
layout()->descriptorSet(space), binding, heap, elements, usage, allocationBehavior);
10563 return this->
createBuffer(name, pipeline.
layout()->descriptorSet(space), binding, heap, elementSize, elements, usage, allocationBehavior);
10581 return this->
tryCreateBuffer(buffer, name, pipeline.
layout()->descriptorSet(space), binding, heap, elementSize, elements, usage, allocationBehavior);
10599 return this->getVertexBuffer(layout, heap, elements, usage, allocationBehavior);
10613 return this->tryGetVertexBuffer(buffer, layout, heap, elements, usage, allocationBehavior);
10632 return this->getVertexBuffer(name, layout, heap, elements, usage, allocationBehavior);
10647 return this->tryGetVertexBuffer(buffer, name, layout, heap, elements, usage, allocationBehavior);
10665 return this->getIndexBuffer(layout, heap, elements, usage, allocationBehavior);
10679 return this->tryGetIndexBuffer(buffer, layout, heap, elements, usage, allocationBehavior);
10698 return this->getIndexBuffer(name, layout, heap, elements, usage, allocationBehavior);
10713 return this->tryGetIndexBuffer(buffer, name, layout, heap, elements, usage, allocationBehavior);
10734 return this->getTexture(format, size, dimension, levels, layers, samples, usage, allocationBehavior);
10751 return this->tryGetTexture(image, format, size, dimension, levels, layers, samples, usage, allocationBehavior);
10773 return this->getTexture(name, format, size, dimension, levels, layers, samples, usage, allocationBehavior);
10791 return this->tryGetTexture(image, name, format, size, dimension, levels, layers, samples, usage, allocationBehavior);
10807 return this->getTextures(format, size, dimension, layers, levels, samples, usage, allocationBehavior);
10826 return this->getSampler(magFilter, minFilter, borderU, borderV, borderW, mipMapMode, mipMapBias, maxLod, minLod, anisotropy);
10845 inline SharedPtr<ISampler> 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 {
10846 return this->getSampler(name, magFilter, minFilter, borderU, borderV, borderW, mipMapMode, mipMapBias, maxLod, minLod, anisotropy);
10865 return this->getSamplers(magFilter, minFilter, borderU, borderV, borderW, mipMapMode, mipMapBias, maxLod, minLod, anisotropy);
10892 return this->getBlas(name, flags);
10919 return this->getTlas(name, flags);
10967 virtual
SharedPtr<
ISampler> getSampler(const
String& name,
FilterMode magFilter,
FilterMode minFilter,
BorderMode borderU,
BorderMode borderV,
BorderMode borderW,
MipMapMode mipMapMode,
Float mipMapBias,
Float maxLod,
Float minLod,
Float anisotropy) const = 0;
11112 return this->getDefaultQueue(type);
11134 return this->getNewQueue(type, priority);
11144 return this->getNewBarrier(syncBefore, syncAfter);
11163 return this->getNewFrameBuffer(name, renderArea);
11199 this->getAccelerationStructureSizes(blas, bufferSize, scratchSize, forUpdate);
11217 this->getAccelerationStructureSizes(tlas, bufferSize, scratchSize, forUpdate);
11227 return this->doAllocateGlobalDescriptors(descriptorSet, heapType);
11240 this->doReleaseGlobalDescriptors(descriptorSet);
11251 this->doUpdateGlobalDescriptors(descriptorSet, binding, offset, descriptors);
11265 this->doBindDescriptorSet(commandBuffer, descriptorSet, pipeline);
11273 this->doBindGlobalDescriptorHeaps(commandBuffer);
11280 virtual void doReleaseGlobalDescriptors(
const IDescriptorSet& descriptorSet)
const = 0;
11283 virtual void doBindGlobalDescriptorHeaps(
const ICommandBuffer& commandBuffer)
const noexcept = 0;
11322 return this->getAdapters();
11377 template <
typename T>
Definition buffer_attribute.cpp:9
Definition depth_stencil_state.cpp:9
Definition device_state.cpp:9
An exception that is thrown, if a provided non-optional argument was not initialized.
Definition exceptions.hpp:185
Base class for additional event arguments.
Definition app.hpp:86
A class that is used to declare an event, which a number of listeners can subscribe to.
Definition app.hpp:168
virtual StringView name() const noexcept=0
Gets the name of the backend.
IBackend() noexcept=default
An exception that is thrown, if a provided argument is not valid.
Definition exceptions.hpp:60
Stores meta data about a buffer attribute, i.e. a member or field of a descriptor or buffer.
Definition rendering_api.hpp:4437
virtual ~BufferAttribute() noexcept
Releases the buffer attribute instance.
BufferAttribute & operator=(const BufferAttribute &_other)
Assigns a buffer attribute by copying it.
virtual UInt32 offset() const noexcept
Returns the offset of the buffer attribute.
Definition buffer_attribute.cpp:57
BufferAttribute() noexcept
Initializes an empty buffer attribute.
Definition buffer_attribute.cpp:31
virtual UInt32 location() const noexcept
Returns the location of the buffer attribute.
Definition buffer_attribute.cpp:47
virtual UInt32 semanticIndex() const noexcept
Returns the semantic index of the buffer attribute.
Definition buffer_attribute.cpp:67
BufferAttribute(const BufferAttribute &_other)
Creates a copy of a buffer attribute.
virtual AttributeSemantic semantic() const noexcept
Returns the semantic of the buffer attribute.
Definition buffer_attribute.cpp:62
BufferAttribute(BufferAttribute &&_other) noexcept
Takes over another instance of a buffer attribute.
BufferAttribute & operator=(BufferAttribute &&_other) noexcept
Assigns a buffer attribute by taking it over.
virtual BufferFormat format() const noexcept
Returns the format of the buffer attribute.
Definition buffer_attribute.cpp:52
Stores the depth/stencil state of a see IRasterizer.
Definition rendering_api.hpp:3751
DepthStencilState() noexcept
Initializes a new rasterizer depth/stencil state.
DepthStencilState(const DepthState &depthState, const DepthBias &depthBias, const StencilState &stencilState) noexcept
Initializes a new rasterizer depth/stencil state.
Definition depth_stencil_state.cpp:33
virtual DepthState & depthState() const noexcept
Returns the depth state.
Definition depth_stencil_state.cpp:44
virtual DepthBias & depthBias() const noexcept
Returns the depth bias.
Definition depth_stencil_state.cpp:49
virtual StencilState & stencilState() const noexcept
Returns the stencil state.
Definition depth_stencil_state.cpp:54
A class that can be used to manage the state of a IGraphicsDevice.
Definition rendering_api.hpp:2697
IVertexBuffer & vertexBuffer(const String &id) const
Returns a vertex buffer from the device state.
Definition device_state.cpp:286
IIndexBuffer & indexBuffer(const String &id) const
Returns an index buffer from the device state.
Definition device_state.cpp:294
friend class IGraphicsDevice
Definition rendering_api.hpp:2699
IAccelerationStructure & accelerationStructure(const String &id) const
Returns an acceleration structure from the device state.
Definition device_state.cpp:318
DeviceState(DeviceState &&_other) noexcept
Takes over another instance of a device state.
ISampler & sampler(const String &id) const
Returns a sampler from the device state.
Definition device_state.cpp:310
void clear()
Release all resources managed by the device state.
Definition device_state.cpp:39
IImage & image(const String &id) const
Returns an image from the device state.
Definition device_state.cpp:302
IRenderPass & renderPass(const String &id) const
Returns a render pass from the device state.
Definition device_state.cpp:254
bool release(const IRenderPass &renderPass)
Releases a render pass.
Definition device_state.cpp:334
IPipeline & pipeline(const String &id) const
Returns a pipeline from the device state.
Definition device_state.cpp:270
DeviceState()
Creates a new device state instance.
IBuffer & buffer(const String &id) const
Returns a buffer from the device state.
Definition device_state.cpp:278
IDescriptorSet & descriptorSet(const String &id) const
Returns a descriptor set from the device state.
Definition device_state.cpp:326
IFrameBuffer & frameBuffer(const String &id) const
Returns a frame buffer from the device state.
Definition device_state.cpp:262
DeviceState & operator=(DeviceState &&_other) noexcept
Assigns a device state by taking it over.
void add(SharedPtr< IRenderPass > &&renderPass)
Adds a new render pass to the device state and uses its name as identifier.
Definition device_state.cpp:99
Base interface for a ray tracing acceleration structure.
Definition rendering_api.hpp:5260
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
virtual UInt64 size() const noexcept=0
Returns the amount of memory in bytes inside buffer that store the acceleration structure.
SharedPtr< const IBuffer > buffer() const noexcept
Returns the acceleration structure backing buffer, that stores its last build.
Definition rendering_api.hpp:5351
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
virtual UInt64 offset() const noexcept=0
Returns the offset into buffer at which the acceleration structure is stored.
virtual AccelerationStructureFlags flags() const noexcept=0
Returns the flags that control how the acceleration structure should be built.
The interface for a barrier.
Definition rendering_api.hpp:5921
virtual constexpr PipelineStage syncAfter() const noexcept=0
Returns the stage all subsequent commands need to wait for before continuing execution.
virtual constexpr void wait(ResourceAccess accessBefore, ResourceAccess accessAfter)=0
Inserts a global barrier that waits for previous commands to finish accesses described by accessBefor...
constexpr void transition(const IImage &image, UInt32 level, UInt32 levels, UInt32 layer, UInt32 layers, UInt32 plane, ResourceAccess accessBefore, ResourceAccess accessAfter, ImageLayout layout)
Inserts an image barrier that blocks access to a sub-resource range of image of the types contained ...
Definition rendering_api.hpp:6007
constexpr void transition(const IImage &image, UInt32 level, UInt32 levels, UInt32 layer, UInt32 layers, UInt32 plane, ResourceAccess accessBefore, ResourceAccess accessAfter, ImageLayout fromLayout, ImageLayout toLayout)
Inserts an image barrier that blocks access to a sub-resource range of image of the types contained ...
Definition rendering_api.hpp:6048
constexpr void transition(const IBuffer &buffer, ResourceAccess accessBefore, ResourceAccess accessAfter)
Inserts a buffer barrier that blocks access to buffer of types contained in accessAfter for subsequ...
Definition rendering_api.hpp:5960
constexpr void transition(const IImage &image, ResourceAccess accessBefore, ResourceAccess accessAfter, ImageLayout layout)
Inserts an image barrier that blocks access to all sub-resources of image of the types contained in ...
Definition rendering_api.hpp:5989
IBarrier() noexcept=default
virtual constexpr PipelineStage syncBefore() const noexcept=0
Returns the stage that all previous commands need to reach before continuing execution.
constexpr void transition(const IBuffer &buffer, UInt32 element, ResourceAccess accessBefore, ResourceAccess accessAfter)
Inserts a buffer barrier that blocks access to a buffer s element of types contained in accessAfter ...
Definition rendering_api.hpp:5976
constexpr void transition(const IImage &image, ResourceAccess accessBefore, ResourceAccess accessAfter, ImageLayout fromLayout, ImageLayout toLayout)
Inserts an image barrier that blocks access to all sub-resources of image of the types contained in ...
Definition rendering_api.hpp:6025
A structure that holds a singular entity of geometry for hardware ray-tracing.
Definition rendering_api.hpp:5399
virtual void clear() noexcept=0
Clears all bounding boxes and triangle meshes from the acceleration structure.
auto withBoundingBox(this TSelf &&self, const SharedPtr< const IBuffer > &buffer, GeometryFlags flags=GeometryFlags::None) -> TSelf &&
Adds a buffer containing axis-aligned bounding boxes to the BLAS.
Definition rendering_api.hpp:5669
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
virtual void addTriangleMesh(const TriangleMesh &mesh)=0
Adds a triangle mesh to the BLAS.
IBottomLevelAccelerationStructure() noexcept=default
auto withTriangleMesh(this TSelf &&self, const TriangleMesh &mesh) -> TSelf &&
Adds a triangle mesh to the BLAS.
Definition rendering_api.hpp:5630
virtual bool remove(const TriangleMesh &mesh) noexcept=0
Removes a triangle mesh from the acceleration structure.
auto withTriangleMesh(this TSelf &&self, const SharedPtr< const IVertexBuffer > &vertexBuffer, const SharedPtr< const IIndexBuffer > &indexBuffer=nullptr, const SharedPtr< const IBuffer > &transformBuffer=nullptr, GeometryFlags flags=GeometryFlags::None) -> TSelf &&
Adds a triangle mesh to the BLAS.
Definition rendering_api.hpp:5645
virtual void addBoundingBox(const BoundingBoxes &aabbs)=0
Adds a buffer containing axis-aligned bounding boxes to the BLAS.
auto withBoundingBox(this TSelf &&self, const BoundingBoxes &aabb) -> TSelf &&
Adds a buffer containing axis-aligned bounding boxes to the BLAS.
Definition rendering_api.hpp:5656
virtual const Array< BoundingBoxes > & boundingBoxes() const noexcept=0
Returns an array of buffers, each containing axis-aligned bounding boxes stored in the BLAS.
virtual const Array< TriangleMesh > & triangleMeshes() const noexcept=0
Returns an array of triangle meshes contained by the BLAS.
Base interface for buffer objects.
Definition rendering_api.hpp:4997
virtual BufferType type() const noexcept=0
Returns the type of the buffer.
IBuffer() noexcept=default
Describes a buffer layout.
Definition rendering_api.hpp:4536
virtual BufferType type() const noexcept=0
Returns the buffer type of the buffer.
IBufferLayout() noexcept=default
virtual UInt32 binding() const noexcept=0
Returns the binding point, the buffer will be bound to.
virtual size_t elementSize() const noexcept=0
Returns the size of a single element within the buffer.
The interface for a command buffer.
Definition rendering_api.hpp:7682
virtual UInt64 submit() const =0
Submits the command buffer to parent command.
void traceRays(UInt32 width, UInt32 height, UInt32 depth, const ShaderBindingTableOffsets &offsets, const IBuffer &rayGenerationShaderBindingTable, const IBuffer *missShaderBindingTable=nullptr, const IBuffer *hitShaderBindingTable=nullptr, const IBuffer *callableShaderBindingTable=nullptr) const noexcept
Executes a query on a ray-tracing pipeline.
Definition rendering_api.hpp:8349
virtual void setBlendFactors(const Vector4f &blendFactors) const noexcept=0
Sets the blend factors for the subsequent draw calls.
void updateAccelerationStructure(ITopLevelAccelerationStructure &tlas, const SharedPtr< const IBuffer > &scratchBuffer, const IBuffer &buffer, UInt64 offset=0) const
Updates a top-level acceleration structure.
Definition rendering_api.hpp:8633
virtual void track(SharedPtr< const IBuffer > buffer) const =0
Sets up tracking for a buffer, so that it will not be destroyed until the command buffer has been exe...
void drawIndirect(const IBuffer &batchBuffer, const IBuffer &countBuffer, UInt64 offset=0, UInt64 countOffset=0, UInt32 maxBatches=std::numeric_limits< UInt32 >::max()) const noexcept
Executes a set of indirect non-indexed draw calls.
Definition rendering_api.hpp:8413
void barrier(const IBarrier &barrier) const noexcept
Executes the transitions that have been added to barrier .
Definition rendering_api.hpp:7791
ICommandBuffer() noexcept=default
virtual void setViewports(const IViewport *viewport) const =0
Sets the viewport used for the subsequent draw calls.
void transfer(Span< const void *const > data, size_t elementSize, const IImage &target, UInt32 firstSubresource=0, UInt32 elements=1) const
Performs a buffer-to-buffer transfer from a temporary buffer into target .
Definition rendering_api.hpp:7985
void bind(const IDescriptorSet &descriptorSet) const
Binds the provided descriptor to the last pipeline that was used by the command buffer.
Definition rendering_api.hpp:8128
void pushConstants(const IPushConstantsLayout &layout, const void *const memory) const
Pushes a block of memory into the push constants backing memory.
Definition rendering_api.hpp:8488
void bind(this const TSelf &self, std::ranges::input_range auto &&descriptorSets, const typename TSelf::pipeline_type &pipeline)
Binds an arbitrary input range of descriptor sets to the provided pipeline.
Definition rendering_api.hpp:8214
void buildAccelerationStructure(ITopLevelAccelerationStructure &tlas, const SharedPtr< const IBuffer > &scratchBuffer, const IBuffer &buffer, UInt64 offset=0) const
Builds a top-level acceleration structure.
Definition rendering_api.hpp:8601
void transfer(const void *const data, size_t size, const IImage &target, UInt32 subresource=0) const
Performs a buffer-to-buffer transfer from a temporary buffer into target .
Definition rendering_api.hpp:7968
void dispatchMesh(UInt32 x, UInt32 y, UInt32 z) const noexcept
Executes a mesh shader pipeline.
Definition rendering_api.hpp:8307
void transfer(const IBuffer &source, const IBuffer &target, UInt32 sourceElement=0, UInt32 targetElement=0, UInt32 elements=1) const
Performs a buffer-to-buffer transfer from source to target .
Definition rendering_api.hpp:7809
virtual void drawIndexed(UInt32 indices, UInt32 instances=1, UInt32 firstIndex=0, Int32 vertexOffset=0, UInt32 firstInstance=0) const noexcept=0
Draws the currently bound vertex buffer with a set of indices from the currently bound index buffer.
void copyAccelerationStructure(const ITopLevelAccelerationStructure &from, const ITopLevelAccelerationStructure &to, bool compress=false) const noexcept
Copies the acceleration structure from into the acceleration structure to .
Definition rendering_api.hpp:8667
virtual void dispatchMesh(const Vector3u &threadGroupCount) const noexcept=0
Executes a mesh shader pipeline.
virtual void setDepthBounds(Float minBounds, Float maxBounds) const noexcept=0
Sets the depth range for the depth bounds test.
virtual bool isSecondary() const noexcept=0
Returns true, if the command buffer is a secondary command buffer, or false otherwise.
virtual void writeTimingEvent(const SharedPtr< const TimingEvent > &timingEvent) const =0
Writes the current GPU time stamp value for the timing event.
void bind(const IVertexBuffer &buffer) const
Binds a vertex buffer to the pipeline.
Definition rendering_api.hpp:8244
void execute(const SharedPtr< const ICommandBuffer > &commandBuffer) const
Executes a secondary command buffer/bundle.
Definition rendering_api.hpp:8561
void updateAccelerationStructure(IBottomLevelAccelerationStructure &blas, const SharedPtr< const IBuffer > &scratchBuffer, const IBuffer &buffer, UInt64 offset=0) const
Updates a bottom-level acceleration structure.
Definition rendering_api.hpp:8617
virtual void end() const =0
Ends recording commands on the command buffer.
void transfer(const SharedPtr< const IImage > &source, const IBuffer &target, UInt32 firstSubresource=0, UInt32 targetElement=0, UInt32 subresources=1) const
Performs an image-to-buffer transfer from source to target .
Definition rendering_api.hpp:8111
void drawIndexed(const IVertexBuffer &vertexBuffer, const IIndexBuffer &indexBuffer, UInt32 instances=1, UInt32 firstIndex=0, Int32 vertexOffset=0, UInt32 firstInstance=0) const
Draws the vertex buffer provided by vertexBuffer using the index buffer, provided by indexBuffer .
Definition rendering_api.hpp:8455
virtual void releaseSharedState() const =0
Called by the parent command queue to signal that the command buffer should release it's shared state...
virtual void setScissors(const IScissor *scissor) const =0
Sets the scissor rectangle used for the subsequent draw calls.
void bind(this const TSelf &self, std::ranges::input_range auto &&descriptorSets)
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command b...
Definition rendering_api.hpp:8159
void transfer(const IImage &source, const IImage &target, UInt32 sourceSubresource=0, UInt32 targetSubresource=0, UInt32 subresources=1) const
Performs an image-to-image transfer from source to target .
Definition rendering_api.hpp:8002
void bind(Span< const IDescriptorSet * > descriptorSets) const
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command b...
Definition rendering_api.hpp:8174
void transfer(const SharedPtr< const IImage > &source, const IImage &target, UInt32 sourceSubresource=0, UInt32 targetSubresource=0, UInt32 subresources=1) const
Performs an image-to-image transfer from source to target .
Definition rendering_api.hpp:8026
void transfer(const IBuffer &source, const IImage &target, UInt32 sourceElement=0, UInt32 firstSubresource=0, UInt32 elements=1) const
Performs a buffer-to-image transfer from source to target .
Definition rendering_api.hpp:7905
void execute(Enumerable< SharedPtr< const ICommandBuffer > > commandBuffers) const
Executes a series of secondary command buffers/bundles.
Definition rendering_api.hpp:8569
void use(const IPipeline &pipeline) const noexcept
Sets the active pipeline state.
Definition rendering_api.hpp:8118
SharedPtr< const ICommandQueue > queue() const noexcept
Gets a pointer to the command queue that this command buffer was allocated from or nullptr,...
Definition rendering_api.hpp:7768
void transfer(const SharedPtr< const IBuffer > &source, const IBuffer &target, UInt32 sourceElement=0, UInt32 targetElement=0, UInt32 elements=1) const
Performs a buffer-to-buffer transfer from source to target .
Definition rendering_api.hpp:7833
friend class ICommandQueue
Definition rendering_api.hpp:7684
void copyAccelerationStructure(const IBottomLevelAccelerationStructure &from, const IBottomLevelAccelerationStructure &to, bool compress=false) const noexcept
Copies the acceleration structure from into the acceleration structure to .
Definition rendering_api.hpp:8650
virtual void dispatch(const Vector3u &threadGroupCount) const noexcept=0
Executes a compute shader.
void drawIndexedIndirect(const IBuffer &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept
Executes a set of indirect indexed draw calls.
Definition rendering_api.hpp:8466
void transfer(const void *const data, size_t size, const IBuffer &target, UInt32 targetElement=0, UInt32 elements=1) const
Performs a buffer-to-buffer transfer from a temporary buffer into target .
Definition rendering_api.hpp:7850
void transfer(const SharedPtr< const IBuffer > &source, const IImage &target, UInt32 sourceElement=0, UInt32 firstSubresource=0, UInt32 elements=1) const
Performs a buffer-to-image transfer from source to target .
Definition rendering_api.hpp:7951
virtual void setScissors(Span< const IScissor * > scissors) const =0
Sets the scissor rectangles used for the subsequent draw calls.
void dispatch(UInt32 x, UInt32 y, UInt32 z) const noexcept
Executes a compute shader.
Definition rendering_api.hpp:8274
void dispatchIndirect(const IBuffer &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept
Executes a set of indirect dispatches.
Definition rendering_api.hpp:8285
void traceRays(const Vector3u &dimensions, const ShaderBindingTableOffsets &offsets, const IBuffer &rayGenerationShaderBindingTable, const IBuffer *missShaderBindingTable=nullptr, const IBuffer *hitShaderBindingTable=nullptr, const IBuffer *callableShaderBindingTable=nullptr) const noexcept
Executes a query on a ray-tracing pipeline.
Definition rendering_api.hpp:8365
virtual void setViewports(Span< const IViewport * > viewports) const =0
Sets the viewports used for the subsequent draw calls.
void dispatchMeshIndirect(const IBuffer &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept
Executes a set of indirect mesh shader dispatches.
Definition rendering_api.hpp:8318
void transfer(Span< const void *const > data, size_t elementSize, const IBuffer &target, UInt32 targetElement=0) const
Performs a buffer-to-buffer transfer from a temporary buffer into target .
Definition rendering_api.hpp:7866
void drawIndirect(const IBuffer &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept
Executes a set of indirect non-indexed draw calls.
Definition rendering_api.hpp:8400
UniquePtr< IBarrier > makeBarrier(PipelineStage syncBefore, PipelineStage syncAfter) const
Creates a new barrier instance.
Definition rendering_api.hpp:7778
virtual void begin() const =0
Sets the command buffer into recording state, so that it can receive command that should be submitted...
void bind(this const TSelf &self, std::initializer_list< const T * > descriptorSets, const typename TSelf::pipeline_type &pipeline)
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command b...
Definition rendering_api.hpp:8198
void bind(Span< const IDescriptorSet * > descriptorSets, const IPipeline &pipeline) const
Binds an arbitrary input range of descriptor sets to the provided pipeline.
Definition rendering_api.hpp:8230
virtual void setStencilRef(UInt32 stencilRef) const noexcept=0
Sets the stencil reference for the subsequent draw calls.
void bind(const IDescriptorSet &descriptorSet, const IPipeline &pipeline) const
Binds the provided descriptor set to the provided pipeline.
Definition rendering_api.hpp:8183
void bind(this const TSelf &self, std::initializer_list< const T * > descriptorSets)
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command b...
Definition rendering_api.hpp:8142
void bind(const IIndexBuffer &buffer) const
Binds a index buffer to the pipeline.
Definition rendering_api.hpp:8257
void transfer(const IImage &source, const IBuffer &target, UInt32 firstSubresource=0, UInt32 targetElement=0, UInt32 subresources=1) const
Performs an image-to-buffer transfer from source to target .
Definition rendering_api.hpp:8065
void buildAccelerationStructure(IBottomLevelAccelerationStructure &blas, const SharedPtr< const IBuffer > &scratchBuffer, const IBuffer &buffer, UInt64 offset=0) const
Builds a bottom-level acceleration structure.
Definition rendering_api.hpp:8585
virtual void draw(UInt32 vertices, UInt32 instances=1, UInt32 firstVertex=0, UInt32 firstInstance=0) const noexcept=0
Draws a number of vertices from the currently bound vertex buffer.
void drawIndexedIndirect(const IBuffer &batchBuffer, const IBuffer &countBuffer, UInt64 offset=0, UInt64 countOffset=0, UInt32 maxBatches=std::numeric_limits< UInt32 >::max()) const noexcept
Executes a set of indirect indexed draw calls.
Definition rendering_api.hpp:8479
void dispatchMeshIndirect(const IBuffer &batchBuffer, const IBuffer &countBuffer, UInt64 offset=0, UInt64 countOffset=0, UInt32 maxBatches=std::numeric_limits< UInt32 >::max()) const noexcept
Executes a set of indirect mesh shader dispatches.
Definition rendering_api.hpp:8331
The interface for a command queue.
Definition rendering_api.hpp:9742
virtual UInt64 lastCompletedFence() const noexcept=0
Returns the last fence that was completed on the queue.
void releaseSharedState(const ICommandBuffer &commandBuffer) const
Definition rendering_api.hpp:9977
ICommandQueue() noexcept=default
Event< QueueSubmittingEventArgs > submitting
Invoked, when one or more command buffers are submitted to the queue.
Definition rendering_api.hpp:9860
Event< QueueSubmittedEventArgs > submitted
Invoked, after one or more command buffers have been submitted to the queue.
Definition rendering_api.hpp:9865
virtual UInt64 currentFence() const noexcept=0
Returns the value of the latest fence inserted into the queue.
virtual void waitFor(UInt64 fence) const =0
Lets the CPU wait for a certain fence value to complete on the command queue.
virtual void beginDebugRegion(const String &label, const Vectors::ByteVector3 &color=DEFAULT_DEBUG_COLOR) const noexcept
Starts a new debug region.
Definition rendering_api.hpp:9836
SharedPtr< ICommandBuffer > createCommandBuffer(bool beginRecording=false, bool secondary=false) const
Creates a command buffer that can be used to allocate commands on the queue.
Definition rendering_api.hpp:9880
virtual void setDebugMarker(const String &label, const Vectors::ByteVector3 &color=DEFAULT_DEBUG_COLOR) const noexcept
Inserts a debug marker.
Definition rendering_api.hpp:9854
UInt64 submit(const SharedPtr< const ICommandBuffer > &commandBuffer) const
Submits a single command buffer with shared ownership and inserts a fence to wait for it.
Definition rendering_api.hpp:9896
virtual QueueType type() const noexcept=0
Returns the type of the queue.
UInt64 submit(Enumerable< SharedPtr< const ICommandBuffer > > commandBuffers) const
Submits a set of command buffers with shared ownership and inserts a fence to wait for them.
Definition rendering_api.hpp:9928
virtual QueuePriority priority() const noexcept=0
Returns the priority of the queue.
virtual void endDebugRegion() const noexcept
Ends the current debug region.
Definition rendering_api.hpp:9844
void waitFor(const ICommandQueue &queue, UInt64 fence) const
Lets the command queue wait for a certain fence value to complete on another queue.
Definition rendering_api.hpp:9951
static constexpr Vectors::ByteVector3 DEFAULT_DEBUG_COLOR
The default color value for a debug region or marker, if no other has been specified.
Definition rendering_api.hpp:9826
UInt64 submit(const SharedPtr< ICommandBuffer > &commandBuffer) const
Submits a single command buffer with shared ownership and inserts a fence to wait for it.
Definition rendering_api.hpp:9912
The interface for a compute pipeline.
Definition rendering_api.hpp:8795
IComputePipeline() noexcept=default
Describes a the layout of a single descriptor within a DescriptorSet.
Definition rendering_api.hpp:4641
virtual DescriptorType descriptorType() const noexcept=0
Returns the type of the descriptor.
IDescriptorLayout() noexcept=default
virtual const ISampler * staticSampler() const noexcept=0
If the descriptor describes a static sampler, this method returns the state of the sampler....
virtual bool unbounded() const noexcept=0
Returns true, if the descriptor defines an unbounded descriptor array.
virtual UInt32 descriptors() const noexcept=0
Returns the number of descriptors in the descriptor array.
The interface for a descriptor set.
Definition rendering_api.hpp:6064
UInt32 bindToHeap(UInt32 descriptor, const ISampler &sampler) const
Binds a sampler directly to a descriptor heap and returns the index that can be used to access it.
Definition rendering_api.hpp:6141
UInt32 bindToHeap(DescriptorType bindingType, UInt32 descriptor, const IImage &image, UInt32 firstLevel=0, UInt32 levels=0, UInt32 firstLayer=0, UInt32 layers=0) const
Binds a resource directly to a descriptor heap and returns the index that can be used to access it.
Definition rendering_api.hpp:6124
IDescriptorSet() noexcept=default
void update(UInt32 binding, const IImage &texture, UInt32 descriptor=0, UInt32 firstLevel=0, UInt32 levels=0, UInt32 firstLayer=0, UInt32 layers=0) const
Updates one or more texture descriptors within the current descriptor set.
Definition rendering_api.hpp:6179
UInt32 bindToHeap(DescriptorType bindingType, UInt32 descriptor, const IBuffer &buffer, UInt32 bufferElement=0, UInt32 elements=0, Format texelFormat=Format::None) const
Binds a resource directly to a descriptor heap and returns the index that can be used to access it.
Definition rendering_api.hpp:6101
void update(UInt32 binding, const IAccelerationStructure &accelerationStructure, UInt32 descriptor=0) const
Updates an acceleration structure within the current descriptor set.
Definition rendering_api.hpp:6199
void update(UInt32 binding, const IBuffer &buffer, UInt32 bufferElement=0, UInt32 elements=0, UInt32 firstDescriptor=0, Format texelFormat=Format::None) const
Updates one or more buffer descriptors within the current descriptor set.
Definition rendering_api.hpp:6154
void update(UInt32 binding, const ISampler &sampler, UInt32 descriptor=0) const
Updates one or more sampler descriptors within the current descriptor set.
Definition rendering_api.hpp:6189
virtual VirtualAllocator::Allocation globalHeapAllocation(DescriptorHeapType heapType) const noexcept=0
Returns the allocation information for the descriptor set in the global descriptor heap indicated by ...
The interface for a descriptor set layout.
Definition rendering_api.hpp:6290
virtual UInt32 staticSamplers() const noexcept=0
Returns the number of static or immutable sampler descriptors within the descriptor set.
virtual UInt32 space() const noexcept=0
Returns the space index of the descriptor set.
UniquePtr< IDescriptorSet > allocate(Generator< DescriptorBinding > bindings) const
Definition rendering_api.hpp:6445
virtual UInt32 images() const noexcept=0
Returns the number of image (i.e. texture) descriptors within the descriptor set.
virtual UInt32 inputAttachments() const noexcept=0
Returns the number of input attachment descriptors within the descriptor set.
virtual UInt32 storages() const noexcept=0
Returns the number of structured and byte address buffer descriptors within the descriptor set.
virtual bool bindsResources() const noexcept=0
Returns true if the descriptor set layout contains bindings for resources (i.e., bindings that aren't...
virtual UInt32 buffers() const noexcept=0
Returns the number of texel buffer descriptors within the descriptor set.
UniquePtr< IDescriptorSet > allocate(UInt32 descriptors, Generator< DescriptorBinding > bindings) const
Allocates an array of descriptor sets.
Definition rendering_api.hpp:6473
IDescriptorSetLayout() noexcept=default
Enumerable< const IDescriptorLayout & > descriptors() const noexcept
Returns the layouts of the descriptors within the descriptor set.
Definition rendering_api.hpp:6306
virtual UInt32 uniforms() const noexcept=0
Returns the number of uniform/constant buffer descriptors within the descriptor set.
void free(const IDescriptorSet &descriptorSet) const
Marks a descriptor set as unused, so that it can be handed out again instead of allocating a new one.
Definition rendering_api.hpp:6541
virtual UInt32 samplers() const noexcept=0
Returns the number of dynamic sampler descriptors within the descriptor set.
Generator< UniquePtr< IDescriptorSet > > allocate(UInt32 descriptorSets, UInt32 descriptors, std::initializer_list< std::initializer_list< DescriptorBinding > > bindings={ }) const
Allocates an array of descriptor sets.
Definition rendering_api.hpp:6514
Generator< UniquePtr< IDescriptorSet > > allocate(UInt32 descriptorSets, std::function< Generator< DescriptorBinding >(UInt32)> bindingFactory) const
Allocates an array of descriptor sets.
Definition rendering_api.hpp:6502
virtual ShaderStage shaderStages() const noexcept=0
Returns the shader stages, the descriptor set is used in.
UniquePtr< IDescriptorSet > allocate(Span< DescriptorBinding > bindings) const
Definition rendering_api.hpp:6440
virtual UInt32 getDescriptorOffset(UInt32 binding, UInt32 element=0) const =0
Returns the offset for a descriptor within a descriptor set of this layout.
virtual const IDescriptorLayout & descriptor(UInt32 binding) const =0
Returns the descriptor layout for the descriptor bound to the binding point provided with binding .
virtual bool containsUnboundedArray() const noexcept=0
Returns true, if the descriptor set layout contains an unbounded runtime array and false otherwise.
Generator< UniquePtr< IDescriptorSet > > allocate(UInt32 descriptorSets, std::initializer_list< std::initializer_list< DescriptorBinding > > bindings={ }) const
Allocates an array of descriptor sets.
Definition rendering_api.hpp:6484
Generator< UniquePtr< IDescriptorSet > > allocate(UInt32 descriptorSets, UInt32 descriptors, std::function< Generator< DescriptorBinding >(UInt32)> bindingFactory) const
Allocates an array of descriptor sets.
Definition rendering_api.hpp:6533
UniquePtr< IDescriptorSet > allocate(UInt32 descriptors, std::initializer_list< DescriptorBinding > bindings) const
Allocates a new descriptor set or returns an instance of an unused descriptor set.
Definition rendering_api.hpp:6457
virtual bool bindsSamplers() const noexcept=0
Returns true if the descriptor set layout contains bindings for samplers and false otherwise.
UniquePtr< IDescriptorSet > allocate(std::initializer_list< DescriptorBinding > bindings={ }) const
Allocates a new descriptor set or returns an instance of an unused descriptor set.
Definition rendering_api.hpp:6435
UniquePtr< IDescriptorSet > allocate(UInt32 descriptors, Span< DescriptorBinding > bindings) const
Definition rendering_api.hpp:6462
Describes a chunk of device memory.
Definition rendering_api.hpp:4758
virtual ResourceUsage usage() const noexcept=0
Returns the usage flags for the resource.
virtual size_t elementSize() const noexcept=0
Returns the size of a single element within the buffer. If there is only one element,...
Event< const PrepareMoveEventArgs & > prepareMove
An event that gets invoked to prepare a resource for a move operation.
Definition rendering_api.hpp:4864
virtual size_t alignedElementSize() const noexcept=0
Returns the actual size of the element in device memory.
virtual size_t size() const noexcept=0
Gets the size (in bytes) of the aligned memory chunk.
virtual UInt64 virtualAddress() const noexcept=0
Gets the address of the resource in GPU memory.
virtual bool writable() const noexcept
Returns true, if the resource can be bound to a read/write descriptor.
Definition rendering_api.hpp:4975
virtual bool volatileMove() const noexcept
Returns true, if the contents of the resource should not be copied during a move.
Definition rendering_api.hpp:4989
virtual size_t elementAlignment() const noexcept=0
Returns the alignment of a single element.
virtual UInt32 elements() const noexcept=0
Gets the number of sub-resources inside the memory chunk.
Event< EventArgs > moved
An event that gets invoked, after the resource has been moved to a different location,...
Definition rendering_api.hpp:4894
Event< ResourceMovingEventArgs > moving
An event that gets invoked before a resource is copied during a move.
Definition rendering_api.hpp:4879
IDeviceMemory() noexcept=default
The interface for a frame buffer.
Definition rendering_api.hpp:8903
Event< ResizeEventArgs > resized
Invoked after the frame buffer has been resized.
Definition rendering_api.hpp:9000
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 addImage(const String &name, Format format, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::FrameBufferImage)=0
Adds an image to the frame buffer.
void addImage(const RenderTarget &renderTarget, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::FrameBufferImage)
Adds an image for a render target to the frame buffer.
Definition rendering_api.hpp:9236
virtual void mapRenderTarget(const RenderTarget &renderTarget, UInt32 index)=0
Maps a render target to a frame buffer image.
auto addImage(this TSelf &&self, StringView name, Format format, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::FrameBufferImage) -> TSelf &&
Adds an image to the frame buffer.
Definition rendering_api.hpp:9203
virtual void resize(const Size2d &renderArea)=0
Causes the frame buffer to be invalidated and recreated with a new size.
auto addImages(this TSelf &&self, Span< const RenderTarget > renderTargets, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::FrameBufferImage) -> TSelf &&
Adds multiple images for a set of render targets to the frame buffer.
Definition rendering_api.hpp:9272
virtual const Size2d & size() const noexcept=0
Returns the current size of the frame buffer.
virtual const IImage & operator[](StringView renderTargetName) const =0
Resolves a render target name and returns the image mapped to it.
void addImage(Format format, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::FrameBufferImage)
Adds an image to the frame buffer.
Definition rendering_api.hpp:9191
IFrameBuffer() noexcept=default
Event< ResizeEventArgs > resizing
Invoked if the frame buffer gets resized.
Definition rendering_api.hpp:8993
virtual const IImage & resolveImage(UInt64 hash) const =0
Resolves a render target name hash and returns the image mapped to it.
virtual const IImage & operator[](UInt32 index) const =0
Returns an image from the frame buffer.
virtual size_t getWidth() const noexcept=0
Returns the current width of the frame buffer.
virtual const IImage & image(const RenderTarget &renderTarget) const =0
Resolves a render target and returns the image mapped to it.
virtual const IImage & image(UInt32 index) const =0
Returns an image from the frame buffer.
std::function< SharedPtr< const TImage >(Optional< UInt64 >, Size2d, ResourceUsage, Format, MultiSamplingLevel, const String &)> allocation_callback_type
A function that gets invoked as a callback, if the frame buffer needs to allocate an image.
Definition rendering_api.hpp:8925
virtual void unmapRenderTarget(const RenderTarget &renderTarget) noexcept=0
Removes a mapping between a render target and an image in the frame buffer.
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
virtual const IImage & image(StringView renderTargetName) const =0
Resolves a render target name and returns the image mapped to it.
auto addImage(this TSelf &&self, StringView name, const RenderTarget &renderTarget, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::FrameBufferImage) -> TSelf &&
Adds an image for a render target to the frame buffer.
Definition rendering_api.hpp:9248
Enumerable< const IImage & > images() const
Returns all images contained by the frame buffer.
Definition rendering_api.hpp:9112
virtual void addImage(const String &name, const RenderTarget &renderTarget, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::FrameBufferImage)=0
Adds an image for a render target to the frame buffer.
Event< ReleasedEventArgs > released
Invoked when the frame buffer gets released.
Definition rendering_api.hpp:9011
virtual size_t getHeight() const noexcept=0
Returns the current height of the frame buffer.
auto addImage(this TSelf &&self, const RenderTarget &renderTarget, MultiSamplingLevel samples=MultiSamplingLevel::x1, ResourceUsage usage=ResourceUsage::FrameBufferImage) -> TSelf &&
Adds an image for a render target to the frame buffer.
Definition rendering_api.hpp:9225
virtual const IImage & operator[](const RenderTarget &renderTarget) const =0
Resolves a render target and returns the image mapped to it.
Represents a physical graphics adapter.
Definition rendering_api.hpp:3222
virtual UInt32 apiVersion() const noexcept=0
Returns the graphics API version.
virtual UInt64 driverVersion() const noexcept=0
Returns the graphics driver version.
virtual UInt64 dedicatedMemory() const noexcept=0
Returns the amount of dedicated graphics memory (in bytes), this adapter can use.
virtual UInt32 deviceId() const noexcept=0
Returns a unique identifier, that identifies the product.
IGraphicsAdapter() noexcept=default
virtual UInt32 vendorId() const noexcept=0
Returns a unique identifier, that identifies the vendor of the graphics adapter.
virtual String name() const =0
Retrieves the name of the graphics adapter.
virtual UInt64 uniqueId() const noexcept=0
Returns a unique identifier, that identifies the device in the system.
virtual GraphicsAdapterType type() const noexcept=0
Returns the type of the graphics adapter.
The interface for a graphics device that.
Definition rendering_api.hpp:11050
void computeAccelerationStructureSizes(const IBottomLevelAccelerationStructure &blas, UInt64 &bufferSize, UInt64 &scratchSize, bool forUpdate=false) const
Computes the required amount of device memory for an IBottomLevelAccelerationStructure.
Definition rendering_api.hpp:11198
virtual const ISurface & surface() const noexcept=0
Returns the surface, the device draws to.
virtual const IGraphicsFactory & factory() const noexcept=0
Returns the factory instance, used to create instances from the device.
virtual const IGraphicsAdapter & adapter() const noexcept=0
Returns the graphics adapter, the device uses for drawing.
void bindGlobalDescriptorHeaps(const ICommandBuffer &commandBuffer) const noexcept
Binds the global descriptor heap.
Definition rendering_api.hpp:11272
SharedPtr< IFrameBuffer > makeFrameBuffer(const Size2d &renderArea) const
Creates a new frame buffer instance.
Definition rendering_api.hpp:11152
void bindDescriptorSet(const ICommandBuffer &commandBuffer, const IDescriptorSet &descriptorSet, const IPipeline &pipeline) const noexcept
Binds the descriptors of the descriptor set to the global descriptor heaps.
Definition rendering_api.hpp:11264
void releaseGlobalDescriptors(const IDescriptorSet &descriptorSet) const
Releases a range of descriptors from the global descriptor heaps.
Definition rendering_api.hpp:11239
const ICommandQueue & defaultQueue(QueueType type) const
Returns the instance of the default ICommandQueue that supports the combination of queue types specif...
Definition rendering_api.hpp:11111
virtual double ticksPerMillisecond() const noexcept=0
Returns the number of GPU ticks per milliseconds.
IGraphicsDevice() noexcept=default
virtual MultiSamplingLevel maximumMultiSamplingLevel(Format format) const noexcept=0
Queries the device for the maximum supported number of multi-sampling levels.
SharedPtr< const ICommandQueue > createQueue(QueueType type, QueuePriority priority=QueuePriority::Normal)
Attempts to create a new queue that supports the combination of queue types specified by the type pa...
Definition rendering_api.hpp:11133
VirtualAllocator::Allocation allocateGlobalDescriptors(const IDescriptorSet &descriptorSet, DescriptorHeapType heapType) const
Allocates a range of descriptors in the global descriptor heaps for the provided descriptorSet .
Definition rendering_api.hpp:11226
void updateGlobalDescriptors(const IDescriptorSet &descriptorSet, UInt32 binding, UInt32 offset, UInt32 descriptors) const
Updates a range of descriptors in the global buffer descriptor heap with the descriptors from descrip...
Definition rendering_api.hpp:11250
UniquePtr< IBarrier > makeBarrier(PipelineStage syncBefore, PipelineStage syncAfter) const
Creates a memory barrier instance.
Definition rendering_api.hpp:11143
virtual const ISwapChain & swapChain() const noexcept=0
Returns the swap chain, that contains the back and front buffers used for presentation.
virtual void wait() const =0
Waits until all queues allocated from the device have finished the work issued prior to this point.
virtual DeviceState & state() const noexcept=0
Returns the device state that can be used to manage resources.
void computeAccelerationStructureSizes(const ITopLevelAccelerationStructure &tlas, UInt64 &bufferSize, UInt64 &scratchSize, bool forUpdate=false) const
Computes the required amount of device memory for an ITopLevelAccelerationStructure.
Definition rendering_api.hpp:11216
SharedPtr< IFrameBuffer > makeFrameBuffer(StringView name, const Size2d &renderArea) const
Creates a new frame buffer instance.
Definition rendering_api.hpp:11162
The interface for a graphics factory.
Definition rendering_api.hpp:10120
bool tryCreateBuffer(SharedPtr< IBuffer > &buffer, const String &name, BufferType type, ResourceHeap heap, size_t elementSize, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Tries to create a buffer of type type .
Definition rendering_api.hpp:10444
SharedPtr< IBuffer > createBuffer(const String &name, BufferType type, ResourceHeap heap, size_t elementSize, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Creates a buffer of type type .
Definition rendering_api.hpp:10428
virtual bool endDefragmentationPass() const =0
Ends a defragmentation pass.
bool tryCreateBuffer(SharedPtr< IBuffer > &buffer, BufferType type, ResourceHeap heap, size_t elementSize, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Tries to create a buffer of type type .
Definition rendering_api.hpp:10289
bool tryCreateBuffer(SharedPtr< IBuffer > &buffer, const String &name, const IPipeline &pipeline, UInt32 space, UInt32 binding, ResourceHeap heap, size_t elementSize, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Tries to create a buffer that can be bound to a descriptor of a specific descriptor set.
Definition rendering_api.hpp:10580
virtual UInt64 beginDefragmentationPass() const =0
Starts a new defragmentation pass.
SharedPtr< IIndexBuffer > createIndexBuffer(const IIndexBufferLayout &layout, ResourceHeap heap, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Creates an index buffer, based on the layout .
Definition rendering_api.hpp:10664
SharedPtr< IBuffer > createBuffer(const String &name, const IDescriptorSetLayout &descriptorSet, UInt32 binding, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Creates a buffer that can be bound to a specific descriptor.
Definition rendering_api.hpp:10459
UniquePtr< IBottomLevelAccelerationStructure > createBottomLevelAccelerationStructure(AccelerationStructureFlags flags=AccelerationStructureFlags::None) const
Creates a bottom-level acceleration structure.
Definition rendering_api.hpp:10877
bool tryCreateBuffer(SharedPtr< IBuffer > &buffer, const String &name, const IPipeline &pipeline, UInt32 space, UInt32 binding, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Tries to create a buffer that can be bound to a descriptor of a specific descriptor set.
Definition rendering_api.hpp:10545
SharedPtr< ISampler > 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
Creates a texture sampler.
Definition rendering_api.hpp:10845
bool tryCreateBuffer(SharedPtr< IBuffer > &buffer, const IPipeline &pipeline, UInt32 space, UInt32 binding, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Tries to create a buffer that can be bound to a descriptor of a specific descriptor set.
Definition rendering_api.hpp:10413
bool tryCreateBuffer(SharedPtr< IBuffer > &buffer, const IDescriptorSetLayout &descriptorSet, UInt32 binding, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Tries to create a buffer that can be bound to a specific descriptor.
Definition rendering_api.hpp:10319
UniquePtr< ITopLevelAccelerationStructure > createTopLevelAccelerationStructure(StringView name, AccelerationStructureFlags flags=AccelerationStructureFlags::None) const
Creates a top-level acceleration structure.
Definition rendering_api.hpp:10918
SharedPtr< IBuffer > createBuffer(const IDescriptorSetLayout &descriptorSet, UInt32 binding, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Creates a buffer that can be bound to a specific descriptor.
Definition rendering_api.hpp:10303
bool tryCreateBuffer(SharedPtr< IBuffer > &buffer, const IDescriptorSetLayout &descriptorSet, UInt32 binding, ResourceHeap heap, UInt32 elementSize, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Tries to create a buffer that can be bound to a specific descriptor.
Definition rendering_api.hpp:10350
SharedPtr< IVertexBuffer > createVertexBuffer(const IVertexBufferLayout &layout, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Creates a vertex buffer, based on the layout .
Definition rendering_api.hpp:10598
SharedPtr< IBuffer > createBuffer(BufferType type, ResourceHeap heap, size_t elementSize, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Creates a buffer of type type .
Definition rendering_api.hpp:10274
bool tryCreateTexture(SharedPtr< IImage > &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
Tries to create a texture.
Definition rendering_api.hpp:10750
virtual ResourceAllocationResult allocate(const ResourceAllocationInfo &allocationInfo, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Allocates a single resource as described by allocationInfo .
Definition rendering_api.hpp:10211
virtual VirtualAllocator createAllocator(UInt64 overallMemory, AllocationAlgorithm algorithm=AllocationAlgorithm::Default) const =0
Creates a virtual allocator that can be used to manage allocation from a custom block of memory.
bool tryCreateBuffer(SharedPtr< IBuffer > &buffer, const String &name, const IDescriptorSetLayout &descriptorSet, UInt32 binding, ResourceHeap heap, size_t elementSize, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Tries to create a buffer that can be bound to a specific descriptor.
Definition rendering_api.hpp:10511
SharedPtr< IImage > 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
Creates a texture.
Definition rendering_api.hpp:10733
SharedPtr< IBuffer > createBuffer(const String &name, const IPipeline &pipeline, UInt32 space, UInt32 binding, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Creates a buffer that can be bound to a descriptor of a specific descriptor set.
Definition rendering_api.hpp:10528
IGraphicsFactory() noexcept=default
bool tryCreateIndexBuffer(SharedPtr< IIndexBuffer > &buffer, const String &name, const IIndexBufferLayout &layout, ResourceHeap heap, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Tries to create an index buffer, based on the layout .
Definition rendering_api.hpp:10712
Generator< SharedPtr< ISampler > > 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
Creates a series of texture samplers.
Definition rendering_api.hpp:10864
virtual bool canAlias(Enumerable< const ResourceAllocationInfo & > allocationInfos) const =0
Checks if the resources described by allocationInfos can be overlapped.
virtual bool supportsResizableBaseAddressRegister() const noexcept=0
Returns true, if the GPU supports resizable base address register (ReBAR) and false otherwise.
SharedPtr< IBuffer > createBuffer(const IPipeline &pipeline, UInt32 space, UInt32 binding, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Creates a buffer that can be bound to a descriptor of a specific descriptor set.
Definition rendering_api.hpp:10397
bool tryCreateTexture(SharedPtr< IImage > &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
Tries to create a texture.
Definition rendering_api.hpp:10790
bool tryCreateVertexBuffer(SharedPtr< IVertexBuffer > &buffer, const String &name, const IVertexBufferLayout &layout, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Tries to create a vertex buffer, based on the layout .
Definition rendering_api.hpp:10646
SharedPtr< IBuffer > createBuffer(const String &name, const IDescriptorSetLayout &descriptorSet, UInt32 binding, ResourceHeap heap, size_t elementSize, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Creates a buffer that can be bound to a specific descriptor.
Definition rendering_api.hpp:10493
SharedPtr< IIndexBuffer > createIndexBuffer(const String &name, const IIndexBufferLayout &layout, ResourceHeap heap, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Creates an index buffer, based on the layout .
Definition rendering_api.hpp:10697
SharedPtr< ISampler > 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
Creates a texture sampler.
Definition rendering_api.hpp:10825
SharedPtr< IBuffer > createBuffer(const IDescriptorSetLayout &descriptorSet, UInt32 binding, ResourceHeap heap, UInt32 elementSize, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Creates a buffer that can be bound to a specific descriptor.
Definition rendering_api.hpp:10334
virtual void beginDefragmentation(const ICommandQueue &queue, DefragmentationStrategy strategy=DefragmentationStrategy::Balanced, UInt64 maxBytesToMove=0u, UInt32 maxAllocationsToMove=0u) const =0
Starts a defragmentation process for the resources allocated from the factory.
bool tryCreateVertexBuffer(SharedPtr< IVertexBuffer > &buffer, const IVertexBufferLayout &layout, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Tries to create a vertex buffer, based on the layout .
Definition rendering_api.hpp:10612
virtual Array< MemoryHeapStatistics > memoryStatistics() const =0
Returns an array of objects, that contain information about the current memory usage and available me...
SharedPtr< IBuffer > createBuffer(const String &name, const IPipeline &pipeline, UInt32 space, UInt32 binding, ResourceHeap heap, size_t elementSize, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Creates a buffer that can be bound to a descriptor of a specific descriptor set.
Definition rendering_api.hpp:10562
SharedPtr< IVertexBuffer > createVertexBuffer(const String &name, const IVertexBufferLayout &layout, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Creates a vertex buffer, based on the layout .
Definition rendering_api.hpp:10631
UniquePtr< IBottomLevelAccelerationStructure > createBottomLevelAccelerationStructure(StringView name, AccelerationStructureFlags flags=AccelerationStructureFlags::None) const
Creates a bottom-level acceleration structure.
Definition rendering_api.hpp:10891
Generator< SharedPtr< IImage > > 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
Creates a series of textures.
Definition rendering_api.hpp:10806
SharedPtr< IBuffer > createBuffer(const IPipeline &pipeline, UInt32 space, UInt32 binding, ResourceHeap heap, UInt32 elementSize, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Creates a buffer that can be bound to a descriptor of a specific descriptor set.
Definition rendering_api.hpp:10366
SharedPtr< IImage > 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
Creates a texture.
Definition rendering_api.hpp:10772
bool tryCreateBuffer(SharedPtr< IBuffer > &buffer, const String &name, const IDescriptorSetLayout &descriptorSet, UInt32 binding, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Tries to create a buffer that can be bound to a specific descriptor.
Definition rendering_api.hpp:10476
UniquePtr< ITopLevelAccelerationStructure > createTopLevelAccelerationStructure(AccelerationStructureFlags flags=AccelerationStructureFlags::None) const
Creates a top-level acceleration structure.
Definition rendering_api.hpp:10904
virtual DetailedMemoryStatistics detailedMemoryStatistics() const =0
Returns detailed memory statistics.
bool tryCreateBuffer(SharedPtr< IBuffer > &buffer, const IPipeline &pipeline, UInt32 space, UInt32 binding, ResourceHeap heap, UInt32 elementSize, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Tries to create a buffer that can be bound to a descriptor of a specific descriptor set.
Definition rendering_api.hpp:10382
bool tryCreateIndexBuffer(SharedPtr< IIndexBuffer > &buffer, const IIndexBufferLayout &layout, ResourceHeap heap, UInt32 elements, ResourceUsage usage=ResourceUsage::Default, AllocationBehavior allocationBehavior=AllocationBehavior::Default) const
Tries to create an index buffer, based on the layout .
Definition rendering_api.hpp:10678
virtual Generator< ResourceAllocationResult > allocate(Enumerable< const ResourceAllocationInfo & > allocationInfos, AllocationBehavior allocationBehavior=AllocationBehavior::Default, bool alias=false) const =0
Allocates a set of resources as described by allocationInfos .
Describes a generic image.
Definition rendering_api.hpp:5019
virtual void resolveSubresource(UInt32 subresource, UInt32 &plane, UInt32 &layer, UInt32 &level) const noexcept
Returns the plane , layer and level for the provided subresource .
Definition rendering_api.hpp:5123
virtual Format format() const noexcept=0
Gets the internal format of the image.
virtual size_t size(UInt32 level) const noexcept=0
Returns the size (in bytes) of an image at a specified mip map level. If the image does not contain t...
virtual UInt32 planes() const noexcept=0
Returns the number of planes of the image resource.
virtual UInt32 subresourceId(UInt32 level, UInt32 layer, UInt32 plane) const noexcept
Returns the sub-resource ID for a combination of mip-map level , array layer and plane .
Definition rendering_api.hpp:5111
virtual MultiSamplingLevel samples() const noexcept=0
Gets the number of samples of the texture.
IImage() noexcept=default
virtual UInt32 layers() const noexcept=0
Gets the number of layers (slices) of the image.
virtual ImageDimensions dimensions() const noexcept=0
Gets the images dimensionality.
virtual UInt32 levels() const noexcept=0
Gets the number of mip-map levels of the image.
virtual Size3d extent(UInt32 level=0) const noexcept=0
Gets the extent of the image at a certain mip-map level.
The interface for an index buffer.
Definition rendering_api.hpp:5236
virtual const IIndexBufferLayout & layout() const noexcept=0
Gets the layout of the index buffer.
IIndexBuffer() noexcept=default
Describes a index buffer layout.
Definition rendering_api.hpp:4603
IIndexBufferLayout() noexcept=default
virtual IndexType indexType() const noexcept=0
Returns the index type of the index buffer.
Allows for data to be mapped into the object.
Definition rendering_api.hpp:4692
virtual void write(const void *const data, size_t size, size_t offset=0)=0
Writes a span of memory in data into the internal memory of this object, starting at offset .
virtual void read(void *data, size_t size, size_t offset=0)=0
Writes a span of memory in data into the internal memory of this object, starting at offset .
virtual void map(const void *const data, size_t size, UInt32 element=0)=0
Maps the memory at data to the internal memory of this object.
IMappable() noexcept=default
The interface for a pipeline.
Definition rendering_api.hpp:7646
SharedPtr< const IShaderProgram > program() const noexcept
Returns the shader program used by the pipeline.
Definition rendering_api.hpp:7662
IPipeline() noexcept=default
SharedPtr< const IPipelineLayout > layout() const noexcept
Returns the layout of the render pipeline.
Definition rendering_api.hpp:7670
The interface for a pipeline layout.
Definition rendering_api.hpp:7538
virtual const IDescriptorSetLayout & descriptorSet(UInt32 space) const =0
Returns the descriptor set layout for the descriptor set that is bound to the space provided by space...
Enumerable< SharedPtr< const IDescriptorSetLayout > > descriptorSets() const
Returns all descriptor set layouts, the pipeline has been initialized with.
Definition rendering_api.hpp:7567
virtual bool dynamicResourceHeapAccess() const =0
Returns true, if the pipeline supports directly indexing into a resource heap and false otherwise.
IPipelineLayout() noexcept=default
virtual const IPushConstantsLayout * pushConstants() const noexcept=0
Returns the push constants layout, or nullptr, if the pipeline does not use any push constants.
virtual bool dynamicSamplerHeapAccess() const =0
Returns true, if the pipeline supports directly indexing into a sampler heap and false otherwise.
The interface for a push constants layout.
Definition rendering_api.hpp:6609
virtual const IPushConstantsRange & range(ShaderStage stage) const =0
Returns the push constant range associated with the shader stage provided in stage .
virtual UInt32 size() const noexcept=0
Returns the size (in bytes) of the push constants backing memory.
IPushConstantsLayout() noexcept=default
Enumerable< const IPushConstantsRange & > ranges() const
Returns all push constant ranges.
Definition rendering_api.hpp:6642
Describes a range within a IPushConstantsLayout.
Definition rendering_api.hpp:6561
virtual UInt32 space() const noexcept=0
Returns the shader space the push constants can be accessed from.
virtual UInt32 offset() const noexcept=0
Returns the offset from the push constants backing memory block, the range starts at.
IPushConstantsRange() noexcept=default
virtual UInt32 binding() const noexcept=0
Returns the binding point or register, the push constants are made available at.
virtual ShaderStage stage() const noexcept=0
Returns the shader stage(s), the range is accessible from.
virtual UInt32 size() const noexcept=0
Returns the size (in bytes) of the range.
Represents the rasterizer state of a RenderPipeline.
Definition rendering_api.hpp:3941
virtual bool depthClip() const noexcept=0
Returns true, if z-clipping should be used during distance clipping.
virtual PolygonMode polygonMode() const noexcept=0
Returns the polygon mode of the rasterizer state.
virtual bool conservativeRasterization() const noexcept=0
Returns true, if conservative rasterization is enabled and false otherwise.
virtual Float lineWidth() const noexcept=0
Returns the line width of the rasterizer state.
IRasterizer() noexcept=default
virtual const DepthStencilState & depthStencilState() const noexcept=0
Returns the depth/stencil state of the rasterizer.
virtual CullMode cullMode() const noexcept=0
Returns the cull mode of the rasterizer state.
virtual CullOrder cullOrder() const noexcept=0
Returns the cull mode of the rasterizer state.
The interface for a ray tracing pipeline.
Definition rendering_api.hpp:8810
IRayTracingPipeline() noexcept=default
SharedPtr< IBuffer > allocateShaderBindingTable(ShaderBindingTableOffsets &offsets, ShaderBindingGroup groups=ShaderBindingGroup::All) const
Allocates a buffer that contains the shader binding table containing the shader groups specified by t...
Definition rendering_api.hpp:8873
virtual const ShaderRecordCollection & shaderRecords() const noexcept=0
Returns the shader record collection of the ray tracing pipeline.
virtual UInt32 maxPayloadSize() const noexcept=0
Returns the maximum size of a single ray payload.
virtual UInt32 maxAttributeSize() const noexcept=0
Returns the maximum size of a single ray attribute.
virtual UInt32 maxRecursionDepth() const noexcept=0
Returns the maximum number of ray bounces.
The interface to access a render backend.
Definition rendering_api.hpp:11305
virtual const IGraphicsDevice * operator[](const String &name) const noexcept
Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could...
Definition rendering_api.hpp:11357
virtual IGraphicsDevice * device(const String &name) noexcept=0
Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could...
virtual const IGraphicsAdapter * findAdapter(const Optional< UInt64 > &adapterId=std::nullopt) const noexcept=0
Finds an adapter using its unique ID.
Enumerable< SharedPtr< const IGraphicsAdapter > > listAdapters() const
Lists all available graphics adapters.
Definition rendering_api.hpp:11321
virtual IGraphicsDevice * operator[](const String &name) noexcept
Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could...
Definition rendering_api.hpp:11366
virtual const IGraphicsDevice * device(const String &name) const noexcept=0
Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could...
IRenderBackend() noexcept=default
The interface for a render pass.
Definition rendering_api.hpp:9292
SharedPtr< const ICommandBuffer > commandBuffer(UInt32 index) const
Returns a command buffer that can be currently used for recording multi-threaded commands in the rend...
Definition rendering_api.hpp:9393
virtual const Array< RenderPassDependency > & inputAttachments() const noexcept=0
Returns the input attachment the render pass is consuming.
const ICommandQueue & commandQueue() const noexcept
Returns the command queue, the render pass is executing on or nullptr, if the queue has already been ...
Definition rendering_api.hpp:9369
virtual const RenderPassDependency & inputAttachment(UInt32 location) const =0
Returns the input attachment at a location .
Enumerable< SharedPtr< const ICommandBuffer > > commandBuffers() const
Returns all command buffers, that can be currently used for recording multi-threaded commands in the ...
Definition rendering_api.hpp:9381
SharedPtr< const IFrameBuffer > activeFrameBuffer() const noexcept
Returns the current frame buffer from of the render pass.
Definition rendering_api.hpp:9361
virtual bool hasPresentTarget() const noexcept=0
Returns true, if one of the render targets is used for presentation on a swap chain.
virtual const Optional< DescriptorBindingPoint > & inputAttachmentSamplerBinding() const noexcept=0
Returns the binding point for input attachment samplers.
IRenderPass() noexcept=default
Event< BeginEventArgs > beginning
Invoked, when the render pass is beginning.
Definition rendering_api.hpp:9336
virtual const Array< RenderTarget > & renderTargets() const noexcept=0
Returns the list of render targets, the render pass renders into.
virtual UInt64 end() const =0
Ends the render pass.
virtual const RenderTarget & renderTarget(UInt32 location) const =0
Returns the render target mapped to the location provided by location .
Event< EventArgs > ending
Invoked, when the render pass is ending.
Definition rendering_api.hpp:9342
virtual UInt32 viewMask() const noexcept=0
Returns the mask that identifies the views that are enabled during rendering.
void begin(const IFrameBuffer &frameBuffer) const
Begins the render pass.
Definition rendering_api.hpp:9453
virtual UInt32 secondaryCommandBuffers() const noexcept=0
Returns the number of secondary command buffers the render pass stores for multi-threaded command rec...
The interface for a render pipeline.
Definition rendering_api.hpp:8725
SharedPtr< IRasterizer > rasterizer() const noexcept
Returns the rasterizer state used by the render pipeline.
Definition rendering_api.hpp:8749
virtual MultiSamplingLevel samples() const noexcept=0
Returns the multi-sampling level of the pipeline.
SharedPtr< IInputAssembler > inputAssembler() const noexcept
Returns the input assembler state used by the render pipeline.
Definition rendering_api.hpp:8741
virtual void updateSamples(MultiSamplingLevel samples)=0
Changes the multi-sampling level of the pipeline.
IRenderPipeline() noexcept=default
virtual bool alphaToCoverage() const noexcept=0
Returns true, if the pipeline uses Alpha-to-Coverage multi-sampling.
Represents a render target, i.e. an abstract view of the output of an RenderPass.
Definition rendering_api.hpp:3427
virtual const String & name() const noexcept=0
Returns the name of the render target.
virtual Format format() const noexcept=0
Returns the internal format of the render target.
virtual const Vector4f & clearValues() const noexcept=0
Returns the value, the render target is cleared with, if clearBuffer either or clearStencil is specif...
virtual bool clearStencil() const noexcept=0
Returns true, if the render target stencil should be cleared, when the render pass is started....
virtual RenderTargetType type() const noexcept=0
Returns the type of the render target.
virtual bool isVolatile() const noexcept=0
Returns true, if the target should not be made persistent for access after the render pass has finish...
virtual bool clearBuffer() const noexcept=0
Returns true, if the render target should be cleared, when the render pass is started....
IRenderTarget() noexcept=default
virtual UInt64 identifier() const noexcept=0
A unique identifier for the render target.
virtual RenderTargetFlags flags() const noexcept=0
Returns the flags that control the behavior of the render target.
virtual UInt32 location() const noexcept=0
Returns the location of the render target output attachment within the fragment shader.
virtual const BlendState & blendState() const noexcept=0
Returns the render targets blend state.
Describes a texture sampler.
Definition rendering_api.hpp:5135
virtual BorderMode getBorderModeU() const noexcept=0
Gets the addressing mode at the horizontal border.
virtual FilterMode getMinifyingFilter() const noexcept=0
Gets the filtering mode that is used for minifying lookups.
virtual Float getMinLOD() const noexcept=0
Gets the minimum texture level of detail.
virtual BorderMode getBorderModeW() const noexcept=0
Gets the addressing mode at the depth border.
virtual Float getMipMapBias() const noexcept=0
Gets the mip-map level of detail bias.
virtual Float getMaxLOD() const noexcept=0
Gets the maximum texture level of detail.
virtual MipMapMode getMipMapMode() const noexcept=0
Gets the mip-map selection mode.
virtual FilterMode getMagnifyingFilter() const noexcept=0
Gets the filtering mode that is used for magnifying lookups.
virtual BorderMode getBorderModeV() const noexcept=0
Gets the addressing mode at the vertical border.
virtual Float getAnisotropy() const noexcept=0
Gets the anisotropy value used when sampling this texture.
ISampler() noexcept=default
The interface of a scissor.
Definition rendering_api.hpp:4207
IScissor() noexcept=default
virtual RectF getRectangle() const noexcept=0
Gets the rectangle that defines the scissor region.
virtual void setRectangle(const RectF &rectangle) noexcept=0
Sets the rectangle that defines the scissor region.
Represents a single shader module, i.e. a part of a IShaderProgram.
Definition rendering_api.hpp:3363
virtual const String & entryPoint() const noexcept=0
Returns the name of the shader module entry point.
virtual const String & fileName() const noexcept=0
Returns the file name of the shader module.
IShaderModule() noexcept=default
virtual ShaderStage type() const noexcept=0
Returns the type of the shader module.
virtual const Optional< DescriptorBindingPoint > & shaderLocalDescriptor() const noexcept=0
For ray-tracing shader modules returns the binding point for the descriptor that receives shader-loca...
The interface for a shader program.
Definition rendering_api.hpp:7437
Enumerable< const IShaderModule & > modules() const
Returns the modules, the shader program is build from.
Definition rendering_api.hpp:7488
ShaderRecordCollection buildShaderRecordCollection() const noexcept
Builds a shader record collection based on the current shader program.
Definition rendering_api.hpp:7526
IShaderProgram() noexcept=default
bool contains(StringView name) const
Returns true, if the program contains a shader module with the provided name or file name and false o...
Definition rendering_api.hpp:7469
SharedPtr< IPipelineLayout > reflectPipelineLayout(Enumerable< PipelineBindingHint > hints={}) const
Uses shader reflection to extract the pipeline layout of a shader. May not be available in all backen...
Definition rendering_api.hpp:7518
bool contains(const IShaderModule &module) const
Returns true, if the program contains the provided shader module and false otherwise.
Definition rendering_api.hpp:7479
IStateResource() noexcept=default
virtual const String & name() const noexcept=0
Returns the name of the resource.
Represents a surface to render to.
Definition rendering_api.hpp:3294
ISurface() noexcept=default
Interface for a swap chain.
Definition rendering_api.hpp:9484
virtual SharedPtr< const TimingEvent > timingEvent(UInt32 queryId) const =0
Returns the timing event registered for queryId .
virtual const IGraphicsDevice & device() const =0
Returns the swap chain's parent device instance.
SharedPtr< const TimingEvent > registerTimingEvent(StringView name="")
Creates a new instance of a TimingEvent.
Definition rendering_api.hpp:9586
virtual UInt32 swapBackBuffer() const =0
Swaps the front buffer with the next back buffer in order.
virtual UInt32 resolveQueryId(SharedPtr< const TimingEvent > timingEvent) const =0
Returns the query ID for the timing event.
virtual void reset(Format surfaceFormat, const Size2d &renderArea, UInt32 buffers, bool enableVsync=false)=0
Causes the swap chain to be re-created. All frame and command buffers will be invalidated and rebuilt...
Event< ResetEventArgs > reseted
Invoked, after the swap chain has been reseted.
Definition rendering_api.hpp:9701
virtual IImage * image(UInt32 backBuffer) const =0
Returns the swap chain present image for backBuffer .
virtual Enumerable< Format > getSurfaceFormats() const =0
Returns an array of supported formats, that can be drawn to the surface.
Event< BackBufferSwapEventArgs > swapped
Invoked, when the swap chain has swapped the back buffers.
Definition rendering_api.hpp:9695
virtual bool verticalSynchronization() const noexcept=0
Returns true, if vertical synchronization should be used, otherwise false.
ISwapChain() noexcept=default
virtual Format surfaceFormat() const noexcept=0
Returns the swap chain image format.
virtual void present(UInt64 fence) const =0
Queues a present that gets executed after fence has been signaled on the default graphics queue.
virtual UInt32 buffers() const noexcept=0
Returns the number of images in the swap chain.
virtual const Array< SharedPtr< const TimingEvent > > & timingEvents() const =0
Returns all registered timing events.
Enumerable< IImage & > images() const
Returns an array of the swap chain present images.
Definition rendering_api.hpp:9674
virtual const Size2d & renderArea() const noexcept=0
Returns the size of the render area.
virtual UInt64 readTimingEvent(SharedPtr< const TimingEvent > timingEvent) const =0
Reads the current time stamp value (in ticks) of a timing event.
A structure that stores the instance data for a IBottomLevelAccelerationStructure.
Definition rendering_api.hpp:5681
void addInstance(const SharedPtr< const IBottomLevelAccelerationStructure > &blas, const TMatrix3x4< Float > &transform, UInt32 id, UInt32 hitGroupOffset=0, UInt8 mask=0xFF, InstanceFlags flags=InstanceFlags::None) noexcept
Adds an instance to the TLAS.
Definition rendering_api.hpp:5777
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
virtual void addInstance(const Instance &instance)=0
Adds an instance to the TLAS.
ITopLevelAccelerationStructure() noexcept=default
auto withInstance(this TSelf &&self, const Instance &instance) noexcept -> TSelf &&
Adds an instance to the current TLAS.
Definition rendering_api.hpp:5838
virtual const Array< Instance > & instances() const noexcept=0
Returns an array of instances in the TLAS.
virtual void clear() noexcept=0
Clears all instances from the acceleration structure.
auto withInstance(this TSelf &&self, const SharedPtr< const IBottomLevelAccelerationStructure > &blas, const TMatrix3x4< Float > &transform, UInt32 id, UInt32 hitGroupOffset=0, UInt8 mask=0xFF, InstanceFlags flags=InstanceFlags::None) noexcept -> TSelf &&
Adds an instance to the current TLAS.
Definition rendering_api.hpp:5869
virtual bool remove(const Instance &instance) noexcept=0
Removes an instance from the acceleration structure.
auto withInstance(this TSelf &&self, const SharedPtr< const IBottomLevelAccelerationStructure > &blas, UInt32 id, UInt32 hitGroupOffset=0, UInt8 mask=0xFF, InstanceFlags flags=InstanceFlags::None) noexcept -> TSelf &&
Adds an instance to the current TLAS.
Definition rendering_api.hpp:5853
The interface for a vertex buffer.
Definition rendering_api.hpp:5214
virtual const IVertexBufferLayout & layout() const noexcept=0
Gets the layout of the vertex buffer.
IVertexBuffer() noexcept=default
Describes a vertex buffer layout.
Definition rendering_api.hpp:4574
virtual const Array< BufferAttribute > & attributes() const =0
Returns the vertex buffer attributes.
IVertexBufferLayout() noexcept=default
virtual VertexBufferInputRate inputRate() const noexcept=0
Returns the vertex buffer input rate that describes how the data is made available to the vertex shad...
Interface for a viewport.
Definition rendering_api.hpp:4089
virtual void setMaxDepth(Float depth) const noexcept=0
Sets the maximum depth of the viewport.
virtual float getMinDepth() const noexcept=0
Gets the minimum depth of the viewport.
virtual float getMaxDepth() const noexcept=0
Gets the maximum depth of the viewport.
virtual void setMinDepth(Float depth) const noexcept=0
Sets the minimum depth of the viewport.
IViewport() noexcept=default
virtual RectF getRectangle() const noexcept=0
Gets the rectangle that defines the dimensions of the viewport.
virtual void setRectangle(const RectF &rectangle) noexcept=0
Sets the rectangle that defines the dimensions of the viewport.
Describes an index buffer.
Definition rendering.hpp:501
Rasterizer & operator=(const Rasterizer &_other)
Assigns a rasterizer by copying it.
Rasterizer(Rasterizer &&_other) noexcept
Takes over another instance of a rasterizer.
Rasterizer & operator=(Rasterizer &&_other) noexcept
Assigns a rasterizer by taking it over.
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
bool conservativeRasterization() const noexcept override
Returns true, if conservative rasterization is enabled and false otherwise.This setting requires the ...
Definition rasterizer.cpp:73
Rasterizer(const Rasterizer &_other)
Creates a copy of a rasterizer.
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
~Rasterizer() noexcept override
Releases the rasterizer instance.
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
Represents a ray-tracing Pipeline.
Definition rendering.hpp:1042
Represents a mapping between a set of RenderTarget instances and the input attachments of a IRenderPa...
Definition rendering_api.hpp:3684
RenderPassDependency & operator=(RenderPassDependency &&_other) noexcept
Assigns another render pass dependency by taking it over.
const RenderTarget & renderTarget() const noexcept
Returns a reference of the render target that is mapped to the input attachment.
Definition render_pass_dependency.cpp:44
RenderPassDependency(RenderPassDependency &&_other) noexcept
Takes over another render pass dependency instance.
const DescriptorBindingPoint & binding() const noexcept
Returns the binding point for the input attachment binding.
Definition render_pass_dependency.cpp:49
RenderPassDependency & operator=(const RenderPassDependency &_other)
Assigns another render pass dependency instance by copying it.
~RenderPassDependency() noexcept
Releases the current render pass dependency instance.
RenderPassDependency(const RenderTarget &renderTarget, const DescriptorBindingPoint &descriptorBinding) noexcept
Creates a new render target dependency.
Definition render_pass_dependency.cpp:28
RenderPassDependency(const RenderPassDependency &_other)
Creates a copy of another render pass dependency.
Implements a render target.
Definition rendering_api.hpp:3584
bool clearStencil() const noexcept override
Returns true, if the render target stencil should be cleared, when the render pass is started....
Definition render_target.cpp:85
RenderTarget & operator=(RenderTarget &&_other) noexcept
Assigns a render target by taking it over.
UInt64 identifier() const noexcept override
A unique identifier for the render target.The unique identifier for the render target.
Definition render_target.cpp:50
RenderTargetFlags flags() const noexcept override
Returns the flags that control the behavior of the render target.The flags that control the behavior ...
Definition render_target.cpp:75
bool isVolatile() const noexcept override
Returns true, if the target should not be made persistent for access after the render pass has finish...
Definition render_target.cpp:95
Format format() const noexcept override
Returns the internal format of the render target.The internal format of the render target.
Definition render_target.cpp:70
const BlendState & blendState() const noexcept override
Returns the render targets blend state.The render targets blend state.
Definition render_target.cpp:100
RenderTargetType type() const noexcept override
Returns the type of the render target.The type of the render target.
Definition render_target.cpp:65
RenderTarget(const RenderTarget &_other)
Creates a copy of a render target.
RenderTarget(UInt64 uid, UInt32 location, RenderTargetType type, Format format, RenderTargetFlags flags=RenderTargetFlags::None, const Vector4f &clearValues={ 0.f, 0.f, 0.f, 0.f }, const BlendState &blendState={})
Initializes the render target.
Definition render_target.cpp:34
RenderTarget(RenderTarget &&_other) noexcept
Takes over another instance of a render target.
const Vector4f & clearValues() const noexcept override
Returns the value, the render target is cleared with, if clearBuffer either or clearStencil is specif...
Definition render_target.cpp:90
~RenderTarget() noexcept override
Releases the render target instance.
bool clearBuffer() const noexcept override
Returns true, if the render target should be cleared, when the render pass is started....
Definition render_target.cpp:80
const String & name() const noexcept override
Returns the name of the render target.The name of the render target.
Definition render_target.cpp:55
RenderTarget & operator=(const RenderTarget &_other)
Assigns a render target by copying it.
UInt32 location() const noexcept override
Returns the location of the render target output attachment within the fragment shader....
Definition render_target.cpp:60
Scissor(const Scissor &_other)
Creates a copy of a scissor.
~Scissor() noexcept override
Releases the scissor instance.
Scissor & operator=(const Scissor &_other)
Assigns a scissor by copying it.
void setRectangle(const RectF &rectangle) noexcept override
Sets the rectangle that defines the scissor region.
Definition scissor.cpp:39
Scissor(const RectF &scissorRect={ }) noexcept
Initializes a new scissor.
Definition scissor.cpp:27
RectF getRectangle() const noexcept override
Gets the rectangle that defines the scissor region.The rectangle that defines the scissor region.
Definition scissor.cpp:34
Scissor & operator=(Scissor &&_other) noexcept
Assigns a scissor by taking it over.
Scissor(Scissor &&_other) noexcept
Takes over another instance of a scissor.
Stores a set of IShaderRecords in that later form a shader binding table used for ray-tracing.
Definition rendering_api.hpp:6923
void addShaderRecord(const ShaderRecord<>::shader_group_type &shaderGroup)
Adds a new shader record to the shader record collection.
Definition rendering_api.hpp:7068
void addShaderRecord(UniquePtr< const IShaderRecord > &&record)
Adds a new shader record to the shader record collection.
Definition shader_record_collection.cpp:15
ShaderRecordCollection && withShaderRecord(StringView shaderName)
Adds a new shader record based on the name of a shader module in the parent shader program.
Definition rendering_api.hpp:7092
void addShaderRecord(StringView shaderName, TLocalData payload)
Adds a new shader record based on the name of a shader module in the parent shader program.
Definition rendering_api.hpp:7017
void addMeshGeometryShaderHitGroupRecord(std::optional< StringView > anyHitShaderName, std::optional< StringView > closestHitShaderName, TLocalData payload)
Adds a new mesh geometry hit group record based on names of the shader modules.
Definition rendering_api.hpp:7055
friend class IShaderProgram
Definition rendering_api.hpp:6924
ShaderRecordCollection && withShaderRecord(ShaderRecord< TLocalData >::shader_group_type shaderGroup, TLocalData payload)
Adds a new shader record to the shader record collection.
Definition rendering_api.hpp:7157
ShaderRecordCollection && withShaderRecord(StringView shaderName, TLocalData payload)
Adds a new shader record based on the name of a shader module in the parent shader program.
Definition rendering_api.hpp:7109
void addMeshGeometryShaderHitGroupRecord(std::optional< StringView > anyHitShaderName, std::optional< StringView > closestHitShaderName)
Adds a new mesh geometry hit group record based on names of the shader modules.
Definition rendering_api.hpp:7037
void addShaderRecord(ShaderRecord< TLocalData >::shader_group_type shaderGroup, TLocalData payload)
Adds a new shader record to the shader record collection.
Definition rendering_api.hpp:7079
ShaderRecordCollection && withMeshGeometryHitGroupRecord(std::optional< StringView > anyHitShaderName, std::optional< StringView > closestHitShaderName, TLocalData payload)
Adds a new mesh geometry hit group record based on names of the shader modules.
Definition rendering_api.hpp:7134
ShaderRecordCollection(ShaderRecordCollection &&) noexcept=default
ShaderRecordCollection && withMeshGeometryHitGroupRecord(std::optional< StringView > anyHitShaderName, std::optional< StringView > closestHitShaderName)
Adds a new mesh geometry hit group record based on names of the shader modules.
Definition rendering_api.hpp:7120
ShaderRecordCollection()=delete
SharedPtr< const IShaderProgram > program() const noexcept
Returns the parent shader program of the collection.
Definition rendering_api.hpp:6963
ShaderRecordCollection && withShaderRecord(ShaderRecord<>::shader_group_type shaderGroup)
Adds a new shader record to the shader record collection.
Definition rendering_api.hpp:7144
StateResource(StateResource &&) noexcept
StateResource()
Initializes a new state resource instance with a default name.
Definition state_resource.cpp:27
String & name() noexcept
Definition state_resource.cpp:41
An event that is used to measure timestamps in a command queue.
Definition rendering_api.hpp:4371
StringView name() const noexcept
Gets the name of the timing event.
Definition timing_event.cpp:35
~TimingEvent() noexcept override
Releases the render target instance.
friend class ISwapChain
Definition rendering_api.hpp:4373
Describes a vertex buffer.
Definition rendering.hpp:477
void setRectangle(const RectF &rectangle) noexcept override
Sets the rectangle that defines the dimensions of the viewport.
Definition viewport.cpp:40
void setMaxDepth(Float depth) const noexcept override
Sets the maximum depth of the viewport.
Definition viewport.cpp:60
Viewport & operator=(const Viewport &_other)
Assigns a viewport by copying it.
void setMinDepth(Float depth) const noexcept override
Sets the minimum depth of the viewport.
Definition viewport.cpp:50
Viewport(Viewport &&_other) noexcept
Takes over another instance of a viewport.
Viewport & operator=(Viewport &&_other) noexcept
Assigns a viewport by taking it over.
RectF getRectangle() const noexcept override
Gets the rectangle that defines the dimensions of the viewport.The rectangle that defines the dimensi...
Definition viewport.cpp:35
Viewport(const RectF &clientRect={ }, Float minDepth=0.f, Float maxDepth=1.f) noexcept
Initializes a new viewport.
Definition viewport.cpp:28
Viewport(const Viewport &_other)
Creates a copy of a viewport.
~Viewport() noexcept override
Releases the render target instance.
Float getMaxDepth() const noexcept override
Gets the maximum depth of the viewport.The maximum depth of the viewport.
Definition viewport.cpp:55
Float getMinDepth() const noexcept override
Gets the minimum depth of the viewport.The minimum depth of the viewport.
Definition viewport.cpp:45
Represents a virtual allocator that manages memory distribution from a piece of raw memory.
Definition rendering_api.hpp:3032
static VirtualAllocator create(UInt64 overallMemory, AllocationAlgorithm algorithm=AllocationAlgorithm::Default)
Creates a new virtual allocator instance.
Definition rendering_api.hpp:3161
VirtualAllocator(const VirtualAllocator &)=delete
Allocation allocate(UInt64 size, UInt32 alignment=1u, AllocationStrategy strategy=AllocationStrategy::OptimizePacking, void *privateData=nullptr) const
Allocates a piece of memory of size bytes, aligned to alignment .
Definition rendering_api.hpp:3190
AllocationAlgorithm algorithm() const noexcept
Returns the algorithm used by the allocator.
Definition rendering_api.hpp:3178
void * privateData(const Allocation &allocation) const
Returns the private data associated with an allocation.
Definition rendering_api.hpp:3210
void free(Allocation &&allocation) const
Releases an allocation from the allocator, so that its memory can be re-used later.
Definition rendering_api.hpp:3201
VirtualAllocator(VirtualAllocator &&) noexcept=delete
UInt64 size() const noexcept
Returns the size of the memory managed by the virtual allocator.
Definition rendering_api.hpp:3170
Implements the IResource interface.
Definition containers.hpp:823
An exception that is thrown, if a requested operation could not be executed.
Definition exceptions.hpp:235
static auto create(TArgs &&... args) -> SharedPtr< T >
Generic factory method used to create instances of the shared object.
Definition containers.hpp:1114
SharedObject() noexcept=default
Initializes a new shared object.
auto shared_from_this(this TSelf &&self) noexcept
Returns a shared pointer to the current object instance.
Definition containers.hpp:1123
Definition rasterizer.cpp:9
Definition render_pass_dependency.cpp:9
Definition render_target.cpp:9
Definition state_resource.cpp:9
Definition timing_event.cpp:9
Definition viewport.cpp:9
Concept that can be used to refer to render backend implementations.
Definition rendering_api.hpp:11378
Definition blitter.hpp:14
@ Invalid
Definition logging.hpp:37
Contains additional exported vector types.
Definition math.hpp:617
TVector3< UInt8 > ByteVector3
A vector that contains three bytes.
Definition math.hpp:631
uint16_t UInt16
A type for an unsigned 16 bit integer.
Definition math.hpp:51
uint8_t UInt8
A type for an unsigned 8 bit integer.
Definition math.hpp:41
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
Matrix< T, 3, 4 > TMatrix3x4
A generic matrix with 3 rows and 4 columns.
Definition matrix.hpp:632
int32_t Int32
A type for a signed 32 bit integer.
Definition math.hpp:56
BorderMode
Describes how to treat texture coordinates that are outside the domain [0..1].
Definition rendering_api.hpp:1356
@ RepeatMirrored
Mirror the texture.
Definition rendering_api.hpp:1365
@ Repeat
Repeat the texture.
Definition rendering_api.hpp:1360
@ ClampToEdge
Take the closest edge texel.
Definition rendering_api.hpp:1370
@ ClampToEdgeMirrored
Take the closest edge texel from the opposite site.
Definition rendering_api.hpp:1375
@ ClampToBorder
Return a pre-specified border color.
Definition rendering_api.hpp:1380
CullOrder
Describes the order or vertex winding, that is used to determine, whether a polygon is facing towards...
Definition rendering_api.hpp:1190
@ CounterClockWise
Vertices are evaluated in a counter clock-wise manner.
Definition rendering_api.hpp:1199
@ ClockWise
Vertices are evaluated in a clock-wise manner.
Definition rendering_api.hpp:1194
DescriptorHeapType
The target heap type for a descriptor.
Definition rendering_api.hpp:580
@ Sampler
Binds all sampler states.
Definition rendering_api.hpp:594
@ None
Indicates an invalid heap.
Definition rendering_api.hpp:584
@ Resource
Binds all non-sampler resource views.
Definition rendering_api.hpp:589
RenderTargetFlags
Describes the behavior of render targets.
Definition rendering_api.hpp:1228
@ None
No flags are enabled.
Definition rendering_api.hpp:1232
@ ClearStencil
If enabled and the render target format supports stencil storage, the stencil part is cleared when th...
Definition rendering_api.hpp:1242
@ Clear
If enabled, color or depth (depending on the render target type) are cleared when starting a render p...
Definition rendering_api.hpp:1237
LITEFX_DEFINE_FLAGS(QueueType)
ImageLayout
Specifies the layout of an IImage resource.
Definition rendering_api.hpp:1858
@ ResolveSource
Indicates that the image is resolved from a multi-sampled image.
Definition rendering_api.hpp:1939
@ ResolveDestination
Indicates that the image is a render-target that a multi-sampled image is resolved into.
Definition rendering_api.hpp:1947
@ CopyDestination
Allows the image to be used as a destination for transfer operations.
Definition rendering_api.hpp:1897
@ DepthRead
Indicates that image is used as a read-only depth/stencil target.
Definition rendering_api.hpp:1913
@ ReadWrite
Indicates that the image is used as a read-write storage or texel buffer.
Definition rendering_api.hpp:1881
@ DepthWrite
Indicates that the image is used as a write-only depth/stencil target.
Definition rendering_api.hpp:1921
@ ShaderResource
Indicates that the image is used as a read-only storage or texel buffer.
Definition rendering_api.hpp:1873
@ Undefined
The layout of the image is not known by the engine.
Definition rendering_api.hpp:1959
@ CopySource
Allows the image to be used as a source for transfer operations.
Definition rendering_api.hpp:1889
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
BlendFactor
Specifies a blend factor.
Definition rendering_api.hpp:1479
@ DestinationAlpha
Definition rendering_api.hpp:1488
@ One
Definition rendering_api.hpp:1481
@ OneMinusConstantColor
Definition rendering_api.hpp:1491
@ SourceColor
Definition rendering_api.hpp:1482
@ Source1Color
Definition rendering_api.hpp:1495
@ SourceAlpha
Definition rendering_api.hpp:1486
@ ConstantAlpha
Definition rendering_api.hpp:1492
@ OneMinusDestinationColor
Definition rendering_api.hpp:1485
@ OneMinusSource1Color
Definition rendering_api.hpp:1496
@ OneMinusSourceColor
Definition rendering_api.hpp:1483
@ Source1Alpha
Definition rendering_api.hpp:1497
@ SourceAlphaSaturate
Definition rendering_api.hpp:1494
@ OneMinusConstantAlpha
Definition rendering_api.hpp:1493
@ OneMinusSourceAlpha
Definition rendering_api.hpp:1487
@ OneMinusSource1Alpha
Definition rendering_api.hpp:1498
@ DestinationColor
Definition rendering_api.hpp:1484
@ Zero
Definition rendering_api.hpp:1480
@ ConstantColor
Definition rendering_api.hpp:1490
@ OneMinusDestinationAlpha
Definition rendering_api.hpp:1489
CullMode
Describes which faces are culled by the Rasterizer stage.
Definition rendering_api.hpp:1163
@ FrontFaces
The rasterizer will discard front-facing polygons.
Definition rendering_api.hpp:1167
@ Both
The rasterizer will discard front and back-facing polygons.
Definition rendering_api.hpp:1177
@ Disabled
The rasterizer will not discard any polygons.
Definition rendering_api.hpp:1182
@ BackFaces
The rasterizer will discard back-facing polygons.
Definition rendering_api.hpp:1172
ShaderStage
Describes the valid shader stages of a graphics pipeline.
Definition rendering_api.hpp:971
@ Fragment
Represents the fragment or pixel shader stage.
Definition rendering_api.hpp:998
@ MeshPipeline
Represents the complete mesh shading pipeline.
Definition rendering_api.hpp:1053
@ Mesh
Represents the mesh shader stage.
Definition rendering_api.hpp:1013
@ Callable
Represents the callable shader stage.
Definition rendering_api.hpp:1043
@ TessellationEvaluation
Represents the tessellation evaluation or domain shader stage.
Definition rendering_api.hpp:985
@ TessellationControl
Represents the tessellation control or hull shader stage.
Definition rendering_api.hpp:980
@ Intersection
Represents the intersection shader stage.
Definition rendering_api.hpp:1038
@ RasterizationPipeline
Represents the complete rasterization pipeline.
Definition rendering_api.hpp:1048
@ RayGeneration
Represents the ray generation shader stage.
Definition rendering_api.hpp:1018
@ ClosestHit
Represents the closest-hit shader stage.
Definition rendering_api.hpp:1028
@ Geometry
Represents the geometry shader stage.
Definition rendering_api.hpp:993
@ Miss
Represents the miss shader stage.
Definition rendering_api.hpp:1033
@ Task
Represents the task or amplification shader stage.
Definition rendering_api.hpp:1008
@ Any
Enables all supported shader stages.
Definition rendering_api.hpp:1063
@ AnyHit
Represents the any-hit shader stage.
Definition rendering_api.hpp:1023
RenderTargetType
Describes the type of a render target.
Definition rendering_api.hpp:1205
@ DepthStencil
Represents a depth/stencil target.
Definition rendering_api.hpp:1214
@ Present
Represents a color target that should be presented.
Definition rendering_api.hpp:1222
constexpr UInt32 getBufferFormatChannelSize(BufferFormat format)
Returns the number of bytes used by a channel of a buffer format.
Definition rendering_api.hpp:2099
GraphicsAdapterType
Defines different types of graphics adapters.
Definition rendering_api.hpp:76
@ CPU
The adapter is a software driver.
Definition rendering_api.hpp:90
@ GPU
The adapter is a dedicated GPU or integrated CPU adapter.
Definition rendering_api.hpp:85
CompareOperation
Describes the operation used to compare depth or stencil values during depth/stencil tests.
Definition rendering_api.hpp:1387
@ NotEqual
The test succeeds, if the current value is not equal to the stencil ref or previous depth value.
Definition rendering_api.hpp:1421
@ Less
The test succeeds, if the current value is less than the stencil ref or previous depth value.
Definition rendering_api.hpp:1396
@ Always
The test always succeeds.
Definition rendering_api.hpp:1426
@ Never
The test always fails.
Definition rendering_api.hpp:1391
@ GreaterEqual
The test succeeds, if the current value is greater or equal to the stencil ref or previous depth valu...
Definition rendering_api.hpp:1416
@ Greater
The test succeeds, if the current value is greater than the stencil ref or previous depth value.
Definition rendering_api.hpp:1401
@ LessEqual
The test succeeds, if the current value is less or equal to the stencil ref or previous depth value.
Definition rendering_api.hpp:1411
@ Equal
The test succeeds, if the current value is equal to the stencil ref or previous depth value.
Definition rendering_api.hpp:1406
BlendOperation
Specifies a blend operation.
Definition rendering_api.hpp:1531
@ Subtract
Definition rendering_api.hpp:1533
@ Maximum
Definition rendering_api.hpp:1536
@ Minimum
Definition rendering_api.hpp:1535
@ ReverseSubtract
Definition rendering_api.hpp:1534
@ Add
Definition rendering_api.hpp:1532
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
@ PointList
A list of points where each vertex refers to an individual point.
Definition rendering_api.hpp:941
@ TriangleStrip
A strip of triangles, where each vertex (except the first two) refers to the third vertex of the next...
Definition rendering_api.hpp:965
@ LineList
A list of lines where each vertex pair refers to the start and end points of a line.
Definition rendering_api.hpp:947
@ LineStrip
A strip of lines where each vertex (except the first one) refers to the end point for the next line s...
Definition rendering_api.hpp:959
@ 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
@ Point
Polygons are drawn as points at the vertex positions.
Definition rendering_api.hpp:1156
@ Wireframe
Polygons are only drawn as wire-frames.
Definition rendering_api.hpp:1151
@ Solid
Polygons are drawn as solid surfaces.
Definition rendering_api.hpp:1146
BufferType
Describes the type of a IBuffer.
Definition rendering_api.hpp:601
@ ShaderBindingTable
Describes a shader binding table for ray-tracing.
Definition rendering_api.hpp:647
@ Index
Describes an index buffer.
Definition rendering_api.hpp:610
@ Storage
Describes a shader storage buffer object (Vulkan) or unordered access view (DirectX).
Definition rendering_api.hpp:626
@ Texel
Describes a shader texel storage buffer object (Vulkan) or unordered access view (DirectX).
Definition rendering_api.hpp:634
@ Uniform
Describes an uniform buffer object (Vulkan) or constant buffer view (DirectX).
Definition rendering_api.hpp:618
DefragmentationStrategy
The strategy to apply to a defragmentation pass.
Definition rendering_api.hpp:886
@ Full
Provides optimal packing at the cost of potentially more copies.
Definition rendering_api.hpp:900
@ Balanced
Provides a balance between fragment computation time and packing efficiency.
Definition rendering_api.hpp:895
@ Fast
Provides fast fragment computation, but potentially suboptimal packing.
Definition rendering_api.hpp:890
InstanceFlags
Controls how an instance within a ITopLevelAccelerationStructure behaves during ray-tracing.
Definition rendering_api.hpp:2029
@ DisableCull
If this flag is set front- and backface culling is disabled for the instance.
Definition rendering_api.hpp:2038
@ ForceNonOpaque
If this flag is set, each geometry of the instance will ignore the GeometryFlags::Opaquesetting.
Definition rendering_api.hpp:2061
@ None
The instance uses default behavior.
Definition rendering_api.hpp:2033
@ ForceOpaque
If this flag is set, no geometry of the instance invokes the any-hit shader. This overwrites per-geom...
Definition rendering_api.hpp:2052
@ FlipWinding
If this flag is set, front- and backfaces flip their default cull order.
Definition rendering_api.hpp:2043
AttributeSemantic
Describes the semantic of a buffer attribute.
Definition rendering_api.hpp:372
@ BlendIndices
The attribute contains blend indices.
Definition rendering_api.hpp:381
@ PointSize
The attribute contains a point size.
Definition rendering_api.hpp:411
@ Binormal
The attribute contains a bi-normal vector.
Definition rendering_api.hpp:376
@ Arbitrary
The attribute contains arbitrary data, that does not have any semantic associated with it.
Definition rendering_api.hpp:426
@ Position
The attribute contains a position vector.
Definition rendering_api.hpp:401
@ Tangent
The attribute contains a tangent vector.
Definition rendering_api.hpp:416
@ BlendWeight
The attribute contains blend weights.
Definition rendering_api.hpp:386
@ Unknown
The attribute is a generic, unknown semantic.
Definition rendering_api.hpp:431
@ TransformedPosition
The attribute contains a pre-transformed position vector.
Definition rendering_api.hpp:406
@ Color
The attribute contains a color value.
Definition rendering_api.hpp:391
@ TextureCoordinate
The attribute contains a texture coordinate.
Definition rendering_api.hpp:421
constexpr UInt32 getBufferFormatType(BufferFormat format)
Returns the underlying data type of a buffer format.
Definition rendering_api.hpp:2107
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
@ Volatile
Causes the contents of the resource to not be copied during defragmentation.
Definition rendering_api.hpp:824
@ Default
Shortcut for commonly used TransferSource | TransferDestination combination.
Definition rendering_api.hpp:809
@ TransferSource
Allows the resource data to be copied into another resource.
Definition rendering_api.hpp:782
@ TransferDestination
Allows the resource data to be copied from another resource.
Definition rendering_api.hpp:790
@ AccelerationStructureBuildInput
Allows the resource to be used to build acceleration structures.
Definition rendering_api.hpp:804
@ AllowWrite
Allows the resource to be written to.
Definition rendering_api.hpp:774
GeometryFlags
Controls how a geometry that is part of a bottom-level acceleration structure (BLAS) behaves during r...
Definition rendering_api.hpp:1966
@ None
Implies no restrictions on the geometry.
Definition rendering_api.hpp:1970
@ OneShotAnyHit
If this flag is set, the any-hit shader for this geometry is only invoked once for each primitive of ...
Definition rendering_api.hpp:1980
@ Opaque
If this flag is set, the any-hit shader for this geometry is never invoked, even if it is present wit...
Definition rendering_api.hpp:1975
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_1
Represents a 1D image.
Definition rendering_api.hpp:1262
@ DIM_2
Represents a 2D image.
Definition rendering_api.hpp:1267
@ DIM_3
Represents a 3D image.
Definition rendering_api.hpp:1272
@ CUBE
Represents a set of six 2D images that are used to build a cube map.
Definition rendering_api.hpp:1277
constexpr bool hasDepth(Format format) noexcept
Returns true, if the format contains a depth channel.
Definition rendering_api.hpp:2284
AllocationAlgorithm
The allocation algorithm used by VirtualAllocators.
Definition rendering_api.hpp:852
@ Linear
A linear allocation algorithm, that allocates memory blocks sequentially.
Definition rendering_api.hpp:863
DescriptorType
Describes the type of a IDescriptor.
Definition rendering_api.hpp:442
@ RWStructuredBuffer
A writable shader storage object in Vulkan. Maps to a read/write structured buffer in DirectX.
Definition rendering_api.hpp:472
@ SamplerDescriptorHeap
A special descriptor type that allows indexed access to the a portion of the global sampler heap.
Definition rendering_api.hpp:574
@ InputAttachment
The result of a render target from an earlier render pass. Maps to a SubpassInput in HLSL.
Definition rendering_api.hpp:502
@ AccelerationStructure
Represents a ray-tracing acceleration structure.
Definition rendering_api.hpp:539
@ ByteAddressBuffer
Represents an unformatted buffer.
Definition rendering_api.hpp:526
@ ResourceDescriptorHeap
Special descriptor type, that can bind all resources besides constant buffers, acceleration structure...
Definition rendering_api.hpp:563
@ RWByteAddressBuffer
Represents an unformatted writable buffer.
Definition rendering_api.hpp:534
@ Buffer
Represents a read-only texel buffer (uniform texel buffer).
Definition rendering_api.hpp:510
@ RWTexture
A writable image.
Definition rendering_api.hpp:492
@ RWBuffer
Represents a writable texel buffer (storage texel buffer).
Definition rendering_api.hpp:518
@ Texture
A read-only sampled image.
Definition rendering_api.hpp:484
@ StructuredBuffer
A shader storage buffer object in Vulkan. Maps to a structured buffer in DirectX.
Definition rendering_api.hpp:461
@ ConstantBuffer
A uniform buffer in Vulkan. Maps to a constant buffer in DirectX.
Definition rendering_api.hpp:449
AllocationStrategy
The allocation strategy used by allocators (IGraphicsFactory and VirtualAllocator) when allocating ne...
Definition rendering_api.hpp:869
@ OptimizeTime
Prefers allocation time over packing.
Definition rendering_api.hpp:878
@ OptimizePacking
Prefers good packing over allocation time and reduces fragmentation.
Definition rendering_api.hpp:873
QueuePriority
Specifies the priority with which a queue is scheduled on the GPU.
Definition rendering_api.hpp:160
@ High
A high queue priority.
Definition rendering_api.hpp:169
@ Normal
The default queue priority.
Definition rendering_api.hpp:164
@ Realtime
The highest possible queue priority. Submitting work to this queue might block other queues.
Definition rendering_api.hpp:177
QueueType
Represents the type of a CommandQueue.
Definition rendering_api.hpp:114
@ VideoDecode
Represents a queue that can perform hardware video decoding.
Definition rendering_api.hpp:141
@ Transfer
Represents a queue that can execute only transfer workloads.
Definition rendering_api.hpp:133
@ Compute
Represents a queue that can execute compute and transfer workloads.
Definition rendering_api.hpp:128
@ VideoEncode
Represents a queue that can perform hardware video encoding.
Definition rendering_api.hpp:149
ResourceHeap
Defines where a resource (buffer or image) memory is located and from where it can be accessed.
Definition rendering_api.hpp:710
@ Staging
Creates a resource that can be mapped from the CPU in order to be transferred to the GPU later.
Definition rendering_api.hpp:719
@ Dynamic
Creates a resource that can be mapped from the CPU and read by the GPU.
Definition rendering_api.hpp:737
@ Readback
Creates a buffer that can be written on the GPU and read by the CPU.
Definition rendering_api.hpp:742
@ GPUUpload
Creates a buffer that is directly allocated in GPU memory, but that can be efficiently written from t...
Definition rendering_api.hpp:752
StencilOperation
An operation that is applied to the stencil buffer.
Definition rendering_api.hpp:1433
@ Keep
Keep the current stencil value.
Definition rendering_api.hpp:1437
@ Replace
Replace the current stencil value with the stencil ref.
Definition rendering_api.hpp:1447
@ IncrementClamp
Increment the current stencil value.
Definition rendering_api.hpp:1452
@ DecrementClamp
Decrement the current stencil value.
Definition rendering_api.hpp:1457
@ DecrementWrap
Decrement the current stencil value and wrap it, if it goes out of bounds.
Definition rendering_api.hpp:1472
@ Invert
Bitwise invert the current stencil value.
Definition rendering_api.hpp:1462
@ IncrementWrap
Increment the current stencil value and wrap it, if it goes out of bounds.
Definition rendering_api.hpp:1467
@ Zero
Set the stencil value to 0.
Definition rendering_api.hpp:1442
AccelerationStructureFlags
Controls how an acceleration structure should be built.
Definition rendering_api.hpp:1988
@ MinimizeMemory
Prefer to minimize the memory footprint of the acceleration structure, but at the cost of ray-tracing...
Definition rendering_api.hpp:2023
@ PreferFastBuild
Prefer fast build times for the acceleration structure, but sacrifice ray-tracing performance.
Definition rendering_api.hpp:2018
@ None
Use default options for building the acceleration structure.
Definition rendering_api.hpp:1992
@ AllowCompaction
Allow the acceleration structure to be compacted.
Definition rendering_api.hpp:2002
@ PreferFastTrace
Prefer building a better performing acceleration structure, that possibly takes longer to build.
Definition rendering_api.hpp:2010
@ AllowUpdate
Allow the acceleration structure to be updated.
Definition rendering_api.hpp:1997
struct LITEFX_RENDERING_API alignas(16) IndirectBatch
An indirect batch used to execute an standard draw call.
Definition rendering_api.hpp:2321
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
@ DontExpandCache
Does not resize heap cache, if no more pre-allocated memory is available and will fail,...
Definition rendering_api.hpp:846
@ StayWithinBudget
Stays within heap budgets. If the desired resource heap is out of memory, allocation will fail....
Definition rendering_api.hpp:840
const size_t SHADER_RECORD_LOCAL_DATA_ALIGNMENT
The size (in bytes) to which shader record local data must be aligned.
Definition rendering_api.hpp:6763
ShaderRecordType
Describes the type of a shader module record within a shader collection or shader binting table.
Definition rendering_api.hpp:1075
@ Invalid
Represents a shader record that contains a module of an unsupported shader stage.
Definition rendering_api.hpp:1104
@ Callable
Represents a callable shader record.
Definition rendering_api.hpp:1099
@ Intersection
Represents an intersection shader record.
Definition rendering_api.hpp:1089
@ HitGroup
Represents a hit group shader record.
Definition rendering_api.hpp:1084
@ RayGeneration
Represents a ray generation shader record.
Definition rendering_api.hpp:1079
@ Miss
Represents a miss shader record.
Definition rendering_api.hpp:1094
VertexBufferInputRate
The rate at which a vertex buffer of a certain IVertexBufferLayout is made available for vertex shade...
Definition rendering_api.hpp:922
PipelineStage
Defines pipeline stages as points where synchronization may occur.
Definition rendering_api.hpp:1545
@ Resolve
Waits for previous commands to finish the multi-sampling resolution stage, or blocks following comman...
Definition rendering_api.hpp:1672
@ Raytracing
Waits for the previous commands to finish ray-tracing shader stages, or blocks the following commands...
Definition rendering_api.hpp:1698
@ Draw
Waits for previous commands to finish all graphics stages, or blocks following commands until the gra...
Definition rendering_api.hpp:1574
@ InputAssembly
Waits for previous commands to finish the input assembly stage, or blocks following commands until th...
Definition rendering_api.hpp:1582
@ AccelerationStructureCopy
Waits for previous commands to finish the copying stage for an acceleration structure,...
Definition rendering_api.hpp:1690
@ AccelerationStructureBuild
Waits for previous commands to finish the building stage for an acceleration structure,...
Definition rendering_api.hpp:1681
BufferFormat
Describes a buffer attribute format.
Definition rendering_api.hpp:340
@ X32U
Definition rendering_api.hpp:356
@ XY16I
Definition rendering_api.hpp:346
@ XYZ32I
Definition rendering_api.hpp:361
@ XYZW32F
Definition rendering_api.hpp:363
@ X16F
Definition rendering_api.hpp:342
@ XYZW32U
Definition rendering_api.hpp:365
@ XY16F
Definition rendering_api.hpp:345
@ XYZ16U
Definition rendering_api.hpp:350
@ XYZ16I
Definition rendering_api.hpp:349
@ XY32U
Definition rendering_api.hpp:359
@ XY32I
Definition rendering_api.hpp:358
@ X16I
Definition rendering_api.hpp:343
@ XYZ16F
Definition rendering_api.hpp:348
@ XY16U
Definition rendering_api.hpp:347
@ XYZW16U
Definition rendering_api.hpp:353
@ XYZW32I
Definition rendering_api.hpp:364
@ XYZ32U
Definition rendering_api.hpp:362
@ X16U
Definition rendering_api.hpp:344
@ XYZW16I
Definition rendering_api.hpp:352
@ XYZ32F
Definition rendering_api.hpp:360
@ X32I
Definition rendering_api.hpp:355
@ XY32F
Definition rendering_api.hpp:357
@ XYZW16F
Definition rendering_api.hpp:351
@ X32F
Definition rendering_api.hpp:354
constexpr bool hasStencil(Format format) noexcept
Returns true, if the format contains a stencil channel.
Definition rendering_api.hpp:2301
constexpr UInt32 getBufferFormatChannels(BufferFormat format)
Returns the number of channels for a buffer format.
Definition rendering_api.hpp:2091
constexpr size_t getSize(Format format)
Returns the size of an element of a specified format.
Definition rendering_api.hpp:2114
ResourceAccess
Defines how a IBuffer or IImage resource is accessed.
Definition rendering_api.hpp:1709
@ ResolveWrite
Indicates that a resource is accessed as to write during a resolve operation.
Definition rendering_api.hpp:1822
@ ResolveRead
Indicates that a resource is accessed as to read during a resolve operation.
Definition rendering_api.hpp:1814
@ AccelerationStructureRead
Indicates that a resources is accessed to read an acceleration structure.
Definition rendering_api.hpp:1840
@ ShaderRead
Indicates that a resource is accessed as a read-only shader resource.
Definition rendering_api.hpp:1774
@ UniformBuffer
Indicates that a resource is accessed as an uniform/constant buffer.
Definition rendering_api.hpp:1742
@ DepthStencilRead
Indicates that a resource is accessed as to read depth/stencil values.
Definition rendering_api.hpp:1758
@ DepthStencilWrite
Indicates that a resource is accessed as to write depth/stencil values.
Definition rendering_api.hpp:1766
@ TransferRead
Indicates that a resource is accessed as to read during a transfer operation.
Definition rendering_api.hpp:1798
@ AccelerationStructureWrite
Indicates that a resources is accessed to write an acceleration structure.
Definition rendering_api.hpp:1848
@ ShaderReadWrite
Indicates that a resource is accessed as a read-write shader resource.
Definition rendering_api.hpp:1782
@ Common
Indicates that a resource can be accessed in any way, compatible to the layout.
Definition rendering_api.hpp:1832
@ TransferWrite
Indicates that a resource is accessed as to write during a transfer operation.
Definition rendering_api.hpp:1806
WriteMask
Specifies a write mask for a color buffer.
Definition rendering_api.hpp:1505
@ A
Write into the alpha channel.
Definition rendering_api.hpp:1524
@ B
Write into the blue channel.
Definition rendering_api.hpp:1519
@ G
Write into the green channel.
Definition rendering_api.hpp:1514
@ R
Write into the red channel.
Definition rendering_api.hpp:1509
Format
Describes a texel format.
Definition rendering_api.hpp:183
@ R4G4B4A4_UNORM
Definition rendering_api.hpp:186
@ R16G16_UINT
Definition rendering_api.hpp:265
@ R64G64_SINT
Definition rendering_api.hpp:298
@ R16G16B16_UINT
Definition rendering_api.hpp:272
@ BC3_SRGB
Definition rendering_api.hpp:322
@ D16_UNORM
Definition rendering_api.hpp:308
@ R32G32B32A32_SFLOAT
Definition rendering_api.hpp:293
@ A2R10G10B10_USCALED
Definition rendering_api.hpp:244
@ BC1_RGB_SRGB
Definition rendering_api.hpp:316
@ R32G32B32A32_UINT
Definition rendering_api.hpp:291
@ R16_SSCALED
Definition rendering_api.hpp:257
@ B8G8R8A8_UNORM
Definition rendering_api.hpp:228
@ R8G8B8_USCALED
Definition rendering_api.hpp:209
@ R16G16B16_SFLOAT
Definition rendering_api.hpp:274
@ R32G32B32_SFLOAT
Definition rendering_api.hpp:290
@ A2R10G10B10_SSCALED
Definition rendering_api.hpp:245
@ B8G8R8_SRGB
Definition rendering_api.hpp:220
@ R64_SINT
Definition rendering_api.hpp:295
@ R16G16B16A16_USCALED
Definition rendering_api.hpp:277
@ BC7_SRGB
Definition rendering_api.hpp:330
@ B8G8R8_SSCALED
Definition rendering_api.hpp:217
@ R64G64B64A64_UINT
Definition rendering_api.hpp:303
@ D32_SFLOAT
Definition rendering_api.hpp:310
@ R16_SINT
Definition rendering_api.hpp:259
@ R8G8B8_UINT
Definition rendering_api.hpp:211
@ R64G64B64A64_SFLOAT
Definition rendering_api.hpp:305
@ R16G16B16_UNORM
Definition rendering_api.hpp:268
@ S8_UINT
Definition rendering_api.hpp:311
@ R8G8_SNORM
Definition rendering_api.hpp:201
@ R16_USCALED
Definition rendering_api.hpp:256
@ R64G64_SFLOAT
Definition rendering_api.hpp:299
@ R8G8B8_SSCALED
Definition rendering_api.hpp:210
@ B5G6R5_UNORM
Definition rendering_api.hpp:189
@ R8G8_SSCALED
Definition rendering_api.hpp:203
@ R32_SFLOAT
Definition rendering_api.hpp:284
@ R8G8B8A8_SINT
Definition rendering_api.hpp:226
@ D32_SFLOAT_S8_UINT
Definition rendering_api.hpp:314
@ R4G4_UNORM
Definition rendering_api.hpp:185
@ R16_SNORM
Definition rendering_api.hpp:255
@ B8G8R8A8_UINT
Definition rendering_api.hpp:232
@ R16G16B16_SINT
Definition rendering_api.hpp:273
@ R64_SFLOAT
Definition rendering_api.hpp:296
@ A8B8G8R8_SRGB
Definition rendering_api.hpp:241
@ R8G8B8A8_SNORM
Definition rendering_api.hpp:222
@ R16G16_SFLOAT
Definition rendering_api.hpp:267
@ B5G5R5A1_UNORM
Definition rendering_api.hpp:191
@ A8B8G8R8_SINT
Definition rendering_api.hpp:240
@ BC6H_SFLOAT
Definition rendering_api.hpp:328
@ D16_UNORM_S8_UINT
Definition rendering_api.hpp:312
@ R8G8B8_UNORM
Definition rendering_api.hpp:207
@ A2B10G10R10_UNORM
Definition rendering_api.hpp:248
@ R16G16B16A16_SINT
Definition rendering_api.hpp:280
@ R64G64B64_UINT
Definition rendering_api.hpp:300
@ R16G16_USCALED
Definition rendering_api.hpp:263
@ A2R10G10B10_SNORM
Definition rendering_api.hpp:243
@ R64G64B64A64_SINT
Definition rendering_api.hpp:304
@ R8G8B8A8_SRGB
Definition rendering_api.hpp:227
@ R8G8B8_SRGB
Definition rendering_api.hpp:213
@ R16G16B16A16_SNORM
Definition rendering_api.hpp:276
@ R8G8B8A8_UINT
Definition rendering_api.hpp:225
@ R8G8_UINT
Definition rendering_api.hpp:204
@ R16G16B16A16_SFLOAT
Definition rendering_api.hpp:281
@ R16G16B16A16_UNORM
Definition rendering_api.hpp:275
@ None
Definition rendering_api.hpp:184
@ R8G8_SRGB
Definition rendering_api.hpp:206
@ R8_UNORM
Definition rendering_api.hpp:193
@ BC1_RGBA_SRGB
Definition rendering_api.hpp:318
@ A8B8G8R8_UINT
Definition rendering_api.hpp:239
@ R8G8_UNORM
Definition rendering_api.hpp:200
@ A2B10G10R10_UINT
Definition rendering_api.hpp:252
@ A2B10G10R10_SNORM
Definition rendering_api.hpp:249
@ A2R10G10B10_UNORM
Definition rendering_api.hpp:242
@ R16_UNORM
Definition rendering_api.hpp:254
@ A2R10G10B10_UINT
Definition rendering_api.hpp:246
@ R16_SFLOAT
Definition rendering_api.hpp:260
@ R8G8B8_SNORM
Definition rendering_api.hpp:208
@ R8_USCALED
Definition rendering_api.hpp:195
@ R8_SSCALED
Definition rendering_api.hpp:196
@ B8G8R8A8_USCALED
Definition rendering_api.hpp:230
@ BC5_SNORM
Definition rendering_api.hpp:326
@ BC5_UNORM
Definition rendering_api.hpp:325
@ R64_UINT
Definition rendering_api.hpp:294
@ BC1_RGBA_UNORM
Definition rendering_api.hpp:317
@ B8G8R8_UINT
Definition rendering_api.hpp:218
@ R8_SRGB
Definition rendering_api.hpp:199
@ R32G32B32_UINT
Definition rendering_api.hpp:288
@ BC2_UNORM
Definition rendering_api.hpp:319
@ R16G16_UNORM
Definition rendering_api.hpp:261
@ BC4_SNORM
Definition rendering_api.hpp:324
@ B8G8R8_USCALED
Definition rendering_api.hpp:216
@ R32_SINT
Definition rendering_api.hpp:283
@ R8_UINT
Definition rendering_api.hpp:197
@ R16G16_SINT
Definition rendering_api.hpp:266
@ R16G16B16A16_UINT
Definition rendering_api.hpp:279
@ R8G8B8_SINT
Definition rendering_api.hpp:212
@ R5G6B5_UNORM
Definition rendering_api.hpp:188
@ A2B10G10R10_USCALED
Definition rendering_api.hpp:250
@ BC4_UNORM
Definition rendering_api.hpp:323
@ D24_UNORM_S8_UINT
Definition rendering_api.hpp:313
@ B8G8R8_SINT
Definition rendering_api.hpp:219
@ A2B10G10R10_SINT
Definition rendering_api.hpp:253
@ R16G16_SNORM
Definition rendering_api.hpp:262
@ R8G8_USCALED
Definition rendering_api.hpp:202
@ B8G8R8A8_SNORM
Definition rendering_api.hpp:229
@ R16G16B16_SNORM
Definition rendering_api.hpp:269
@ R64G64B64_SFLOAT
Definition rendering_api.hpp:302
@ R16G16B16_USCALED
Definition rendering_api.hpp:270
@ R16G16B16A16_SSCALED
Definition rendering_api.hpp:278
@ BC1_RGB_UNORM
Definition rendering_api.hpp:315
@ B10G11R11_UFLOAT
Definition rendering_api.hpp:306
@ R16G16_SSCALED
Definition rendering_api.hpp:264
@ B8G8R8A8_SSCALED
Definition rendering_api.hpp:231
@ BC6H_UFLOAT
Definition rendering_api.hpp:327
@ R8G8B8A8_SSCALED
Definition rendering_api.hpp:224
@ R32G32_UINT
Definition rendering_api.hpp:285
@ A8B8G8R8_USCALED
Definition rendering_api.hpp:237
@ B4G4R4A4_UNORM
Definition rendering_api.hpp:187
@ R16_UINT
Definition rendering_api.hpp:258
@ R8G8_SINT
Definition rendering_api.hpp:205
@ BC2_SRGB
Definition rendering_api.hpp:320
@ A8B8G8R8_SSCALED
Definition rendering_api.hpp:238
@ R5G5B5A1_UNORM
Definition rendering_api.hpp:190
@ R32G32_SINT
Definition rendering_api.hpp:286
@ BC7_UNORM
Definition rendering_api.hpp:329
@ A2R10G10B10_SINT
Definition rendering_api.hpp:247
@ A8B8G8R8_UNORM
Definition rendering_api.hpp:235
@ R32G32_SFLOAT
Definition rendering_api.hpp:287
@ X8_D24_UNORM
Definition rendering_api.hpp:309
@ R32G32B32_SINT
Definition rendering_api.hpp:289
@ A2B10G10R10_SSCALED
Definition rendering_api.hpp:251
@ R64G64B64_SINT
Definition rendering_api.hpp:301
@ BC3_UNORM
Definition rendering_api.hpp:321
@ A1R5G5B5_UNORM
Definition rendering_api.hpp:192
@ A8B8G8R8_SNORM
Definition rendering_api.hpp:236
@ R32_UINT
Definition rendering_api.hpp:282
@ B8G8R8_UNORM
Definition rendering_api.hpp:214
@ E5B9G9R9_UFLOAT
Definition rendering_api.hpp:307
@ R64G64_UINT
Definition rendering_api.hpp:297
@ R8G8B8A8_UNORM
Definition rendering_api.hpp:221
@ B8G8R8A8_SINT
Definition rendering_api.hpp:233
@ R16G16B16_SSCALED
Definition rendering_api.hpp:271
@ B8G8R8_SNORM
Definition rendering_api.hpp:215
@ B8G8R8A8_SRGB
Definition rendering_api.hpp:234
@ R8_SINT
Definition rendering_api.hpp:198
@ R8_SNORM
Definition rendering_api.hpp:194
@ R8G8B8A8_USCALED
Definition rendering_api.hpp:223
@ R32G32B32A32_SINT
Definition rendering_api.hpp:292
MultiSamplingLevel
Describes the number of samples with which a IImage is sampled.
Definition rendering_api.hpp:1283
@ x32
Use 32 samples per pixel.
Definition rendering_api.hpp:1312
@ x16
Use 16 samples per pixel.
Definition rendering_api.hpp:1307
@ x1
The default number of samples. Multi-sampling will be deactivated, if this sampling level is used.
Definition rendering_api.hpp:1287
@ x2
Use 2 samples per pixel.
Definition rendering_api.hpp:1292
@ x64
Use 64 samples per pixel.
Definition rendering_api.hpp:1317
@ x4
Use 4 samples per pixel.
Definition rendering_api.hpp:1297
@ x8
Use 8 samples per pixel.
Definition rendering_api.hpp:1302
std::generator< T, TVal > Generator
Describes an intermediate container for elements of type T .
Definition containers.hpp:206
std::reference_wrapper< T > Ref
Represents a copyable and assignable reference wrapper.
Definition containers.hpp:145
constexpr UniquePtr< T > makeUnique()
Creates a new unique pointer.
Definition containers.hpp:153
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
std::span< T > Span
Represents a view of an array.
Definition containers.hpp:87
std::variant< T... > Variant
Represents a variant of objects.
Definition containers.hpp:130
@ Other
Definition app_api.hpp:32
@ None
Definition app_api.hpp:30
Definition input_assembler.cpp:19
An input range over another range, where the returned values of type T are covariants of the values ...
Definition containers.hpp:529
static constexpr mat_type identity() noexcept
Definition matrix.hpp:151
constexpr scalar_type x() const noexcept
Returns the value of the x component of the vector.
Definition vector.hpp:252
constexpr scalar_type z() const noexcept
Returns the value of the z component of the vector.
Definition vector.hpp:284
constexpr scalar_type y() const noexcept
Returns the value of the y component of the vector.
Definition vector.hpp:268
Describes the rasterizer depth bias.
Definition rendering_api.hpp:3797
Float SlopeFactor
Specifies the depth bias slope factor (default: 0.0).
Definition rendering_api.hpp:3812
bool Enable
Specifies, if depth bias should be used (default: false).
Definition rendering_api.hpp:3802
Float Clamp
Specifies the depth bias clamp (default: 0.0).
Definition rendering_api.hpp:3807
Float ConstantFactor
Specifies the depth bias constant factor (default: 0.0).
Definition rendering_api.hpp:3817
Describes the rasterizer depth state.
Definition rendering_api.hpp:3758
bool Enable
Specifies, if depth testing should be enabled (default: true).
Definition rendering_api.hpp:3763
CompareOperation Operation
The compare operation used to pass the depth test (default: CompareOperation::Always).
Definition rendering_api.hpp:3773
bool DepthBoundsTestEnable
Enables the depth bounds test.
Definition rendering_api.hpp:3785
bool Write
Specifies, if depth should be written (default: true).
Definition rendering_api.hpp:3768
Describes the rasterizer stencil state.
Definition rendering_api.hpp:3849
StencilTest BackFace
Describes the stencil test for faces that point away from the camera.
Definition rendering_api.hpp:3874
UInt8 ReadMask
Specifies the bits to read from the stencil state (default: 0xFF).
Definition rendering_api.hpp:3864
StencilTest FrontFace
Describes the stencil test for faces that point towards the camera.
Definition rendering_api.hpp:3869
UInt8 WriteMask
Specifies the bits to write to the stencil state (default: 0xFF).
Definition rendering_api.hpp:3859
bool Enable
Specifies, if stencil state should be used (default: false).
Definition rendering_api.hpp:3854
Describes a stencil test for either front or back faces.
Definition rendering_api.hpp:3823
CompareOperation Operation
The operation use for stencil testing (default: CompareOperation::Never).
Definition rendering_api.hpp:3843
StencilOperation StencilPassOp
The operation to apply to the stencil buffer, if the stencil test passes (default: StencilOperation::...
Definition rendering_api.hpp:3833
StencilOperation DepthFailOp
The operation to apply to the stencil buffer, if the depth test fails (default: StencilOperation::Kee...
Definition rendering_api.hpp:3838
StencilOperation StencilFailOp
The operation to apply to the stencil buffer, if the stencil test fails (default: StencilOperation::K...
Definition rendering_api.hpp:3828
Describes a resource binding to a descriptor or descriptor set.
Definition rendering_api.hpp:6218
resource_container resource
The resource to bind or std::monostate if no resource should be bound.
Definition rendering_api.hpp:6239
UInt32 firstElement
The index of the first array element or image layer to bind, starting at firstDescriptor.
Definition rendering_api.hpp:6259
UInt32 elements
The number of array elements or image layers to bind, starting at firstDescriptor.
Definition rendering_api.hpp:6268
UInt32 firstLevel
If the resource is an image, this describes the first level to be bound.
Definition rendering_api.hpp:6276
Variant< std::monostate, Ref< const IBuffer >, Ref< const IImage >, Ref< const ISampler >, Ref< const IAccelerationStructure > > resource_container
Definition rendering_api.hpp:6220
Optional< UInt32 > binding
The binding point to bind the resource at. If not provided (i.e., std::nullopt), the index within the...
Definition rendering_api.hpp:6226
UInt32 levels
If the resource is an image, this describes the number of levels to be bound.
Definition rendering_api.hpp:6284
UInt32 firstDescriptor
The index of the descriptor in a descriptor array at which binding the resource arrays starts.
Definition rendering_api.hpp:6250
Describes a single descriptor binding point within a IShaderModule.
Definition rendering_api.hpp:3309
UInt32 Register
Stores the register index of the binding point.
Definition rendering_api.hpp:3314
bool operator==(const DescriptorBindingPoint &other) const noexcept
Implements equality comparison for descriptor binding points.
Definition rendering_api.hpp:3351
UInt32 Space
Stores the descriptor space (or set index) of the binding point.
Definition rendering_api.hpp:3319
auto operator<=>(const DescriptorBindingPoint &other) const noexcept
Implements three-way comparison for descriptor binding points.
Definition rendering_api.hpp:3331
Defines a single statistics block.
Definition rendering_api.hpp:10044
UInt64 minAllocationSize
The size of the smallest allocation.
Definition rendering_api.hpp:10083
UInt32 unusedRangeCount
The number of unoccupied memory ranges between allocations.
Definition rendering_api.hpp:10078
UInt32 allocations
Returns the total number of allocations in the heap.
Definition rendering_api.hpp:10063
bool onGpu
true, if the heap is located in video memory and false otherwise.
Definition rendering_api.hpp:10048
UInt64 blockSize
Returns the total size of allocated memory across all blocks in the heap.
Definition rendering_api.hpp:10068
bool cpuVisible
true, of the heap is accessible for the CPU and false otherwise.
Definition rendering_api.hpp:10053
UInt32 blocks
Returns the number of memory blocks in the heap.
Definition rendering_api.hpp:10058
UInt64 minUnusedRangeSize
The size of the smallest unused memory range.
Definition rendering_api.hpp:10093
UInt64 maxAllocationSize
The size of the largest allocation.
Definition rendering_api.hpp:10088
UInt64 allocationSize
Returns the total size of memory for all allocations in the heap. Always less or equal to totalBlockS...
Definition rendering_api.hpp:10073
UInt64 maxUnusedRangeSize
The size of the largest unused memory range.
Definition rendering_api.hpp:10098
Stores extended memory statistics, that can be queried by calling IGraphicsFactory::detailedMemorySta...
Definition rendering_api.hpp:10040
StatisticsBlock total
Stores the total memory statistics.
Definition rendering_api.hpp:10114
Array< StatisticsBlock > perResourceHeap
Stores the memory statistics per ResourceHeap.
Definition rendering_api.hpp:10109
Array< StatisticsBlock > perLocation
Stores the memory statistics per location (e.g., VRAM/RAM).
Definition rendering_api.hpp:10104
Describes optional features that can be supported by a device.
Definition rendering_api.hpp:10983
bool ViewInstancing
Enables support for view instancing/multi-view.
Definition rendering_api.hpp:11044
bool DepthBoundsTest
Enables support for enabling depth bounds test on IRenderPipeline creation.
Definition rendering_api.hpp:11030
bool RayQueries
Enables or disables ray query and inline ray-tracing support.
Definition rendering_api.hpp:10998
bool MeshShaders
Enables or disables mesh shader support.
Definition rendering_api.hpp:10988
bool DrawIndirect
Enables or disables support for indirect draw.
Definition rendering_api.hpp:11003
bool ConservativeRasterization
Enables support for conservative rasterization.
Definition rendering_api.hpp:11037
bool RayTracing
Enables or disables ray-tracing support.
Definition rendering_api.hpp:10993
bool DynamicDescriptors
Enables or disables support for dynamic descriptor types (SM 6.6 dynamic resources and VK_EXT_mutable...
Definition rendering_api.hpp:11023
Stores a buffer that contains axis-aligned bounding boxes.
Definition rendering_api.hpp:5481
GeometryFlags Flags
The flags that control how the primitives in the geometry behaves during ray-tracing.
Definition rendering_api.hpp:5503
SharedPtr< const IBuffer > Buffer
A buffer containing the bounding box definitions.
Definition rendering_api.hpp:5498
Represents a triangle mesh.
Definition rendering_api.hpp:5404
TriangleMesh(const TriangleMesh &other)=default
Initializes a new triangle mesh by copying another one.
TriangleMesh(const SharedPtr< const IVertexBuffer > &vertexBuffer, const SharedPtr< const IIndexBuffer > &indexBuffer=nullptr, const SharedPtr< const IBuffer > &transformBuffer=nullptr, GeometryFlags flags=GeometryFlags::None)
Initializes a new triangle mesh.
Definition rendering_api.hpp:5413
SharedPtr< const IBuffer > TransformBuffer
A buffer that stores a row-major 3x4 transformation matrix applied to the vertex buffer when building...
Definition rendering_api.hpp:5467
SharedPtr< const IVertexBuffer > VertexBuffer
The vertex buffer that stores the mesh vertices.
Definition rendering_api.hpp:5454
GeometryFlags Flags
The flags that control how the primitives in the geometry behaves during ray-tracing.
Definition rendering_api.hpp:5472
~TriangleMesh() noexcept=default
Releases the triangle mesh.
TriangleMesh & operator=(TriangleMesh &&other) noexcept=default
Takes over another triangle mesh.
TriangleMesh(TriangleMesh &&other) noexcept=default
Initializes a new triangle mesh by taking over another one.
SharedPtr< const IIndexBuffer > IndexBuffer
The index buffer that stores the mesh indices.
Definition rendering_api.hpp:5459
TriangleMesh & operator=(const TriangleMesh &other)=default
Copies another triangle mesh.
QueueSubmittedEventArgs(QueueSubmittedEventArgs &&) noexcept=default
UInt64 fence() const noexcept
Gets the fence that is triggered, if the command buffers have been executed.
Definition rendering_api.hpp:9792
QueueSubmittedEventArgs(UInt64 fence) noexcept
Definition rendering_api.hpp:9779
QueueSubmittedEventArgs(const QueueSubmittedEventArgs &)=default
const Array< SharedPtr< const ICommandBuffer > > & commandBuffers() const noexcept
Gets the command buffers that are about to be submitted to the queue.
Definition rendering_api.hpp:9766
QueueSubmittingEventArgs(QueueSubmittingEventArgs &&) noexcept=default
QueueSubmittingEventArgs(Array< SharedPtr< const ICommandBuffer > > &&commandBuffers)
Definition rendering_api.hpp:9752
QueueSubmittingEventArgs(const QueueSubmittingEventArgs &)=default
Stores a reference to a barrier that can be used to synchronize accesses to the resource with a move ...
Definition rendering_api.hpp:4764
PrepareMoveEventArgs(const PrepareMoveEventArgs &)=delete
PrepareMoveEventArgs()=delete
PrepareMoveEventArgs(PrepareMoveEventArgs &&) noexcept=delete
IBarrier & barrier() const noexcept
Returns a reference of the barrier that is used to synchronize the move operation with other accesses...
Definition rendering_api.hpp:4792
Stores the fence and the command queue to wait on for the fence before a moved resource can be used.
Definition rendering_api.hpp:4801
ResourceMovingEventArgs(ResourceMovingEventArgs &&) noexcept=default
ResourceMovingEventArgs(SharedPtr< const ICommandQueue > queue, UInt64 fence) noexcept
Creates a new instance of the resource moving event arguments.
Definition rendering_api.hpp:4812
ResourceMovingEventArgs(const ResourceMovingEventArgs &)=default
SharedPtr< const ICommandQueue > queue() const noexcept
Returns the queue that executes the resource move.
Definition rendering_api.hpp:4828
UInt64 fence() const noexcept
Returns the fence on queue after which the resource can be used.
Definition rendering_api.hpp:4836
ReleasedEventArgs(ReleasedEventArgs &&) noexcept=default
ReleasedEventArgs() noexcept
Definition rendering_api.hpp:8963
ReleasedEventArgs(const ReleasedEventArgs &)=default
ResizeEventArgs(Size2d newSize) noexcept
Definition rendering_api.hpp:8938
ResizeEventArgs(ResizeEventArgs &&) noexcept=default
ResizeEventArgs(const ResizeEventArgs &)=default
const Size2d & newSize() const noexcept
Returns the new size of the frame buffer.
Definition rendering_api.hpp:8951
Event arguments that are published to subscribers when a render pass is beginning.
Definition rendering_api.hpp:9298
const IFrameBuffer & frameBuffer() const noexcept
Gets the frame buffer on which the render pass is executing.
Definition rendering_api.hpp:9316
BeginEventArgs(const IFrameBuffer &frameBuffer) noexcept
Definition rendering_api.hpp:9303
BeginEventArgs(BeginEventArgs &&) noexcept=default
BeginEventArgs(const BeginEventArgs &)=default
Describes the blend state of the render target.
Definition rendering_api.hpp:3432
WriteMask ChannelWriteMask
The channel write mask, determining which channels are written to (default: WriteMask::R | WriteMask:...
Definition rendering_api.hpp:3472
BlendFactor SourceColor
The blend factor for the source color channels (default: BlendFactor::One).
Definition rendering_api.hpp:3442
BlendFactor DestinationColor
The blend factor for the destination color channels (default: BlendFactor::Zero).
Definition rendering_api.hpp:3447
bool Enable
Specifies, if the target should be blended (default: false).
Definition rendering_api.hpp:3437
BlendOperation ColorOperation
The blend operation for the color channels (default: BlendOperation::Add).
Definition rendering_api.hpp:3462
BlendFactor DestinationAlpha
The blend factor for the destination alpha channels (default: BlendFactor::Zero).
Definition rendering_api.hpp:3457
BlendFactor SourceAlpha
The blend factor for the source alpha channel (default: BlendFactor::One).
Definition rendering_api.hpp:3452
BlendOperation AlphaOperation
The blend operation for the alpha channel (default: BlendOperation::Add).
Definition rendering_api.hpp:3467
Describes a hit group for a triangle mesh geometry.
Definition rendering_api.hpp:6672
const IShaderModule * AnyHitShader
The any hit shader for the triangle mesh.
Definition rendering_api.hpp:6681
const IShaderModule * ClosestHitShader
The closest hit shader for the triangle mesh.
Definition rendering_api.hpp:6676
Describes a record within a shader binding table.
Definition rendering_api.hpp:6662
virtual constexpr const shader_group_type & shaderGroup() const noexcept=0
Returns the shader group containing the modules for this record.
IShaderRecord() noexcept=default
constexpr ShaderRecordType type() const noexcept
Returns the type of the shader record.
Definition rendering_api.hpp:6704
virtual constexpr UInt64 localDataSize() const noexcept=0
Returns the size of the shader-local data of the record.
virtual constexpr const void * localData() const noexcept=0
Returns a pointer to the shader-local data of the record.
Variant< const IShaderModule *, MeshGeometryHitGroup > shader_group_type
Defines the type that stores the shaders of the shader group.
Definition rendering_api.hpp:6687
BackBufferSwapEventArgs(BackBufferSwapEventArgs &&) noexcept=default
BackBufferSwapEventArgs(UInt32 backBuffer) noexcept
Definition rendering_api.hpp:9547
UInt32 backBuffer() const noexcept
Returns the index of the new back buffer on the swap chain.
Definition rendering_api.hpp:9561
BackBufferSwapEventArgs(const BackBufferSwapEventArgs &)=default
ResetEventArgs(const ResetEventArgs &)=default
const Size2d & renderArea() const noexcept
Gets the new render area of the swap chain back-buffers.
Definition rendering_api.hpp:9518
ResetEventArgs(Format surfaceFormat, Size2d renderArea, UInt32 buffers, bool enableVsync) noexcept
Definition rendering_api.hpp:9497
ResetEventArgs(ResetEventArgs &&) noexcept=default
UInt32 buffers() const noexcept
Gets the number of back-buffers in the swap chain.
Definition rendering_api.hpp:9526
Format surfaceFormat() const noexcept
Gets the new surface format of the swap chain back-buffers.
Definition rendering_api.hpp:9510
bool enableVsync() const noexcept
Returns true if vertical synchronization is enabled or false otherwise.
Definition rendering_api.hpp:9534
Represents an instance of an IBottomLevelAccelerationStructure.
Definition rendering_api.hpp:5688
UInt32 HitGroupOffset
An offset added to the address of the shader-local data of the shader record that is invoked for the ...
Definition rendering_api.hpp:5723
TMatrix3x4< Float > Transform
The transformation matrix for the instance.
Definition rendering_api.hpp:5697
UInt32 Id
The instance ID used in shaders to identify the instance.
Definition rendering_api.hpp:5702
InstanceFlags Flags
The flags that control the behavior of this instance.
Definition rendering_api.hpp:5728
UInt8 Mask
A user-defined mask value that is matched with another mask value during ray-tracing to include or di...
Definition rendering_api.hpp:5707
Stores simple memory heap statistics, that can be quickly queried by calling IGraphicsFactory::memory...
Definition rendering_api.hpp:9985
UInt32 blocks
Returns the number of memory blocks in the heap.
Definition rendering_api.hpp:9999
UInt64 blockSize
Returns the total size of allocated memory across all blocks in the heap.
Definition rendering_api.hpp:10009
bool cpuVisible
true, of the heap is accessible for the CPU and false otherwise.
Definition rendering_api.hpp:9994
UInt32 allocations
Returns the total number of allocations in the heap.
Definition rendering_api.hpp:10004
UInt64 availableMemory
Estimated memory available to the program in the heap.
Definition rendering_api.hpp:10031
UInt64 allocationSize
Returns the total size of memory for all allocations in the heap. Always less or equal to totalBlockS...
Definition rendering_api.hpp:10014
bool onGpu
true, if the heap is located in video memory and false otherwise.
Definition rendering_api.hpp:9989
UInt64 usedMemory
Estimated memory used by the program in the heap.
Definition rendering_api.hpp:10022
Defines a hint that is used to initialize a dynamic descriptor heap.
Definition rendering_api.hpp:7220
UInt32 HeapSize
The number of descriptors allocated for the heap.
Definition rendering_api.hpp:7229
DescriptorHeapType Type
The desired type of the descriptor heap.
Definition rendering_api.hpp:7224
Defines a hint that is used to mark a push constants range.
Definition rendering_api.hpp:7190
bool AsPushConstants
If the binding point binds a constant or uniform buffer, setting this property to true will configure...
Definition rendering_api.hpp:7195
Defines a hint that is used to mark additional a binding as used by certain shader stages.
Definition rendering_api.hpp:7244
ShaderStage Stages
A mask that contains the shader stages, that the descriptor set should be accessible from.
Definition rendering_api.hpp:7248
Defines a hint that is used to bind a static sampler state to a sampler descriptor.
Definition rendering_api.hpp:7201
SharedPtr< ISampler > StaticSampler
If the binding point binds a sampler, setting this property will bind a static or constant sampler,...
Definition rendering_api.hpp:7205
Defines a hint that is used to mark an unbounded descriptor array.
Definition rendering_api.hpp:7179
UInt32 MaxDescriptors
If the binding point binds an array, this property can be used to turn it into an unbounded array and...
Definition rendering_api.hpp:7184
A hint used during shader reflection to control the pipeline layout.
Definition rendering_api.hpp:7174
static auto pushConstants(DescriptorBindingPoint at) noexcept -> PipelineBindingHint
Initializes a hint that binds push constants.
Definition rendering_api.hpp:7293
static auto shaderStage(DescriptorBindingPoint at, ShaderStage shaderStages) noexcept -> PipelineBindingHint
Initializes a hint provides additional shader stages, that may be not covered by shader reflection.
Definition rendering_api.hpp:7381
static auto pushConstants(UInt32 space, UInt32 binding) noexcept -> PipelineBindingHint
Initializes a hint that binds push constants.
Definition rendering_api.hpp:7303
static auto staticSampler(UInt32 space, UInt32 binding, SharedPtr< ISampler > sampler) noexcept -> PipelineBindingHint
Initializes a hint that binds a static sampler, if supported by the backend.
Definition rendering_api.hpp:7324
static auto runtimeArray(DescriptorBindingPoint at, UInt32 maxDescriptors) noexcept -> PipelineBindingHint
Initializes a hint that binds an unbounded runtime array.
Definition rendering_api.hpp:7273
hint_type Hint
Stores the underlying hint.
Definition rendering_api.hpp:7264
Variant< std::monostate, UnboundedArrayHint, PushConstantsHint, StaticSamplerHint, DescriptorHeapHint, ShaderStageHint > hint_type
Defines the type of the pipeline binding hint.
Definition rendering_api.hpp:7254
static auto shaderStage(UInt32 space, UInt32 binding, ShaderStage shaderStages) noexcept -> PipelineBindingHint
Initializes a hint provides additional shader stages, that may be not covered by shader reflection.
Definition rendering_api.hpp:7393
static auto staticSampler(DescriptorBindingPoint at, SharedPtr< ISampler > sampler) noexcept -> PipelineBindingHint
Initializes a hint that binds a static sampler, if supported by the backend.
Definition rendering_api.hpp:7313
static auto samplerHeap(DescriptorBindingPoint at, UInt32 heapSize) noexcept -> PipelineBindingHint
Initializes a hint that binds a proxy descriptor set to access the sampler heap at the provided bindi...
Definition rendering_api.hpp:7358
static auto runtimeArray(UInt32 space, UInt32 binding, UInt32 maxDescriptors) noexcept -> PipelineBindingHint
Initializes a hint that binds an unbounded runtime array.
Definition rendering_api.hpp:7284
DescriptorBindingPoint Binding
The binding point the hint applies to.
Definition rendering_api.hpp:7259
static auto resourceHeap(UInt32 space, UInt32 binding, UInt32 heapSize) noexcept -> PipelineBindingHint
Initializes a hint that binds a proxy descriptor set to access the resource heap at the provided bind...
Definition rendering_api.hpp:7347
static auto samplerHeap(UInt32 space, UInt32 binding, UInt32 heapSize) noexcept -> PipelineBindingHint
Initializes a hint that binds a proxy descriptor set to access the sampler heap at the provided bindi...
Definition rendering_api.hpp:7370
static auto resourceHeap(DescriptorBindingPoint at, UInt32 heapSize) noexcept -> PipelineBindingHint
Initializes a hint that binds a proxy descriptor set to access the resource heap at the provided bind...
Definition rendering_api.hpp:7335
Stores information about a buffer resource allocation.
Definition rendering_api.hpp:2419
SharedPtr< const IIndexBufferLayout > IndexBufferLayout
The layout of a index buffer.
Definition rendering_api.hpp:2456
SharedPtr< const IVertexBufferLayout > VertexBufferLayout
The layout of a vertex buffer.
Definition rendering_api.hpp:2447
size_t ElementSize
Stores the size of a single element within the buffer.
Definition rendering_api.hpp:2428
ResourceHeap Heap
Stores the resource heap on which to allocate the resource.
Definition rendering_api.hpp:2438
BufferType Type
Stores the buffer type.
Definition rendering_api.hpp:2423
UInt32 Elements
Stores the number of elements in the buffer.
Definition rendering_api.hpp:2433
Stores information about an image resource allocation.
Definition rendering_api.hpp:2463
Size3d Size
Stores the size of the image.
Definition rendering_api.hpp:2477
ImageDimensions Dimensions
Stores the dimensions of the image.
Definition rendering_api.hpp:2472
Format Format
Stores the desired format of the image.
Definition rendering_api.hpp:2467
MultiSamplingLevel Samples
Stores the number of multi-samples in the image.
Definition rendering_api.hpp:2492
UInt32 Levels
Stores the number of mip-map levels in the image.
Definition rendering_api.hpp:2482
UInt32 Layers
Stores the number of layers in the image.
Definition rendering_api.hpp:2487
Contains the parameters for a resource allocation.
Definition rendering_api.hpp:2413
Variant< BufferInfo, ImageInfo > ResourceInfo
Stores the buffer or image info associated with the allocation info.
Definition rendering_api.hpp:2499
String Name
Stores the desired name of the allocated resource.
Definition rendering_api.hpp:2509
size_t AliasingOffset
An optional offset that is used to place the resource in a block of allocated memory when allocating ...
Definition rendering_api.hpp:2515
ResourceAllocationInfo(const BufferInfo &bufferInfo, ResourceUsage usage=ResourceUsage::Default, String name="", size_t aliasingOffset=0u)
Creates a new resource allocation info instance for a buffer resource.
Definition rendering_api.hpp:2530
ResourceAllocationInfo(const ImageInfo &imageInfo, ResourceUsage usage=ResourceUsage::Default, String name="", size_t aliasingOffset=0u)
Creates a new resource allocation info instance for an image resource.
Definition rendering_api.hpp:2540
ResourceAllocationInfo(ResourceAllocationInfo &&) noexcept=default
ResourceAllocationInfo()=default
Creates a new resource allocation info instance.
ResourceAllocationInfo(const ResourceAllocationInfo &)=default
ResourceUsage Usage
Stores the resource usage flags for the allocation info.
Definition rendering_api.hpp:2504
Stores the result of a resource allocation.
Definition rendering_api.hpp:2555
ResourceAllocationResult()=delete
ResourceAllocationResult(ResourceAllocationResult &&) noexcept=default
ResourceAllocationResult(SharedPtr< IImage > &&image) noexcept
Initializes an allocation result for an image resource.
Definition rendering_api.hpp:2564
SharedPtr< TImage > image() const
Returns the allocated image resource, or raises an exception if the allocation does not contain an im...
Definition rendering_api.hpp:2589
ResourceAllocationResult(const ResourceAllocationResult &)=delete
ResourceAllocationResult(SharedPtr< IBuffer > &&buffer) noexcept
Initializes an allocation result for a buffer resource.
Definition rendering_api.hpp:2571
SharedPtr< TBuffer > buffer() const
Returns the allocated buffer resource, or raises an exception if the allocation does not contain a bu...
Definition rendering_api.hpp:2608
Describes the offsets and sizes of a shader group within a shader binding table buffer.
Definition rendering_api.hpp:4291
UInt64 CallableGroupSize
The size of the callable group within the shader binding table.
Definition rendering_api.hpp:4345
UInt64 MissGroupOffset
The offset to the beginning of the miss group within the shader binding table.
Definition rendering_api.hpp:4325
UInt64 RayGenerationGroupSize
The size of the ray generation group within the shader binding table.
Definition rendering_api.hpp:4300
UInt64 HitGroupStride
The stride between individual hit group records in the shader binding table.
Definition rendering_api.hpp:4320
UInt64 HitGroupOffset
The offset to the beginning of the hit group within the shader binding table.
Definition rendering_api.hpp:4310
UInt64 CallableGroupOffset
The offset to the beginning of the callable group within the shader binding table.
Definition rendering_api.hpp:4340
UInt64 HitGroupSize
The size of the hit group within the shader binding table.
Definition rendering_api.hpp:4315
UInt64 MissGroupStride
The stride between individual miss group records in the shader binding table.
Definition rendering_api.hpp:4335
UInt64 CallableGroupStride
The stride between individual callable group records in the shader binding table.
Definition rendering_api.hpp:4350
UInt64 RayGenerationGroupStride
The stride between individual ray generation group records in the shader binding table.
Definition rendering_api.hpp:4305
UInt64 RayGenerationGroupOffset
The offset to the beginning of the ray generation group within the shader binding table.
Definition rendering_api.hpp:4295
UInt64 MissGroupSize
The size of the miss group within the shader binding table.
Definition rendering_api.hpp:4330
constexpr ShaderRecord & operator=(ShaderRecord &&_other) noexcept=default
Takes over another shader record.
constexpr const void * localData() const noexcept override
Returns a pointer to the shader-local data of the record.Shader-local data is a piece of constant dat...
Definition rendering_api.hpp:6800
constexpr ShaderRecord & operator=(const ShaderRecord &_other)=default
Copies another shader record.
constexpr UInt64 localDataSize() const noexcept override
Returns the size of the shader-local data of the record.The size of the shader-local data of the reco...
Definition rendering_api.hpp:6805
constexpr ShaderRecord(const ShaderRecord &_other)=default
Copies another shader record.
constexpr ShaderRecord(ShaderRecord &&_other) noexcept=default
Takes over another shader record.
constexpr ~ShaderRecord() noexcept override=default
IShaderRecord::shader_group_type shader_group_type
Definition rendering_api.hpp:6780
constexpr const shader_group_type & shaderGroup() const noexcept override
Returns the shader group containing the modules for this record.
Definition rendering_api.hpp:6795
Denotes a shader record containing no shader-local data.
Definition rendering_api.hpp:6854
constexpr UInt64 localDataSize() const noexcept override
Returns the size of the shader-local data of the record.The size of the shader-local data of the reco...
Definition rendering_api.hpp:6876
constexpr ShaderRecord & operator=(ShaderRecord &&_other) noexcept=default
Takes over another shader record.
constexpr const void * localData() const noexcept override
Returns a pointer to the shader-local data of the record.Shader-local data is a piece of constant dat...
Definition rendering_api.hpp:6871
constexpr ShaderRecord(const ShaderRecord &_other)=default
Copies another shader record.
constexpr ~ShaderRecord() noexcept override=default
constexpr ShaderRecord & operator=(const ShaderRecord &_other)=default
Copies another shader record.
constexpr const shader_group_type & shaderGroup() const noexcept override
Returns the shader group containing the modules for this record.
Definition rendering_api.hpp:6866
IShaderRecord::shader_group_type shader_group_type
Definition rendering_api.hpp:6856
constexpr ShaderRecord(ShaderRecord &&_other) noexcept=default
Takes over another shader record.
Defines a generic shader record.
Definition rendering_api.hpp:6758
Represents an allocation within the memory managed by the virtual allocator.
Definition rendering_api.hpp:3037
UInt64 Offset
The offset to the start of the allocation within the memory block.
Definition rendering_api.hpp:3051
UInt64 Handle
The handle that identifies the allocation.
Definition rendering_api.hpp:3041
UInt64 Size
The overall size of the allocation in bytes.
Definition rendering_api.hpp:3046
An allocator used to allocate the shared object.
Definition containers.hpp:1098
Definition alloc_buffer.cpp:13