3#include <litefx/rendering_api.hpp>
4#include <litefx/rendering_formatters.hpp>
14 template <
typename TBuffer,
typename TImage>
requires
15 std::derived_from<TBuffer, IBuffer> &&
16 std::derived_from<TImage, IImage>
32 constexpr ~
Barrier() noexcept override = default;
67 this->
transition(
dynamic_cast<const image_type&
>(image), accessBefore, accessAfter, fromLayout, toLayout);
71 this->
transition(
dynamic_cast<const image_type&
>(image), level, levels, layer, layers, plane, accessBefore, accessAfter, layout);
75 this->
transition(
dynamic_cast<const image_type&
>(image), level, levels, layer, layers, plane, accessBefore, accessAfter, fromLayout, toLayout);
145 template <
typename TBuffer,
typename TImage,
typename TSampler,
typename TAccelerationStructure>
requires
146 std::derived_from<TBuffer, IBuffer> &&
147 std::derived_from<TSampler, ISampler> &&
148 std::derived_from<TImage, IImage> &&
149 std::derived_from<TAccelerationStructure, IAccelerationStructure>
184 this->
update(binding,
dynamic_cast<const buffer_type&
>(buffer), bufferElement, elements, firstDescriptor);
188 this->
update(binding,
dynamic_cast<const image_type&
>(texture), descriptor, firstLevel, levels, firstLayer, layers);
212 template <
typename TDescriptorLayout,
typename TDescriptorSet>
requires
213 meta::implements<TDescriptorLayout, IDescriptorLayout> &&
214 meta::implements<TDescriptorSet, DescriptorSet<typename TDescriptorSet::buffer_type, typename TDescriptorSet::image_type, typename TDescriptorSet::sampler_type, typename TDescriptorSet::acceleration_structure_type>>
251 return this->
allocate(0, std::move(bindings));
265 return this->
allocate(descriptorSets, 0, bindings);
268#ifdef __cpp_lib_mdspan
271 return this->
allocate(descriptorSets, 0, bindings);
277 return this->
allocate(descriptorSets, 0, std::move(bindings));
283#ifdef __cpp_lib_mdspan
300 return this->
allocate(descriptors, bindings);
304 return this->
allocate(descriptors, bindings);
308 return this->
allocate(descriptors, std::move(bindings));
315#ifdef __cpp_lib_mdspan
325 inline void releaseDescriptorSet(
const IDescriptorSet& descriptorSet)
const override {
353 template <
typename TPushConstantsRange>
requires
354 meta::implements<TPushConstantsRange, IPushConstantsRange>
384 template <
typename TShaderModule>
requires
406 return this->
modules() | std::views::transform([](
const auto& m) ->
const IShaderModule& {
return *m; });
415 template <
typename TDescriptorSetLayout,
typename TPushConstantsLayout>
requires
453 template <
typename TVertexBufferLayout>
requires
477 template <typename TIndexBufferLayout> requires
503 template <typename TVertexBufferLayout, typename TIndexBufferLayout> requires
533 return this->vertexBufferLayouts();
544 template <
typename TPipelineLayout,
typename TShaderProgram>
requires
571 return std::static_pointer_cast<const IShaderProgram>(this->program());
575 return std::static_pointer_cast<const IPipelineLayout>(this->layout());
591 template <
typename TCommandBuffer,
typename TBuffer,
typename TVertexBuffer,
typename TIndexBuffer,
typename TImage,
typename TBarrier,
typename TPipeline,
typename TBLAS,
typename TTLAS>
requires
592 meta::implements<TBarrier, Barrier<TBuffer, TImage>> &&
594 std::derived_from<TPipeline, Pipeline<typename TPipeline::pipeline_layout_type, typename TPipeline::shader_program_type>> &&
595 std::derived_from<TBLAS, IBottomLevelAccelerationStructure> &&
596 std::derived_from<TTLAS, ITopLevelAccelerationStructure>
655 virtual
void transfer(const
void* const data,
size_t size, const
buffer_type& target,
UInt32 targetElement = 0,
UInt32 elements = 1) const = 0;
658 virtual
void transfer(
Span<const
void* const> data,
size_t elementSize, const
buffer_type& target,
UInt32 firstElement = 0) const = 0;
664 virtual
void transfer(const
void* const data,
size_t size, const
image_type& target,
UInt32 subresource = 0) const = 0;
667 virtual
void transfer(
Span<const
void* const> data,
size_t elementSize, const
image_type& target,
UInt32 firstSubresource = 0,
UInt32 subresources = 1) const = 0;
734 this->bind(vertexBuffer);
735 this->draw(vertexBuffer.elements(), instances, firstVertex, firstInstance);
740 this->bind(indexBuffer);
741 this->drawIndexed(indexBuffer.elements(), instances, firstIndex, vertexOffset, firstInstance);
746 this->bind(vertexBuffer);
747 this->bind(indexBuffer);
748 this->drawIndexed(indexBuffer.elements(), instances, firstIndex, vertexOffset, firstInstance);
780 this->traceRays(dimensions.x(), dimensions.y(), dimensions.z(), offsets, rayGenerationShaderBindingTable, missShaderBindingTable, hitShaderBindingTable, callableShaderBindingTable);
785 return this->makeBarrier(syncBefore, syncAfter);
788 inline void cmdBarrier(
const IBarrier& barrier)
const noexcept override {
789 this->barrier(
dynamic_cast<const barrier_type&
>(barrier));
793 this->transfer(
dynamic_cast<const buffer_type&
>(source),
dynamic_cast<const buffer_type&
>(target), sourceElement, targetElement, elements);
797 this->transfer(
dynamic_cast<const buffer_type&
>(source),
dynamic_cast<const image_type&
>(target), sourceElement, firstSubresource, elements);
800 inline void cmdTransfer(
const IImage& source,
const IImage& target,
UInt32 sourceSubresource,
UInt32 targetSubresource,
UInt32 subresources)
const override {
801 this->transfer(
dynamic_cast<const image_type&
>(source),
dynamic_cast<const image_type&
>(target), sourceSubresource, targetSubresource, subresources);
804 inline void cmdTransfer(
const IImage& source,
const IBuffer& target,
UInt32 firstSubresource,
UInt32 targetElement,
UInt32 subresources)
const override {
805 this->transfer(
dynamic_cast<const image_type&
>(source),
dynamic_cast<const buffer_type&
>(target), firstSubresource, targetElement, subresources);
809 this->transfer(std::dynamic_pointer_cast<const buffer_type>(source),
dynamic_cast<const buffer_type&
>(target), sourceElement, targetElement, elements);
813 this->transfer(std::dynamic_pointer_cast<const buffer_type>(source),
dynamic_cast<const image_type&
>(target), sourceElement, firstSubresource, elements);
817 this->transfer(std::dynamic_pointer_cast<const image_type>(source),
dynamic_cast<const image_type&
>(target), sourceSubresource, targetSubresource, subresources);
821 this->transfer(std::dynamic_pointer_cast<const image_type>(source),
dynamic_cast<const buffer_type&
>(target), firstSubresource, targetElement, subresources);
824 inline void cmdTransfer(
const void*
const data,
size_t size,
const IBuffer& target,
UInt32 targetElement,
UInt32 elements)
const override {
825 this->transfer(data, size,
dynamic_cast<const buffer_type&
>(target), targetElement, elements);
829 this->transfer(data, elementSize,
dynamic_cast<const buffer_type&
>(target), targetElement);
832 inline void cmdTransfer(
const void*
const data,
size_t size,
const IImage& target,
UInt32 subresource)
const override {
833 this->transfer(data, size,
dynamic_cast<const image_type&
>(target), subresource);
837 this->transfer(data, elementSize,
dynamic_cast<const image_type&
>(target), firstSubresource, elements);
840 inline void cmdUse(
const IPipeline& pipeline)
const noexcept override {
841 this->use(
dynamic_cast<const pipeline_type&
>(pipeline));
844 inline void cmdBind(
const IDescriptorSet& descriptorSet)
const override {
845 this->bind(
dynamic_cast<const descriptor_set_type&
>(descriptorSet));
849 auto sets = descriptorSets | std::views::transform([](
auto set) {
return dynamic_cast<const descriptor_set_type*
>(set); }) | std::ranges::to<
Array<const descriptor_set_type*>>();
854 this->bind(
dynamic_cast<const descriptor_set_type&
>(descriptorSet),
dynamic_cast<const pipeline_type&
>(pipeline));
858 auto sets = descriptorSets | std::views::transform([](
auto set) {
return dynamic_cast<const descriptor_set_type*
>(set); }) | std::ranges::to<
Array<const descriptor_set_type*>>();
862 inline void cmdBind(
const IVertexBuffer& buffer)
const override {
863 this->bind(
dynamic_cast<const vertex_buffer_type&
>(buffer));
866 inline void cmdBind(
const IIndexBuffer& buffer)
const override {
867 this->bind(
dynamic_cast<const index_buffer_type&
>(buffer));
870 inline void cmdPushConstants(
const IPushConstantsLayout& layout,
const void*
const memory)
const override {
871 this->pushConstants(
dynamic_cast<const push_constants_layout_type&
>(layout), memory);
874 inline void cmdDispatchIndirect(
const IBuffer& batchBuffer,
UInt32 batchCount,
UInt64 offset)
const noexcept override {
875 this->dispatchIndirect(
dynamic_cast<const buffer_type&
>(batchBuffer), batchCount, offset);
878 inline void cmdDispatchMeshIndirect(
const IBuffer& batchBuffer,
UInt32 batchCount,
UInt64 offset)
const noexcept override {
879 this->dispatchMeshIndirect(
dynamic_cast<const buffer_type&
>(batchBuffer), batchCount, offset);
882 inline void cmdDispatchMeshIndirect(
const IBuffer& batchBuffer,
const IBuffer& countBuffer,
UInt64 offset,
UInt64 countOffset,
UInt32 maxBatches)
const noexcept override {
883 this->dispatchMeshIndirect(
dynamic_cast<const buffer_type&
>(batchBuffer),
dynamic_cast<const buffer_type&
>(countBuffer), offset, countOffset, maxBatches);
887 this->draw(
dynamic_cast<const vertex_buffer_type&
>(vertexBuffer), instances, firstVertex, firstInstance);
890 inline void cmdDrawIndirect(
const IBuffer& batchBuffer,
UInt32 batchCount,
UInt64 offset)
const noexcept override {
891 this->drawIndirect(
dynamic_cast<const buffer_type&
>(batchBuffer), batchCount, offset);
894 inline void cmdDrawIndirect(
const IBuffer& batchBuffer,
const IBuffer& countBuffer,
UInt64 offset,
UInt64 countOffset,
UInt32 maxBatches)
const noexcept override {
895 this->drawIndirect(
dynamic_cast<const buffer_type&
>(batchBuffer),
dynamic_cast<const buffer_type&
>(countBuffer), offset, countOffset, maxBatches);
899 this->drawIndexed(
dynamic_cast<const index_buffer_type&
>(indexBuffer), instances, firstIndex, vertexOffset, firstInstance);
903 this->drawIndexed(
dynamic_cast<const vertex_buffer_type&
>(vertexBuffer),
dynamic_cast<const index_buffer_type&
>(indexBuffer), instances, firstIndex, vertexOffset, firstInstance);
906 inline void cmdDrawIndexedIndirect(
const IBuffer& batchBuffer,
UInt32 batchCount,
UInt64 offset)
const noexcept override {
907 this->drawIndexedIndirect(
dynamic_cast<const buffer_type&
>(batchBuffer), batchCount, offset);
910 inline void cmdDrawIndexedIndirect(
const IBuffer& batchBuffer,
const IBuffer& countBuffer,
UInt64 offset,
UInt64 countOffset,
UInt32 maxBatches)
const noexcept override {
911 this->drawIndexedIndirect(
dynamic_cast<const buffer_type&
>(batchBuffer),
dynamic_cast<const buffer_type&
>(countBuffer), offset, countOffset, maxBatches);
915 this->execute(std::dynamic_pointer_cast<const command_buffer_type>(commandBuffer));
919 return this->execute(commandBuffers | std::views::transform([](
const SharedPtr<const ICommandBuffer>& buffer) {
return std::dynamic_pointer_cast<const command_buffer_type>(buffer); }));
923 this->buildAccelerationStructure(
dynamic_cast<bottom_level_acceleration_structure_type&
>(blas), std::dynamic_pointer_cast<const buffer_type>(scratchBuffer),
dynamic_cast<const buffer_type&
>(buffer), offset);
927 this->buildAccelerationStructure(
dynamic_cast<top_level_acceleration_structure_type&
>(tlas), std::dynamic_pointer_cast<const buffer_type>(scratchBuffer),
dynamic_cast<const buffer_type&
>(buffer), offset);
931 this->updateAccelerationStructure(
dynamic_cast<bottom_level_acceleration_structure_type&
>(blas), std::dynamic_pointer_cast<const buffer_type>(scratchBuffer),
dynamic_cast<const buffer_type&
>(buffer), offset);
935 this->updateAccelerationStructure(
dynamic_cast<top_level_acceleration_structure_type&
>(tlas), std::dynamic_pointer_cast<const buffer_type>(scratchBuffer),
dynamic_cast<const buffer_type&
>(buffer), offset);
939 this->copyAccelerationStructure(
dynamic_cast<const bottom_level_acceleration_structure_type&
>(from),
dynamic_cast<const bottom_level_acceleration_structure_type&
>(to), compress);
943 this->copyAccelerationStructure(
dynamic_cast<const top_level_acceleration_structure_type&
>(from),
dynamic_cast<const top_level_acceleration_structure_type&
>(to), compress);
947 this->traceRays(width, height, depth, offsets,
dynamic_cast<const buffer_type&
>(rayGenerationShaderBindingTable),
dynamic_cast<const buffer_type*
>(missShaderBindingTable),
dynamic_cast<const buffer_type*
>(hitShaderBindingTable),
dynamic_cast<const buffer_type*
>(callableShaderBindingTable));
959 template <
typename TPipelineLayout,
typename TShaderProgram,
typename TInputAssembler,
typename TRasterizer>
requires
960 meta::implements<TInputAssembler, InputAssembler<typename TInputAssembler::vertex_buffer_layout_type, typename TInputAssembler::index_buffer_layout_type>> &&
961 meta::implements<TRasterizer, Rasterizer>
986 return this->inputAssembler();
990 return this->rasterizer();
1000 template <
typename TPipelineLayout,
typename TShaderProgram>
1019 template <typename TPipelineLayout, typename TShaderProgram>
1046 return this->allocateShaderBindingTable(offsets, groups);
1055 template <
typename TImage>
requires
1056 std::derived_from<TImage, IImage>
1080 return this->images() | std::views::transform([](
auto& image) ->
const IImage& {
return *image; });
1088 template <
typename TCommandBuffer>
requires
1112 return this->submit(std::static_pointer_cast<const command_buffer_type>(commandBuffer));
1123 return this->createCommandBuffer(beginRecording, secondary);
1127 return this->submit(std::dynamic_pointer_cast<const command_buffer_type>(commandBuffer));
1132 commandBuffers | std::views::transform([](
const SharedPtr<const ICommandBuffer>& buffer) {
return std::dynamic_pointer_cast<const command_buffer_type>(buffer); })
1147 template <
typename TCommandQueue,
typename TFrameBuffer>
requires
1148 meta::implements<TCommandQueue, CommandQueue<typename TCommandQueue::command_buffer_type>> &&
1149 meta::implements<TFrameBuffer, FrameBuffer<typename TFrameBuffer::image_type>>
1184 return this->activeFrameBuffer();
1188 return this->commandBuffer(index);
1191 inline const ICommandQueue& getCommandQueue() const noexcept
override {
1192 return this->commandQueue();
1196 return this->commandBuffers();
1199 inline void beginRenderPass(
const IFrameBuffer& frameBuffer)
const override {
1200 this->begin(
dynamic_cast<const frame_buffer_type&
>(frameBuffer));
1208 template <
typename TImageInterface>
requires
1209 std::derived_from<TImageInterface, IImage>
1230 return this->images() | std::views::transform([](
auto& image) ->
IImage& {
return *image; });
1245 template <
typename TDescriptorLayout,
typename TBuffer,
typename TVertexBuffer,
typename TIndexBuffer,
typename TImage,
typename TSampler,
typename TBLAS,
typename TTLAS>
requires
1247 std::derived_from<TVertexBuffer, VertexBuffer<typename TVertexBuffer::vertex_buffer_layout_type>> &&
1248 std::derived_from<TIndexBuffer, IndexBuffer<typename TIndexBuffer::index_buffer_layout_type>> &&
1249 std::derived_from<TImage, IImage> &&
1250 std::derived_from<TBuffer, IBuffer> &&
1251 std::derived_from<TSampler, ISampler> &&
1252 std::derived_from<TBLAS, IBottomLevelAccelerationStructure> &&
1253 std::derived_from<TTLAS, ITopLevelAccelerationStructure>
1317 virtual
SharedPtr<TSampler> 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 = 0;
1324 return this->createBottomLevelAccelerationStructure(
"", flags);
1332 return this->createTopLevelAccelerationStructure(
"", flags);
1340 return this->createBuffer(type, heap, elementSize, elements, usage);
1344 return this->createBuffer(name, type, heap, elementSize, elements, usage);
1348 return this->createVertexBuffer(
dynamic_cast<const vertex_buffer_layout_type&
>(layout), heap, elements, usage);
1352 return this->createVertexBuffer(name,
dynamic_cast<const vertex_buffer_layout_type&
>(layout), heap, elements, usage);
1356 return this->createIndexBuffer(
dynamic_cast<const index_buffer_layout_type&
>(layout), heap, elements, usage);
1360 return this->createIndexBuffer(name,
dynamic_cast<const index_buffer_layout_type&
>(layout), heap, elements, usage);
1364 return this->createTexture(format, size, dimension, levels, layers, samples, usage);
1368 return this->createTexture(name, format, size, dimension, levels, layers, samples, usage);
1373 for (
auto texture : gen)
1374 co_yield std::move(texture);
1375 }(this->createTextures(format, size, dimension, layers, levels, samples, usage));
1379 return this->createSampler(magFilter, minFilter, borderU, borderV, borderW, mipMapMode, mipMapBias, maxLod, minLod, anisotropy);
1382 inline 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 override {
1383 return this->createSampler(name, magFilter, minFilter, borderU, borderV, borderW, mipMapMode, mipMapBias, maxLod, minLod, anisotropy);
1388 for (
auto sampler : gen)
1389 co_yield std::move(sampler);
1390 }(this->createSamplers(magFilter, minFilter, borderU, borderV, borderW, mipMapMode, mipMapBias, maxLod, minLod, anisotropy));
1394 return this->createBottomLevelAccelerationStructure(name, flags);
1398 return this->createTopLevelAccelerationStructure(name, flags);
1420 template <
typename TFactory,
typename TSurface,
typename TGraphicsAdapter,
typename TSwapChain,
typename TCommandQueue,
typename TRenderPass,
typename TRenderPipeline,
typename TComputePipeline,
typename TRayTracingPipeline,
typename TBarrier>
requires
1421 meta::implements<TSurface, ISurface> &&
1422 meta::implements<TGraphicsAdapter, IGraphicsAdapter> &&
1423 meta::implements<TSwapChain, SwapChain<typename TFactory::image_type>> &&
1424 meta::implements<TCommandQueue, CommandQueue<typename TCommandQueue::command_buffer_type>> &&
1425 meta::implements<TFactory, GraphicsFactory<typename TFactory::descriptor_layout_type, typename TFactory::buffer_type, typename TFactory::vertex_buffer_type, typename TFactory::index_buffer_type, typename TFactory::image_type, typename TFactory::sampler_type, typename TFactory::bottom_level_acceleration_structure_type, typename TFactory::top_level_acceleration_structure_type>> &&
1426 meta::implements<TRenderPass, RenderPass<TCommandQueue, typename TRenderPass::frame_buffer_type>> &&
1427 meta::implements<TRenderPipeline, RenderPipeline<typename TRenderPipeline::pipeline_layout_type, typename TRenderPipeline::shader_program_type, typename TRenderPipeline::input_assembler_type, typename TRenderPipeline::rasterizer_type>> &&
1428 meta::implements<TComputePipeline, ComputePipeline<typename TComputePipeline::pipeline_layout_type, typename TComputePipeline::shader_program_type>> &&
1429 meta::implements<TRayTracingPipeline, RayTracingPipeline<typename TRayTracingPipeline::pipeline_layout_type, typename TRayTracingPipeline::shader_program_type>> &&
1430 meta::implements<TBarrier, Barrier<typename TFactory::buffer_type, typename TFactory::image_type>>
1495 return this->makeFrameBuffer(
"", renderArea);
1503 return this->makeBarrier(syncBefore, syncAfter);
1507 return this->makeFrameBuffer(name, renderArea);
1511 return this->defaultQueue(type);
1515 return std::static_pointer_cast<const ICommandQueue>(this->createQueue(type, priority));
1531 this->computeAccelerationStructureSizes(
dynamic_cast<const top_level_acceleration_structure_type&
>(tlas), bufferSize, scratchSize, forUpdate);
1534#if defined(LITEFX_BUILD_DEFINE_BUILDERS)
1536 using render_pass_builder_type = render_pass_type::builder_type;
1537 using render_pipeline_builder_type = render_pipeline_type::builder_type;
1538 using compute_pipeline_builder_type = compute_pipeline_type::builder_type;
1539 using ray_tracing_pipeline_builder_type = ray_tracing_pipeline_type::builder_type;
1540 using pipeline_layout_builder_type = pipeline_layout_type::builder_type;
1541 using input_assembler_builder_type = input_assembler_type::builder_type;
1542 using rasterizer_builder_type = rasterizer_type::builder_type;
1543 using shader_program_builder_type = shader_program_type::builder_type;
1544 using barrier_builder_Type = barrier_type::builder_type;
1551 [[nodiscard]]
virtual render_pass_builder_type buildRenderPass(
UInt32 commandBuffers = 1)
const = 0;
1559 [[nodiscard]]
virtual render_pass_builder_type buildRenderPass(
const String& name,
UInt32 commandBuffers = 1)
const = 0;
1566 [[nodiscard]]
virtual compute_pipeline_builder_type buildComputePipeline(
const String& name)
const = 0;
1581 [[nodiscard]]
virtual render_pipeline_builder_type buildRenderPipeline(
const render_pass_type& renderPass,
const String& name)
const = 0;
1591 [[nodiscard]]
virtual ray_tracing_pipeline_builder_type buildRayTracingPipeline(
ShaderRecordCollection&& shaderRecords)
const = 0;
1602 [[nodiscard]]
virtual ray_tracing_pipeline_builder_type buildRayTracingPipeline(
const String& name,
ShaderRecordCollection&& shaderRecords)
const = 0;
1608 [[nodiscard]]
virtual pipeline_layout_builder_type buildPipelineLayout()
const = 0;
1614 [[nodiscard]]
virtual input_assembler_builder_type buildInputAssembler()
const = 0;
1620 [[nodiscard]]
virtual rasterizer_builder_type buildRasterizer()
const = 0;
1626 [[nodiscard]]
virtual shader_program_builder_type buildShaderProgram()
const = 0;
1632 [[nodiscard]]
virtual barrier_builder_Type buildBarrier()
const = 0;
1640 template <
typename TGraphicsDevice>
requires
1641 meta::implements<TGraphicsDevice, GraphicsDevice<typename TGraphicsDevice::factory_type, typename TGraphicsDevice::surface_type, typename TGraphicsDevice::adapter_type, typename TGraphicsDevice::swap_chain_type, typename TGraphicsDevice::command_queue_type, typename TGraphicsDevice::render_pass_type, typename TGraphicsDevice::render_pipeline_type, typename TGraphicsDevice::compute_pipeline_type, typename TGraphicsDevice::ray_tracing_pipeline_type, typename TGraphicsDevice::barrier_type>>
1693 template <typename TSelf, typename ...TArgs>
1695 auto devicePtr = device_type::create(self, adapter, std::move(surface), std::forward<TArgs>(_args)...);
1696 auto& device = *devicePtr;
1697 self.registerDevice(name, std::move(devicePtr));
1715 return this->device(name);
1720 return this->device(name);
1726 return this->adapters();
A barrier used for GPU resource synchronization.
Definition rendering.hpp:17
TImage image_type
Definition rendering.hpp:22
virtual constexpr void transition(const buffer_type &buffer, ResourceAccess accessBefore, ResourceAccess accessAfter)=0
TBuffer buffer_type
Definition rendering.hpp:21
Barrier() noexcept=default
Represents a command buffer, that buffers commands that should be submitted to a CommandQueue.
Definition rendering.hpp:597
virtual void execute(const SharedPtr< const command_buffer_type > &commandBuffer) const =0
pipeline_type::pipeline_layout_type pipeline_layout_type
Definition rendering.hpp:627
virtual void buildAccelerationStructure(bottom_level_acceleration_structure_type &blas, const SharedPtr< const buffer_type > &scratchBuffer, const buffer_type &buffer, UInt64 offset=0) const =0
TBuffer buffer_type
Definition rendering.hpp:621
virtual void updateAccelerationStructure(bottom_level_acceleration_structure_type &blas, const SharedPtr< const buffer_type > &scratchBuffer, const buffer_type &buffer, UInt64 offset=0) const =0
TBLAS bottom_level_acceleration_structure_type
Definition rendering.hpp:631
pipeline_layout_type::push_constants_layout_type push_constants_layout_type
Definition rendering.hpp:629
TBarrier barrier_type
Definition rendering.hpp:625
virtual void drawIndexed(const vertex_buffer_type &vertexBuffer, const index_buffer_type &indexBuffer, UInt32 instances=1, UInt32 firstIndex=0, Int32 vertexOffset=0, UInt32 firstInstance=0) const
Definition rendering.hpp:745
virtual void execute(Enumerable< SharedPtr< const command_buffer_type > > commandBuffers) const =0
TVertexBuffer vertex_buffer_type
Definition rendering.hpp:622
TIndexBuffer index_buffer_type
Definition rendering.hpp:623
descriptor_set_layout_type::descriptor_set_type descriptor_set_type
Definition rendering.hpp:630
pipeline_layout_type::descriptor_set_layout_type descriptor_set_layout_type
Definition rendering.hpp:628
virtual void copyAccelerationStructure(const bottom_level_acceleration_structure_type &from, const bottom_level_acceleration_structure_type &to, bool compress=false) const noexcept=0
virtual void buildAccelerationStructure(top_level_acceleration_structure_type &tlas, const SharedPtr< const buffer_type > &scratchBuffer, const buffer_type &buffer, UInt64 offset=0) const =0
TCommandBuffer command_buffer_type
Definition rendering.hpp:620
TImage image_type
Definition rendering.hpp:624
TPipeline pipeline_type
Definition rendering.hpp:626
virtual void updateAccelerationStructure(top_level_acceleration_structure_type &tlas, const SharedPtr< const buffer_type > &scratchBuffer, const buffer_type &buffer, UInt64 offset=0) const =0
virtual void drawIndexed(const index_buffer_type &indexBuffer, UInt32 instances=1, UInt32 firstIndex=0, Int32 vertexOffset=0, UInt32 firstInstance=0) const
Definition rendering.hpp:739
TTLAS top_level_acceleration_structure_type
Definition rendering.hpp:632
friend TCommandBuffer
Definition rendering.hpp:617
Represents a command queue.
Definition rendering.hpp:1090
TCommandBuffer command_buffer_type
Definition rendering.hpp:1094
virtual UInt64 submit(const SharedPtr< const command_buffer_type > &commandBuffer) const =0
virtual UInt64 submit(Enumerable< SharedPtr< const command_buffer_type > > commandBuffers) const =0
CommandQueue() noexcept=default
Represents a compute Pipeline.
Definition rendering.hpp:1001
ComputePipeline() noexcept=default
Defines a set of descriptors.
Definition rendering.hpp:150
TSampler sampler_type
Definition rendering.hpp:155
TAccelerationStructure acceleration_structure_type
Definition rendering.hpp:157
TImage image_type
Definition rendering.hpp:156
virtual void update(UInt32 binding, const buffer_type &buffer, UInt32 bufferElement=0, UInt32 elements=0, UInt32 firstDescriptor=0) const =0
DescriptorSet() noexcept=default
TBuffer buffer_type
Definition rendering.hpp:154
Describes the layout of a descriptor set.
Definition rendering.hpp:215
virtual const Array< descriptor_layout_type > & descriptors() const noexcept=0
virtual UniquePtr< descriptor_set_type > allocate(UInt32 descriptors, Generator< DescriptorBinding > bindings) const =0
virtual UniquePtr< descriptor_set_type > allocate(Generator< DescriptorBinding > bindings) const
Definition rendering.hpp:250
virtual UniquePtr< descriptor_set_type > allocate(UInt32 descriptors, Span< DescriptorBinding > bindings) const =0
virtual Generator< UniquePtr< descriptor_set_type > > allocate(UInt32 descriptorSets, UInt32 descriptors, std::function< Generator< DescriptorBinding >(UInt32)> bindingFactory) const =0
virtual Generator< UniquePtr< descriptor_set_type > > allocate(UInt32 descriptorSets, std::function< Generator< DescriptorBinding >(UInt32)> bindings) const
Definition rendering.hpp:276
virtual Generator< UniquePtr< descriptor_set_type > > allocate(UInt32 descriptorSets, UInt32 descriptors, std::initializer_list< std::initializer_list< DescriptorBinding > > bindings={ }) const =0
virtual UniquePtr< descriptor_set_type > allocate(UInt32 descriptors, std::initializer_list< DescriptorBinding > bindings) const =0
const descriptor_layout_type & descriptor(UInt32 binding) const override=0
Returns the descriptor layout for the descriptor bound to the binding point provided with binding ....
virtual Generator< UniquePtr< descriptor_set_type > > allocate(UInt32 descriptorSets, std::initializer_list< std::initializer_list< DescriptorBinding > > bindings={ }) const
Definition rendering.hpp:264
DescriptorSetLayout() noexcept=default
TDescriptorSet descriptor_set_type
Definition rendering.hpp:220
virtual void free(const descriptor_set_type &descriptorSet) const =0
virtual UniquePtr< descriptor_set_type > allocate(Span< DescriptorBinding > bindings) const
Definition rendering.hpp:245
TDescriptorLayout descriptor_layout_type
Definition rendering.hpp:219
virtual UniquePtr< descriptor_set_type > allocate(std::initializer_list< DescriptorBinding > bindings={ }) const
Definition rendering.hpp:240
Stores the images used by a RenderPass to either read from using input attachments or write to using ...
Definition rendering.hpp:1057
TImage image_type
Definition rendering.hpp:1059
FrameBuffer() noexcept=default
Represents the graphics device that a rendering back-end is doing work on.
Definition rendering.hpp:1431
TFactory factory_type
Definition rendering.hpp:1438
factory_type::top_level_acceleration_structure_type top_level_acceleration_structure_type
Definition rendering.hpp:1447
TRayTracingPipeline ray_tracing_pipeline_type
Definition rendering.hpp:1452
factory_type::vertex_buffer_type vertex_buffer_type
Definition rendering.hpp:1441
virtual void computeAccelerationStructureSizes(const bottom_level_acceleration_structure_type &blas, UInt64 &bufferSize, UInt64 &scratchSize, bool forUpdate=false) const =0
render_pipeline_type::pipeline_layout_type pipeline_layout_type
Definition rendering.hpp:1453
TGraphicsAdapter adapter_type
Definition rendering.hpp:1434
render_pipeline_type::shader_program_type shader_program_type
Definition rendering.hpp:1454
TComputePipeline compute_pipeline_type
Definition rendering.hpp:1451
render_pipeline_type::input_assembler_type input_assembler_type
Definition rendering.hpp:1455
factory_type::bottom_level_acceleration_structure_type bottom_level_acceleration_structure_type
Definition rendering.hpp:1446
TBarrier barrier_type
Definition rendering.hpp:1439
TSwapChain swap_chain_type
Definition rendering.hpp:1435
virtual SharedPtr< frame_buffer_type > makeFrameBuffer(StringView name, const Size2d &renderArea) const =0
factory_type::buffer_type buffer_type
Definition rendering.hpp:1443
command_queue_type::command_buffer_type command_buffer_type
Definition rendering.hpp:1437
TRenderPass render_pass_type
Definition rendering.hpp:1448
TRenderPipeline render_pipeline_type
Definition rendering.hpp:1450
virtual void computeAccelerationStructureSizes(const top_level_acceleration_structure_type &tlas, UInt64 &bufferSize, UInt64 &scratchSize, bool forUpdate=false) const =0
factory_type::descriptor_layout_type descriptor_layout_type
Definition rendering.hpp:1440
render_pass_type::frame_buffer_type frame_buffer_type
Definition rendering.hpp:1449
GraphicsDevice() noexcept=default
factory_type::image_type image_type
Definition rendering.hpp:1444
TSurface surface_type
Definition rendering.hpp:1433
render_pipeline_type::rasterizer_type rasterizer_type
Definition rendering.hpp:1456
factory_type::sampler_type sampler_type
Definition rendering.hpp:1445
TCommandQueue command_queue_type
Definition rendering.hpp:1436
factory_type::index_buffer_type index_buffer_type
Definition rendering.hpp:1442
Describes a factory that creates objects for a GraphicsDevice.
Definition rendering.hpp:1254
TVertexBuffer vertex_buffer_type
Definition rendering.hpp:1265
vertex_buffer_type::vertex_buffer_layout_type vertex_buffer_layout_type
Definition rendering.hpp:1266
virtual UniquePtr< TBLAS > createBottomLevelAccelerationStructure(StringView name, AccelerationStructureFlags flags) const =0
TTLAS top_level_acceleration_structure_type
Definition rendering.hpp:1273
GraphicsFactory() noexcept=default
virtual UniquePtr< TTLAS > createTopLevelAccelerationStructure(StringView name, AccelerationStructureFlags flags) const =0
TIndexBuffer index_buffer_type
Definition rendering.hpp:1267
TImage image_type
Definition rendering.hpp:1270
TSampler sampler_type
Definition rendering.hpp:1271
index_buffer_type::index_buffer_layout_type index_buffer_layout_type
Definition rendering.hpp:1268
TDescriptorLayout descriptor_layout_type
Definition rendering.hpp:1264
TBLAS bottom_level_acceleration_structure_type
Definition rendering.hpp:1272
TBuffer buffer_type
Definition rendering.hpp:1269
UniquePtr< TTLAS > createTopLevelAccelerationStructure(AccelerationStructureFlags flags) const
Definition rendering.hpp:1331
Base interface for a ray tracing acceleration structure.
Definition rendering_api.hpp:4449
The interface for a barrier.
Definition rendering_api.hpp:5110
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:5149
A structure that holds a singular entity of geometry for hardware ray-tracing.
Definition rendering_api.hpp:4588
Base interface for buffer objects.
Definition rendering_api.hpp:4186
The interface for a command buffer.
Definition rendering_api.hpp:6517
void barrier(const IBarrier &barrier) const noexcept
Executes the transitions that have been added to barrier .
Definition rendering_api.hpp:6620
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:6957
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:7317
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:6638
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.
virtual void dispatchMesh(const Vector3u &threadGroupCount) const noexcept=0
Executes a mesh shader pipeline.
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:7433
void use(const IPipeline &pipeline) const noexcept
Sets the active pipeline state.
Definition rendering_api.hpp:6947
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:6597
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:7466
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:7295
void dispatchIndirect(const IBuffer &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept
Executes a set of indirect dispatches.
Definition rendering_api.hpp:7114
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:7229
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:7401
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.
The interface for a command queue.
Definition rendering_api.hpp:8481
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:8635
The interface for a compute pipeline.
Definition rendering_api.hpp:7611
The interface for a descriptor set.
Definition rendering_api.hpp:5253
void update(UInt32 binding, const IBuffer &buffer, UInt32 bufferElement=0, UInt32 elements=0, UInt32 firstDescriptor=0) const
Updates one or more buffer descriptors within the current descriptor set.
Definition rendering_api.hpp:5273
The interface for a descriptor set layout.
Definition rendering_api.hpp:5406
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:5625
The interface for a frame buffer.
Definition rendering_api.hpp:7709
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:7955
The interface for a graphics device that.
Definition rendering_api.hpp:9164
The interface for a graphics factory.
Definition rendering_api.hpp:8716
SharedPtr< IIndexBuffer > createIndexBuffer(const IIndexBufferLayout &layout, ResourceHeap heap, UInt32 elements, ResourceUsage usage=ResourceUsage::Default) const
Creates an index buffer, based on the layout .
Definition rendering_api.hpp:8921
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) const
Creates a series of textures.
Definition rendering_api.hpp:8995
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) const
Creates a texture.
Definition rendering_api.hpp:8959
SharedPtr< IVertexBuffer > createVertexBuffer(const IVertexBufferLayout &layout, ResourceHeap heap, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default) const
Creates a vertex buffer, based on the layout
Definition rendering_api.hpp:8886
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:9053
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:9014
SharedPtr< IBuffer > createBuffer(BufferType type, ResourceHeap heap, size_t elementSize, UInt32 elements=1, ResourceUsage usage=ResourceUsage::Default) const
Creates a buffer of type type .
Definition rendering_api.hpp:8737
Describes a generic image.
Definition rendering_api.hpp:4208
The interface for an index buffer.
Definition rendering_api.hpp:4425
Describes a index buffer layout.
Definition rendering_api.hpp:3952
The interface for a pipeline.
Definition rendering_api.hpp:6481
The interface for a pipeline layout.
Definition rendering_api.hpp:6385
The interface for a push constants layout.
Definition rendering_api.hpp:5693
Describes a range within a IPushConstantsLayout.
Definition rendering_api.hpp:5645
The interface for a ray tracing pipeline.
Definition rendering_api.hpp:7626
The interface to access a render backend.
Definition rendering_api.hpp:9358
The interface for a render pass.
Definition rendering_api.hpp:8065
The interface for a render pipeline.
Definition rendering_api.hpp:7541
Describes a texture sampler.
Definition rendering_api.hpp:4324
Represents a single shader module, i.e. a part of a IShaderProgram.
Definition rendering_api.hpp:2755
The interface for a shader program.
Definition rendering_api.hpp:6286
Interface for a swap chain.
Definition rendering_api.hpp:8250
A structure that stores the instance data for a IBottomLevelAccelerationStructure.
Definition rendering_api.hpp:4870
The interface for a vertex buffer.
Definition rendering_api.hpp:4403
Describes a vertex buffer layout.
Definition rendering_api.hpp:3929
Describes an index buffer.
Definition rendering.hpp:479
IndexBuffer() noexcept=default
TIndexBufferLayout index_buffer_layout_type
Definition rendering.hpp:481
Represents a pipeline state.
Definition rendering.hpp:547
Pipeline() noexcept=default
TShaderProgram shader_program_type
Definition rendering.hpp:549
TPipelineLayout pipeline_layout_type
Definition rendering.hpp:550
Represents a the layout of a RenderPipeline, ComputePipeline or RayTracingPipeline.
Definition rendering.hpp:418
PipelineLayout() noexcept=default
TPushConstantsLayout push_constants_layout_type
Definition rendering.hpp:421
const push_constants_layout_type * pushConstants() const noexcept override=0
Returns the push constants layout, or nullptr, if the pipeline does not use any push constants....
virtual const Array< SharedPtr< const descriptor_set_layout_type > > & descriptorSets() const =0
const descriptor_set_layout_type & descriptorSet(UInt32 space) const override=0
Returns the descriptor set layout for the descriptor set that is bound to the space provided by space...
TDescriptorSetLayout descriptor_set_layout_type
Definition rendering.hpp:420
Describes the layout of the pipelines push constant ranges.
Definition rendering.hpp:355
virtual const Array< UniquePtr< push_constants_range_type > > & ranges() const =0
TPushConstantsRange push_constants_range_type
Definition rendering.hpp:357
PushConstantsLayout() noexcept=default
Represents a ray-tracing Pipeline.
Definition rendering.hpp:1020
descriptor_set_layout_type::descriptor_layout_type descriptor_layout_type
Definition rendering.hpp:1025
RayTracingPipeline() noexcept=default
base_type::pipeline_layout_type::descriptor_set_layout_type descriptor_set_layout_type
Definition rendering.hpp:1023
descriptor_set_type::image_type image_type
Definition rendering.hpp:1027
descriptor_set_type::sampler_type sampler_type
Definition rendering.hpp:1028
descriptor_set_layout_type::descriptor_set_type descriptor_set_type
Definition rendering.hpp:1024
descriptor_set_type::buffer_type buffer_type
Definition rendering.hpp:1026
Defines a back-end, that provides a device instance for a certain surface and graphics adapter.
Definition rendering.hpp:1642
device_type::render_pipeline_type render_pipeline_type
Definition rendering.hpp:1661
factory_type::sampler_type sampler_type
Definition rendering.hpp:1657
const device_type * operator[](const String &name) const noexcept override
Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could...
Definition rendering.hpp:1714
device_type::surface_type surface_type
Definition rendering.hpp:1645
factory_type::index_buffer_type index_buffer_type
Definition rendering.hpp:1654
device_type::barrier_type barrier_type
Definition rendering.hpp:1651
const device_type * device(const String &name) const noexcept override=0
Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could...
TGraphicsDevice device_type
Definition rendering.hpp:1644
device_type::input_assembler_type input_assembler_type
Definition rendering.hpp:1665
device_type::command_queue_type command_queue_type
Definition rendering.hpp:1648
device_type::factory_type factory_type
Definition rendering.hpp:1650
device_type * device(const String &name) noexcept override=0
Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could...
factory_type::buffer_type buffer_type
Definition rendering.hpp:1655
device_type::compute_pipeline_type compute_pipeline_type
Definition rendering.hpp:1662
device_type::frame_buffer_type frame_buffer_type
Definition rendering.hpp:1658
virtual void releaseDevice(const String &name)=0
Destroys and removes a device from the backend.
factory_type::image_type image_type
Definition rendering.hpp:1656
device_type * operator[](const String &name) noexcept override
Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could...
Definition rendering.hpp:1719
device_type::render_pass_type render_pass_type
Definition rendering.hpp:1659
device_type::pipeline_layout_type pipeline_layout_type
Definition rendering.hpp:1660
device_type::swap_chain_type swap_chain_type
Definition rendering.hpp:1647
device_type::rasterizer_type rasterizer_type
Definition rendering.hpp:1666
RenderBackend() noexcept=default
device_type::shader_program_type shader_program_type
Definition rendering.hpp:1664
device_type::adapter_type adapter_type
Definition rendering.hpp:1646
factory_type::vertex_buffer_type vertex_buffer_type
Definition rendering.hpp:1653
factory_type::descriptor_layout_type descriptor_layout_type
Definition rendering.hpp:1652
device_type::command_buffer_type command_buffer_type
Definition rendering.hpp:1649
device_type::ray_tracing_pipeline_type ray_tracing_pipeline_type
Definition rendering.hpp:1663
Represents a render pass.
Definition rendering.hpp:1150
TCommandQueue command_queue_type
Definition rendering.hpp:1152
TCommandQueue::command_buffer_type command_buffer_type
Definition rendering.hpp:1153
RenderPass() noexcept=default
TFrameBuffer frame_buffer_type
Definition rendering.hpp:1154
Represents a graphics Pipeline.
Definition rendering.hpp:962
TInputAssembler input_assembler_type
Definition rendering.hpp:964
RenderPipeline() noexcept=default
TRasterizer rasterizer_type
Definition rendering.hpp:965
Represents a shader program, consisting of multiple IShaderModules.
Definition rendering.hpp:386
ShaderProgram() noexcept=default
TShaderModule shader_module_type
Definition rendering.hpp:388
virtual const Array< UniquePtr< const shader_module_type > > & modules() const noexcept=0
Stores a set of IShaderRecords in that later form a shader binding table used for ray-tracing.
Definition rendering_api.hpp:6007
Base class for a resource that can be identified by a name string within a DeviceState.
Definition rendering_api.hpp:2265
Represents a swap chain, i.e. a chain of multiple IImage instances, that can be presented to a ISurfa...
Definition rendering.hpp:1210
SwapChain() noexcept=default
TImageInterface image_interface_type
Definition rendering.hpp:1212
Describes a vertex buffer.
Definition rendering.hpp:455
const vertex_buffer_layout_type & layout() const noexcept override=0
Gets the layout of the vertex buffer.The layout of the vertex buffer.
VertexBuffer() noexcept=default
TVertexBufferLayout vertex_buffer_layout_type
Definition rendering.hpp:457
uint64_t UInt64
A type for an unsigned 64 bit integer.
Definition math.hpp:66
float_t Float
A type for a floating point value with single precision.
Definition math.hpp:71
uint32_t UInt32
A type for an unsigned 32 bit integer.
Definition math.hpp:56
int32_t Int32
A type for a signed 32 bit integer.
Definition math.hpp:51
BorderMode
Describes how to treat texture coordinates that are outside the domain [0..1].
Definition rendering_api.hpp:1184
@ Repeat
Repeat the texture.
ImageLayout
Specifies the layout of an IImage resource.
Definition rendering_api.hpp:1686
MipMapMode
Describes the filter operation between two mip-map levels.
Definition rendering_api.hpp:1169
ShaderBindingGroup
Describes a group or combination of groups of a shader binding table.
Definition rendering_api.hpp:939
@ All
Refers to a combination of all possible groups that can be stored in a shader binding table.
BufferType
Describes the type of a IBuffer.
Definition rendering_api.hpp:540
ResourceUsage
Describes the intended usage for a resource.
Definition rendering_api.hpp:690
@ Default
Shortcut for commonly used TransferSource | TransferDestination combination.
ImageDimensions
Describes the dimensions of a image resource, i.e. the dimensions that are required to access a texel...
Definition rendering_api.hpp:1086
@ DIM_2
Represents a 2D image.
QueuePriority
Specifies the priority with which a queue is scheduled on the GPU.
Definition rendering_api.hpp:159
@ Normal
The default queue priority.
QueueType
Represents the type of a CommandQueue.
Definition rendering_api.hpp:113
ResourceHeap
Defines where a resource (buffer or image) memory is located and from where it can be accessed.
Definition rendering_api.hpp:649
AccelerationStructureFlags
Controls how an acceleration structure should be built.
Definition rendering_api.hpp:1816
FilterMode
Describes the filter operation when accessing a pixel from a texture coordinate.
Definition rendering_api.hpp:1152
@ Nearest
Take the nearest texel with respect to the texture coordinate.
PipelineStage
Defines pipeline stages as points where synchronization may occur.
Definition rendering_api.hpp:1373
ResourceAccess
Defines how a IBuffer or IImage resource is accessed.
Definition rendering_api.hpp:1537
Format
Describes a texel format.
Definition rendering_api.hpp:182
MultiSamplingLevel
Describes the number of samples with which a IImage is sampled.
Definition rendering_api.hpp:1111
@ x1
The default number of samples. Multi-sampling will be deactivated, if this sampling level is used.
std::generator< T, TVal > Generator
Describes an intermediate container for elements of type T .
Definition containers.hpp:206
std::vector< T > Array
Represents a dynamic array.
Definition containers.hpp:73
std::optional< T > Optional
Represents an optional value.
Definition containers.hpp:94
std::shared_ptr< T > SharedPtr
Represents a shared pointer, that expresses non-exclusive ownership.
Definition containers.hpp:109
std::unique_ptr< T, TDeleter > UniquePtr
Represents a unique pointer, that expresses exclusive ownership.
Definition containers.hpp:102
std::string String
Definition string.hpp:24
std::string_view StringView
Definition string.hpp:26
std::span< T > Span
Represents a view of an array.
Definition containers.hpp:87
An input range over another range, where the returned values of type T are covariants of the values ...
Definition containers.hpp:529
Describes a resource binding to a descriptor or descriptor set.
Definition rendering_api.hpp:5334
Describes the offsets and sizes of a shader group within a shader binding table buffer.
Definition rendering_api.hpp:3646