3#include <litefx/rendering.hpp>
5#include "vulkan_api.hpp"
6#include "vulkan_formatters.hpp"
9#pragma warning(disable:4250)
23 LITEFX_BUILDER(VulkanVertexBufferLayoutBuilder);
105 size_t elementSize() const noexcept override;
108 UInt32 binding() const noexcept override;
169 IndexType indexType() const noexcept override;
174 size_t elementSize() const noexcept override;
177 UInt32 binding() const noexcept override;
260 virtual VkImageAspectFlags aspectMask() const noexcept = 0;
267 virtual VkImageAspectFlags aspectMask(
UInt32 plane) const = 0;
363 UInt64 offset() const noexcept override;
366 UInt64 size() const noexcept override;
374 void addTriangleMesh(const
TriangleMesh& mesh) override;
383 void clear() noexcept override;
386 bool remove(const
TriangleMesh& mesh) noexcept override;
392 Array<std::pair<
UInt32, VkAccelerationStructureGeometryKHR>> buildInfo() const;
393 void updateState(const
VulkanDevice* device, VkAccelerationStructureKHR handle) noexcept;
458 UInt64 offset() const noexcept override;
461 UInt64 size() const noexcept override;
469 void addInstance(const
Instance& instance) override;
472 void clear() noexcept override;
475 bool remove(const
Instance& mesh) noexcept override;
478 Array<VkAccelerationStructureInstanceKHR> buildInfo() const;
479 void updateState(const
VulkanDevice* device, VkAccelerationStructureKHR handle) noexcept;
497 LITEFX_BUILDER(VulkanBarrierBuilder);
501 using base_type::transition;
618 const
String& fileName() const noexcept override;
621 const
String& entryPoint() const noexcept override;
634 virtual const
String& bytecode() const noexcept;
640 virtual VkPipelineShaderStageCreateInfo shaderStageDefinition() const;
651 LITEFX_BUILDER(VulkanShaderProgramBuilder);
715 return std::static_pointer_cast<IPipelineLayout>(this->reflectPipelineLayout(hints));
729 using base_type::update;
774 Array<
Byte>&& releaseBuffer() const noexcept;
781 Span<const
Byte> descriptorBuffer() const noexcept;
867 UInt32 descriptors() const noexcept override;
870 bool unbounded() const noexcept override;
878 size_t elementSize() const noexcept override;
881 UInt32 binding() const noexcept override;
896 UInt32 inputAttachmentIndex() const noexcept;
906 LITEFX_BUILDER(VulkanDescriptorSetLayoutBuilder);
911 using base_type::free;
912 using base_type::allocate;
984 const VulkanDevice& device() const noexcept;
990 UInt32 maxUnboundedArraySize() const noexcept;
994 const
Array<VulkanDescriptorLayout>& descriptors() const noexcept override;
997 const VulkanDescriptorLayout& descriptor(
UInt32 binding) const override;
1000 UInt32 space() const noexcept override;
1003 ShaderStage shaderStages() const noexcept override;
1006 UInt32 uniforms() const noexcept override;
1009 UInt32 storages() const noexcept override;
1012 UInt32 images() const noexcept override;
1015 UInt32 buffers() const noexcept override;
1018 UInt32 samplers() const noexcept override;
1021 UInt32 staticSamplers() const noexcept override;
1024 UInt32 inputAttachments() const noexcept override;
1027 bool containsUnboundedArray() const noexcept override;
1033 bool bindsResources() const noexcept override;
1036 bool bindsSamplers() const noexcept override;
1051#ifdef __cpp_lib_mdspan
1060 void free(
const VulkanDescriptorSet& descriptorSet)
const override;
1098 UInt32 space() const noexcept override;
1101 UInt32 binding() const noexcept override;
1104 UInt32 offset() const noexcept override;
1107 UInt32 size() const noexcept override;
1121 LITEFX_BUILDER(VulkanPushConstantsLayoutBuilder);
1156 UInt32 size() const noexcept override;
1171 LITEFX_BUILDER(VulkanPipelineLayoutBuilder);
1224 static inline auto create(
const VulkanDevice& device) {
1231 const VulkanDevice& device() const noexcept ;
1234 const VulkanDescriptorSetLayout& descriptorSet(
UInt32 space) const override;
1237 const
Array<
SharedPtr<const VulkanDescriptorSetLayout>>& descriptorSets() const override;
1240 const VulkanPushConstantsLayout* pushConstants() const noexcept override;
1243 bool dynamicResourceHeapAccess() const override;
1246 bool dynamicSamplerHeapAccess() const override;
1255 LITEFX_BUILDER(VulkanInputAssemblerBuilder);
1315 static inline auto create() {
1324 const VulkanVertexBufferLayout& vertexBufferLayout(
UInt32 binding)
const override;
1327 const VulkanIndexBufferLayout* indexBufferLayout() const noexcept override;
1338 LITEFX_BUILDER(VulkanRasterizerBuilder);
1406 static inline auto create() {
1423 virtual void updateLineWidth(
Float lineWidth)
noexcept;
1448 virtual VkPipelineBindPoint pipelineType() const noexcept = 0;
1467 using base_type::dispatch;
1468 using base_type::dispatchIndirect;
1469 using base_type::dispatchMesh;
1470 using base_type::draw;
1471 using base_type::drawIndirect;
1472 using base_type::drawIndexed;
1473 using base_type::drawIndexedIndirect;
1474 using base_type::barrier;
1475 using base_type::transfer;
1476 using base_type::bind;
1477 using base_type::use;
1478 using base_type::pushConstants;
1479 using base_type::buildAccelerationStructure;
1480 using base_type::updateAccelerationStructure;
1481 using base_type::copyAccelerationStructure;
1535 void begin() const override;
1538 void end() const override;
1553 bool isSecondary() const noexcept override;
1556 void setViewports(
Span<const
IViewport*> viewports) const override;
1559 void setViewports(const
IViewport* viewport) const override;
1562 void setScissors(
Span<const
IScissor*> scissors) const override;
1565 void setScissors(const
IScissor* scissor) const override;
1568 void setBlendFactors(const
Vector4f& blendFactors) const noexcept override;
1571 void setStencilRef(
UInt32 stencilRef) const noexcept override;
1574 void setDepthBounds(
Float minBounds,
Float maxBounds) const noexcept override;
1577 UInt64 submit() const override;
1583 void barrier(const
VulkanBarrier& barrier) const noexcept override;
1589 void transfer(const
void* const data,
size_t size, const
IVulkanBuffer& target,
UInt32 targetElement = 0,
UInt32 elements = 1) const override;
1592 void transfer(
Span<const
void* const> data,
size_t elementSize, const
IVulkanBuffer& target,
UInt32 firstElement = 0) const override;
1598 void transfer(const
void* const data,
size_t size, const
IVulkanImage& target,
UInt32 subresource = 0) const override;
1601 void transfer(
Span<const
void* const> data,
size_t elementSize, const
IVulkanImage& target,
UInt32 firstSubresource = 0,
UInt32 subresources = 1) const override;
1643 void dispatch(const
Vector3u& threadCount) const noexcept override;
1649 void dispatchMesh(const
Vector3u& threadCount) const noexcept override;
1652 void dispatchMeshIndirect(const
IVulkanBuffer& batchBuffer,
UInt32 batchCount,
UInt64 offset = 0) const noexcept override;
1658 void draw(
UInt32 vertices,
UInt32 instances = 1,
UInt32 firstVertex = 0,
UInt32 firstInstance = 0) const noexcept override;
1667 void drawIndexed(
UInt32 indices,
UInt32 instances = 1,
UInt32 firstIndex = 0,
Int32 vertexOffset = 0,
UInt32 firstInstance = 0) const noexcept override;
1670 void drawIndexedIndirect(const
IVulkanBuffer& batchBuffer,
UInt32 batchCount,
UInt64 offset = 0) const noexcept override;
1710 return std::static_pointer_cast<const ICommandQueue>(this->queue());
1713 void releaseSharedState()
const override;
1726 using base_type::submit;
1782 UInt32 familyId() const noexcept;
1788 UInt32 queueId() const noexcept;
1794 const VkSemaphore& timelineSemaphore() const noexcept;
1802 QueueType type() const noexcept override;
1804#ifdef LITEFX_BUILD_SUPPORT_DEBUG_MARKERS
1810 void endDebugRegion() const noexcept override;
1813 void setDebugMarker(const
String& label, const Vectors::ByteVector3& color = DEFAULT_DEBUG_COLOR) const noexcept override;
1827 void waitFor(
UInt64 fence)
const override;
1833 UInt64 currentFence() const noexcept override;
1836 UInt64 lastCompletedFence() const noexcept override;
1840 auto vkQueue =
dynamic_cast<const VulkanQueue*
>(&queue);
1842 if (vkQueue ==
nullptr) [[unlikely]]
1845 this->waitFor(*vkQueue, fence);
1856 LITEFX_BUILDER(VulkanRenderPipelineBuilder);
1912 bool alphaToCoverage() const noexcept override;
1923 VkPipelineBindPoint pipelineType() const noexcept override;
1936 LITEFX_BUILDER(VulkanComputePipelineBuilder);
1981 VkPipelineBindPoint pipelineType() const noexcept override;
1994 LITEFX_BUILDER(VulkanRayTracingPipelineBuilder);
2047 UInt32 maxRecursionDepth() const noexcept override;
2050 UInt32 maxPayloadSize() const noexcept override;
2053 UInt32 maxAttributeSize() const noexcept override;
2061 VkPipelineBindPoint pipelineType() const noexcept override;
2077 using FrameBuffer::addImage;
2078 using FrameBuffer::mapRenderTarget;
2079 using FrameBuffer::mapRenderTargets;
2149 VkImageView imageView(
UInt32 imageIndex)
const;
2157 VkImageView imageView(
StringView imageName)
const;
2165 VkImageView imageView(
const RenderTarget& renderTarget)
const;
2170 const Size2d& size() const noexcept override;
2173 size_t getWidth() const noexcept override;
2176 size_t getHeight() const noexcept override;
2185 void unmapRenderTarget(const
RenderTarget& renderTarget) noexcept override;
2192 return this->image(index);
2200 return this->image(renderTarget);
2208 return this->resolveImage(hash(renderTargetName));
2213 return this->resolveImage(hash(renderTargetName));
2226 void resize(
const Size2d& renderArea)
override;
2235 LITEFX_BUILDER(VulkanRenderPassBuilder);
2292 VulkanRenderPass(VulkanRenderPass&&) noexcept = delete;
2295 VulkanRenderPass(const VulkanRenderPass&) = delete;
2298 VulkanRenderPass& operator=(VulkanRenderPass&&) noexcept = delete;
2301 VulkanRenderPass& operator=(const VulkanRenderPass&) = delete;
2374 explicit VulkanRenderPass(
const VulkanDevice& device,
const String& name =
"");
2396 const VulkanDevice& device() const noexcept ;
2399 SharedPtr<const VulkanFrameBuffer> activeFrameBuffer() const noexcept override;
2402 const VulkanQueue& commandQueue() const noexcept override;
2408 SharedPtr<const VulkanCommandBuffer> commandBuffer(
UInt32 index) const override;
2411 UInt32 secondaryCommandBuffers() const noexcept override;
2420 bool hasPresentTarget() const noexcept override;
2432 void begin(const VulkanFrameBuffer& frameBuffer) const override;
2435 UInt64 end() const override;
2438 UInt32 viewMask() const noexcept override;
2485 virtual const VkQueryPool& timestampQueryPool() const noexcept;
2505 Format surfaceFormat() const noexcept override;
2508 UInt32 buffers() const noexcept override;
2511 const
Size2d& renderArea() const noexcept override;
2514 bool verticalSynchronization() const noexcept override;
2526 void present(
UInt64 fence) const override;
2536 void reset(
Format surfaceFormat, const
Size2d& renderArea,
UInt32 buffers,
bool enableVsync = false) override;
2539 [[nodiscard]]
UInt32 swapBackBuffer() const override;
2555 using base_type::createBuffer;
2556 using base_type::tryCreateBuffer;
2557 using base_type::createVertexBuffer;
2558 using base_type::tryCreateVertexBuffer;
2559 using base_type::createIndexBuffer;
2560 using base_type::tryCreateIndexBuffer;
2561 using base_type::createTexture;
2562 using base_type::tryCreateTexture;
2563 using base_type::createTextures;
2564 using base_type::createSampler;
2565 using base_type::createSamplers;
2566 using base_type::allocate;
2624 UInt64 beginDefragmentationPass()
const override;
2627 bool endDefragmentationPass()
const override;
2690 SharedPtr<IVulkanSampler> createSampler(
const String& name,
FilterMode magFilter = FilterMode::Nearest,
FilterMode minFilter = FilterMode::Nearest,
BorderMode borderU = BorderMode::Repeat,
BorderMode borderV = BorderMode::Repeat,
BorderMode borderW = BorderMode::Repeat,
MipMapMode mipMapMode = MipMapMode::Nearest,
Float mipMapBias = 0.f,
Float maxLod = std::numeric_limits<Float>::max(),
Float minLod = 0.f,
Float anisotropy = 0.f)
const override;
2702 bool supportsResizableBaseAddressRegister() const noexcept override;
2714 class LITEFX_VULKAN_API
VulkanDevice final : public
GraphicsDevice<
VulkanGraphicsFactory,
VulkanSurface,
VulkanGraphicsAdapter,
VulkanSwapChain,
VulkanQueue,
VulkanRenderPass,
VulkanRenderPipeline,
VulkanComputePipeline,
VulkanRayTracingPipeline,
VulkanBarrier>, public
Resource<VkDevice> {
2727 static const size_t DEFAULT_DESCRIPTOR_HEAP_SIZE = 134'217'728;
2743 VulkanDevice(VulkanDevice&&) noexcept = delete;
2746 VulkanDevice(const VulkanDevice&) = delete;
2749 VulkanDevice& operator=(VulkanDevice&&) noexcept = delete;
2752 VulkanDevice& operator=(const VulkanDevice&) = delete;
2771 return SharedObject::create<VulkanDevice>(
backend, adapter, std::move(surface), features, extensions, globalDescriptorHeapSize)->initialize(Format::B8G8R8A8_SRGB, { 800, 600 }, 3,
false, features);
2807 void release() noexcept;
2821 void setDebugName(VkDebugReportObjectTypeEXT objectType,
UInt64 objectHandle,
StringView name) const noexcept;
2828 Span<const
String> enabledExtensions() const noexcept;
2841 template <typename THandle>
2842 inline
void setDebugName(THandle objectHandle, VkDebugReportObjectTypeEXT objectType,
StringView name) const noexcept {
2843 this->setDebugName(objectType, Vk::handleAddress(objectHandle), name);
2899 double ticksPerMillisecond() const noexcept override;
2902 void wait() const override;
2923 void bindGlobalDescriptorHeaps(const
VulkanCommandBuffer& commandBuffer) const noexcept override;
2925#if defined(LITEFX_BUILD_DEFINE_BUILDERS)
2928 [[nodiscard]] VulkanRenderPassBuilder buildRenderPass(
UInt32 commandBuffers = 1)
const override;
2931 [[nodiscard]] VulkanRenderPassBuilder buildRenderPass(
const String& name,
UInt32 commandBuffers = 1)
const override;
2937 [[nodiscard]] VulkanRenderPipelineBuilder buildRenderPipeline(
const VulkanRenderPass& renderPass,
const String& name)
const override;
2940 [[nodiscard]] VulkanComputePipelineBuilder buildComputePipeline(
const String& name)
const override;
2943 [[nodiscard]] VulkanRayTracingPipelineBuilder buildRayTracingPipeline(
ShaderRecordCollection&& shaderRecords)
const override;
2946 [[nodiscard]] VulkanRayTracingPipelineBuilder buildRayTracingPipeline(
const String& name,
ShaderRecordCollection&& shaderRecords)
const override;
2949 [[nodiscard]] VulkanPipelineLayoutBuilder buildPipelineLayout()
const override;
2952 [[nodiscard]] VulkanInputAssemblerBuilder buildInputAssembler()
const override;
2955 [[nodiscard]] VulkanRasterizerBuilder buildRasterizer()
const override;
2958 [[nodiscard]] VulkanShaderProgramBuilder buildShaderProgram()
const override;
2961 [[nodiscard]] VulkanBarrierBuilder buildBarrier()
const override;
3000 virtual
Span<const
String> getEnabledValidationLayers() const noexcept;
3002#ifdef VK_USE_PLATFORM_WIN32_KHR
3063 void activate() override;
3066 void deactivate() override;
3080 void releaseDevice(const
String& name) override;
The base class for an application.
Definition app.hpp:402
Provides access to a resource managed by the class.
Definition containers.hpp:792
An exception that is thrown, if a provided argument is not valid.
Definition exceptions.hpp:60
Represents the base interface for a Vulkan acceleration structure implementation.
Definition vulkan.hpp:295
IVulkanAccelerationStructure() noexcept=default
Represents the base interface for a Vulkan buffer implementation.
Definition vulkan.hpp:190
IVulkanBuffer() noexcept=default
Represents a Vulkan sampled image or the base interface for a texture.
Definition vulkan.hpp:244
IVulkanImage() noexcept=default
Represents a Vulkan index buffer.
Definition vulkan.hpp:224
IVulkanIndexBuffer() noexcept=default
Represents a Vulkan sampler.
Definition vulkan.hpp:277
IVulkanSampler() noexcept=default
Represents a Vulkan vertex buffer.
Definition vulkan.hpp:207
IVulkanVertexBuffer() noexcept=default
Defines a rendering backend that creates a Vulkan device.
Definition vulkan.hpp:2968
std::function< VkSurfaceKHR(const VkInstance &)> surface_callback
A callback that creates a surface from a Vulkan instance.
Definition vulkan.hpp:3013
VulkanBackend(VulkanBackend &&) noexcept
Implements a Vulkan resource barrier.
Definition vulkan.hpp:495
VulkanBarrier(VulkanBarrier &&) noexcept
Implements a Vulkan bottom-level acceleration structure (BLAS).
Definition vulkan.hpp:311
VulkanBottomLevelAccelerationStructure(VulkanBottomLevelAccelerationStructure &&) noexcept
Records commands for a VulkanQueue
Definition vulkan.hpp:1461
Implements a Vulkan ComputePipeline.
Definition vulkan.hpp:1934
VulkanComputePipeline(VulkanComputePipeline &&) noexcept
Implements a Vulkan IDescriptorLayout
Definition vulkan.hpp:817
VulkanDescriptorLayout(VulkanDescriptorLayout &&) noexcept
Implements a Vulkan DescriptorSet.
Definition vulkan.hpp:723
VulkanDescriptorSet(VulkanDescriptorSet &&) noexcept=delete
Implements a Vulkan DescriptorSetLayout.
Definition vulkan.hpp:904
static auto create(const VulkanDescriptorSetLayout &other)
Creates a copy of a Vulkan descriptor set layout.
Definition vulkan.hpp:965
Implements a Vulkan graphics device.
Definition vulkan.hpp:2714
static SharedPtr< VulkanDevice > create(const VulkanBackend &backend, const VulkanGraphicsAdapter &adapter, UniquePtr< VulkanSurface > &&surface, Format format, const Size2d &renderArea, UInt32 backBuffers, bool enableVsync=false, GraphicsDeviceFeatures features={ }, Span< String > extensions={ }, size_t globalDescriptorHeapSize=DEFAULT_DESCRIPTOR_HEAP_SIZE)
Initializes the device instance.
Definition vulkan.hpp:2788
Implements a Vulkan frame buffer.
Definition vulkan.hpp:2071
const IVulkanImage & operator[](StringView renderTargetName) const override
Resolves a render target name and returns the image mapped to it.The image mapped to the render targe...
Definition vulkan.hpp:2207
const IVulkanImage & operator[](const RenderTarget &renderTarget) const override
Resolves a render target and returns the image mapped to it.The image mapped to the render target.
Definition vulkan.hpp:2199
static SharedPtr< VulkanFrameBuffer > create(const VulkanDevice &device, const Size2d &renderArea, allocation_callback_type allocationCallback, StringView name="")
Initializes a Vulkan frame buffer.
Definition vulkan.hpp:2137
const IVulkanImage & image(StringView renderTargetName) const override
Resolves a render target name and returns the image mapped to it.The image mapped to the render targe...
Definition vulkan.hpp:2212
Represents a Vulkan IGraphicsAdapter.
Definition vulkan_api.hpp:232
A graphics factory that produces objects for a VulkanDevice.
Definition vulkan.hpp:2548
Implements a Vulkan IImage.
Definition image.h:16
Implements a Vulkan index buffer layout.
Definition vulkan.hpp:119
static auto create(const VulkanIndexBufferLayout &other)
Creates a copy of an index buffer layout.
Definition vulkan.hpp:162
Implements a Vulkan PipelineLayout.
Definition vulkan.hpp:1169
Defines the base class for Vulkan pipeline state objects.
Definition vulkan.hpp:1431
VulkanPipelineState(VulkanPipelineState &&) noexcept=default
Implements the Vulkan PushConstantsLayout.
Definition vulkan.hpp:1119
VulkanPushConstantsLayout(VulkanPushConstantsLayout &&) noexcept
Implements the Vulkan IPushConstantsRange.
Definition vulkan.hpp:1067
VulkanPushConstantsRange(VulkanPushConstantsRange &&) noexcept
Implements a Vulkan command queue.
Definition vulkan.hpp:1720
Implements a Vulkan IRasterizer.
Definition vulkan.hpp:1337
static auto create(const VulkanRasterizer &other)
Creates a new Vulkan rasterizer state by copying an existing one.
Definition vulkan.hpp:1397
Implements a Vulkan RayTracingPipeline.
Definition vulkan.hpp:1992
VulkanRayTracingPipeline(VulkanRayTracingPipeline &&) noexcept
Implements a Vulkan render pass.
Definition vulkan.hpp:2233
static SharedPtr< VulkanRenderPass > create(const VulkanDevice &device, const String &name, Span< RenderTarget > renderTargets, Span< RenderPassDependency > inputAttachments={ }, Optional< DescriptorBindingPoint > inputAttachmentSamplerBinding=std::nullopt, UInt32 secondaryCommandBuffers=1u, UInt32 viewMask=0b0000)
Creates and initializes a new Vulkan render pass instance that executes on the default graphics queue...
Definition vulkan.hpp:2333
static SharedPtr< VulkanRenderPass > create(const VulkanDevice &device, const String &name, const VulkanQueue &queue, Span< RenderTarget > renderTargets, Span< RenderPassDependency > inputAttachments={ }, Optional< DescriptorBindingPoint > inputAttachmentSamplerBinding=std::nullopt, UInt32 secondaryCommandBuffers=1u, UInt32 viewMask=0b0000)
Creates and initializes a new Vulkan render pass instance.
Definition vulkan.hpp:2364
static SharedPtr< VulkanRenderPass > create(const VulkanDevice &device, const VulkanQueue &queue, Span< RenderTarget > renderTargets, Span< RenderPassDependency > inputAttachments={ }, Optional< DescriptorBindingPoint > inputAttachmentSamplerBinding=std::nullopt, UInt32 secondaryCommandBuffers=1u, UInt32 viewMask=0b0000)
Creates and initializes a new Vulkan render pass instance.
Definition vulkan.hpp:2348
Implements a Vulkan RenderPipeline.
Definition vulkan.hpp:1854
VulkanRenderPipeline(VulkanRenderPipeline &&) noexcept=delete
Implements a Vulkan IShaderModule.
Definition vulkan.hpp:575
VulkanShaderModule(VulkanShaderModule &&) noexcept
Implements a Vulkan ShaderProgram.
Definition vulkan.hpp:649
VulkanShaderProgram(VulkanShaderProgram &&) noexcept=delete
Represents a Vulkan ISurface.
Definition vulkan_api.hpp:334
Implements a Vulkan swap chain.
Definition vulkan.hpp:2444
VulkanSwapChain(VulkanSwapChain &&) noexcept=delete
Implements a Vulkan top-level acceleration structure (TLAS).
Definition vulkan.hpp:406
VulkanTopLevelAccelerationStructure(VulkanTopLevelAccelerationStructure &&) noexcept
Implements a Vulkan vertex buffer layout.
Definition vulkan.hpp:21
static auto create(size_t vertexSize, const Enumerable< BufferAttribute > &attributes, UInt32 binding=0, VertexBufferInputRate inputRate=VertexBufferInputRate::Vertex)
Creates a new vertex buffer layout.
Definition vulkan.hpp:81
static auto create(const VulkanVertexBufferLayout &other)
Creates a copy of a vertex buffer layout.
Definition vulkan.hpp:90
A barrier used for GPU resource synchronization.
Definition rendering.hpp:17
Represents a command buffer, that buffers commands that should be submitted to a CommandQueue.
Definition rendering.hpp:619
Represents a command queue.
Definition rendering.hpp:1113
Represents a compute Pipeline.
Definition rendering.hpp:1023
Stores the depth/stencil state of a see IRasterizer.
Definition rendering_api.hpp:3751
Defines a set of descriptors.
Definition rendering.hpp:150
Describes the layout of a descriptor set.
Definition rendering.hpp:237
A class that can be used to manage the state of a IGraphicsDevice.
Definition rendering_api.hpp:2697
Stores the images used by a RenderPass to either read from using input attachments or write to using ...
Definition rendering.hpp:1079
IFrameBuffer::allocation_callback_type< image_type > allocation_callback_type
Definition rendering.hpp:1082
Represents the graphics device that a rendering back-end is doing work on.
Definition rendering.hpp:1538
Describes a factory that creates objects for a GraphicsDevice.
Definition rendering.hpp:1277
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
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
A structure that holds a singular entity of geometry for hardware ray-tracing.
Definition rendering_api.hpp:5399
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
Base interface for buffer objects.
Definition rendering_api.hpp:4997
The interface for a command buffer.
Definition rendering_api.hpp:7682
The interface for a command queue.
Definition rendering_api.hpp:9742
Describes a the layout of a single descriptor within a DescriptorSet.
Definition rendering_api.hpp:4641
The interface for a descriptor set.
Definition rendering_api.hpp:6064
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
The interface for a graphics device that.
Definition rendering_api.hpp:11050
Describes a generic image.
Definition rendering_api.hpp:5019
Describes a index buffer layout.
Definition rendering_api.hpp:4603
Describes a range within a IPushConstantsLayout.
Definition rendering_api.hpp:6561
Describes a texture sampler.
Definition rendering_api.hpp:5135
The interface of a scissor.
Definition rendering_api.hpp:4207
Represents a single shader module, i.e. a part of a IShaderProgram.
Definition rendering_api.hpp:3363
A structure that stores the instance data for a IBottomLevelAccelerationStructure.
Definition rendering_api.hpp:5681
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
Describes a vertex buffer layout.
Definition rendering_api.hpp:4574
Interface for a viewport.
Definition rendering_api.hpp:4089
Describes an index buffer.
Definition rendering.hpp:501
Represents a pipeline state.
Definition rendering.hpp:569
Represents a the layout of a RenderPipeline, ComputePipeline or RayTracingPipeline.
Definition rendering.hpp:440
Describes the layout of the pipelines push constant ranges.
Definition rendering.hpp:377
Implements a IRasterizer.
Definition rendering_api.hpp:4006
Represents a ray-tracing Pipeline.
Definition rendering.hpp:1042
Defines a back-end, that provides a device instance for a certain surface and graphics adapter.
Definition rendering.hpp:1796
Represents a mapping between a set of RenderTarget instances and the input attachments of a IRenderPa...
Definition rendering_api.hpp:3684
Represents a render pass.
Definition rendering.hpp:1173
Represents a graphics Pipeline.
Definition rendering.hpp:984
Implements a render target.
Definition rendering_api.hpp:3584
Represents a shader program, consisting of multiple IShaderModules.
Definition rendering.hpp:408
Stores a set of IShaderRecords in that later form a shader binding table used for ray-tracing.
Definition rendering_api.hpp:6923
Base class for a resource that can be identified by a name string within a DeviceState.
Definition rendering_api.hpp:2650
Represents a swap chain, i.e. a chain of multiple IImage instances, that can be presented to a ISurfa...
Definition rendering.hpp:1233
An event that is used to measure timestamps in a command queue.
Definition rendering_api.hpp:4371
Describes a vertex buffer.
Definition rendering.hpp:477
Represents a virtual allocator that manages memory distribution from a piece of raw memory.
Definition rendering_api.hpp:3032
Implements the IResource interface.
Definition containers.hpp:823
static auto create(TArgs &&... args) -> SharedPtr< T >
Generic factory method used to create instances of the shared object.
Definition containers.hpp:1114
Definition backend.cpp:18
Definition barrier.cpp:14
Definition command_buffer.cpp:20
Definition compute_pipeline.cpp:10
Definition descriptor_layout.cpp:10
Definition descriptor_set.cpp:14
Definition descriptor_set_layout.cpp:15
Definition frame_buffer.cpp:9
Definition factory.cpp:12
Definition index_buffer_layout.cpp:9
Definition pipeline_layout.cpp:10
Definition push_constants_layout.cpp:10
Definition push_constants_range.cpp:9
Definition ray_tracing_pipeline.cpp:15
Definition render_pass.cpp:10
Definition render_pipeline.cpp:10
Definition shader_module.cpp:10
Definition shader_program.cpp:52
Definition swapchain.cpp:18
Definition vertex_buffer_layout.cpp:10
Concept that can be used to refer to backend implementations.
Definition app.hpp:80
uint64_t UInt64
A type for an unsigned 64 bit integer.
Definition math.hpp:71
float_t Float
A type for a floating point value with single precision.
Definition math.hpp:76
uint32_t UInt32
A type for an unsigned 32 bit integer.
Definition math.hpp:61
int32_t Int32
A type for a signed 32 bit integer.
Definition math.hpp:56
std::byte Byte
A type for a single byte of raw memory.
Definition math.hpp:36
BorderMode
Describes how to treat texture coordinates that are outside the domain [0..1].
Definition rendering_api.hpp:1356
CullOrder
Describes the order or vertex winding, that is used to determine, whether a polygon is facing towards...
Definition rendering_api.hpp:1190
DescriptorHeapType
The target heap type for a descriptor.
Definition rendering_api.hpp:580
@ Resource
Binds all non-sampler resource views.
ImageLayout
Specifies the layout of an IImage resource.
Definition rendering_api.hpp:1858
MipMapMode
Describes the filter operation between two mip-map levels.
Definition rendering_api.hpp:1341
CullMode
Describes which faces are culled by the Rasterizer stage.
Definition rendering_api.hpp:1163
ShaderStage
Describes the valid shader stages of a graphics pipeline.
Definition rendering_api.hpp:971
IndexType
Describes the element type of an index buffer.
Definition rendering_api.hpp:906
PrimitiveTopology
Describes the topology of a mesh primitive.
Definition rendering_api.hpp:937
@ TriangleList
A list of triangles, where each triplet of vertices refers to a whole triangle.
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.
PolygonMode
Describes the draw mode for polygons.
Definition rendering_api.hpp:1142
BufferType
Describes the type of a IBuffer.
Definition rendering_api.hpp:601
DefragmentationStrategy
The strategy to apply to a defragmentation pass.
Definition rendering_api.hpp:886
ResourceUsage
Describes the intended usage for a resource.
Definition rendering_api.hpp:761
ImageDimensions
Describes the dimensions of a image resource, i.e. the dimensions that are required to access a texel...
Definition rendering_api.hpp:1258
AllocationAlgorithm
The allocation algorithm used by VirtualAllocators.
Definition rendering_api.hpp:852
DescriptorType
Describes the type of a IDescriptor.
Definition rendering_api.hpp:442
QueuePriority
Specifies the priority with which a queue is scheduled on the GPU.
Definition rendering_api.hpp:160
@ Normal
The default queue priority.
QueueType
Represents the type of a CommandQueue.
Definition rendering_api.hpp:114
ResourceHeap
Defines where a resource (buffer or image) memory is located and from where it can be accessed.
Definition rendering_api.hpp:710
AccelerationStructureFlags
Controls how an acceleration structure should be built.
Definition rendering_api.hpp:1988
FilterMode
Describes the filter operation when accessing a pixel from a texture coordinate.
Definition rendering_api.hpp:1324
AllocationBehavior
Controls the allocation behavior of IGraphicsFactory.
Definition rendering_api.hpp:830
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
ResourceAccess
Defines how a IBuffer or IImage resource is accessed.
Definition rendering_api.hpp:1709
Format
Describes a texel format.
Definition rendering_api.hpp:183
MultiSamplingLevel
Describes the number of samples with which a IImage is sampled.
Definition rendering_api.hpp:1283
std::generator< T, TVal > Generator
Describes an intermediate container for elements of type T .
Definition containers.hpp:206
std::vector< T > Array
Represents a dynamic array.
Definition containers.hpp:73
std::optional< T > Optional
Represents an optional value.
Definition containers.hpp:94
std::shared_ptr< T > SharedPtr
Represents a shared pointer, that expresses non-exclusive ownership.
Definition containers.hpp:109
std::unique_ptr< T, TDeleter > UniquePtr
Represents a unique pointer, that expresses exclusive ownership.
Definition containers.hpp:102
std::string String
Definition string.hpp:24
std::string_view StringView
Definition string.hpp:26
BackendType
Definition app_api.hpp:35
std::span< T > Span
Represents a view of an array.
Definition containers.hpp:87
An input range over another range, where the returned values of type T are covariants of the values ...
Definition containers.hpp:529
An algebraic vector type.
Definition vector.hpp:23
Describes a resource binding to a descriptor or descriptor set.
Definition rendering_api.hpp:6218
Describes a single descriptor binding point within a IShaderModule.
Definition rendering_api.hpp:3309
Stores extended memory statistics, that can be queried by calling IGraphicsFactory::detailedMemorySta...
Definition rendering_api.hpp:10040
Describes optional features that can be supported by a device.
Definition rendering_api.hpp:10983
Stores a buffer that contains axis-aligned bounding boxes.
Definition rendering_api.hpp:5481
Represents a triangle mesh.
Definition rendering_api.hpp:5404
Represents an instance of an IBottomLevelAccelerationStructure.
Definition rendering_api.hpp:5688
Stores simple memory heap statistics, that can be quickly queried by calling IGraphicsFactory::memory...
Definition rendering_api.hpp:9985
A hint used during shader reflection to control the pipeline layout.
Definition rendering_api.hpp:7174
Describes the offsets and sizes of a shader group within a shader binding table buffer.
Definition rendering_api.hpp:4291
An allocator used to allocate the shared object.
Definition containers.hpp:1098
Definition alloc_buffer.cpp:13