3#if !defined (LITEFX_RENDERING_API)
4# if defined(LiteFX_Rendering_EXPORTS) && (defined _WIN32 || defined WINCE)
5# define LITEFX_RENDERING_API __declspec(dllexport)
6# elif (defined(LiteFX_Rendering_EXPORTS) || defined(__APPLE__)) && defined __GNUC__ && __GNUC__ >= 4
7# define LITEFX_RENDERING_API __attribute__ ((visibility ("default")))
8# elif !defined(LiteFX_Rendering_EXPORTS) && (defined _WIN32 || defined WINCE)
9# define LITEFX_RENDERING_API __declspec(dllimport)
13#ifndef LITEFX_RENDERING_API
14# define LITEFX_RENDERING_API
17#include <litefx/app.hpp>
18#include <litefx/math.hpp>
19#include <litefx/graphics.hpp>
25 class IGraphicsAdapter;
33 class IVertexBufferLayout;
34 class IIndexBufferLayout;
35 class IDescriptorLayout;
43 class IDescriptorSetLayout;
44 class IPushConstantsRange;
45 class IPushConstantsLayout;
47 class IPipelineLayout;
50 class IInputAssembler;
53 class IRenderPipeline;
54 class IComputePipeline;
59 class IGraphicsFactory;
60 class IGraphicsDevice;
67 enum class LITEFX_RENDERING_API GraphicsAdapterType {
105 enum class LITEFX_RENDERING_API QueueType {
114 Graphics = 0x00000001,
119 Compute = 0x00000002,
124 Transfer = 0x00000004,
135 enum class LITEFX_RENDERING_API QueuePriority {
155 enum class LITEFX_RENDERING_API Format {
249 R16G16B16A16_USCALED,
250 R16G16B16A16_SSCALED,
312 enum class LITEFX_RENDERING_API BufferFormat {
323 XYZW16F = 0x10000104,
324 XYZW16I = 0x10000204,
325 XYZW16U = 0x10000404,
335 XYZW32F = 0x20000104,
336 XYZW32I = 0x20000204,
344 enum class LITEFX_RENDERING_API AttributeSemantic {
348 Binormal = 0x00000001,
353 BlendIndices = 0x00000002,
358 BlendWeight = 0x00000003,
373 Position = 0x00000006,
378 TransformedPosition = 0x00000007,
383 PointSize = 0x00000008,
388 Tangent = 0x00000009,
393 TextureCoordinate = 0x0000000A,
409 enum class LITEFX_RENDERING_API DescriptorType {
416 ConstantBuffer = 0x00000001,
428 StructuredBuffer = 0x00000002,
436 RWStructuredBuffer = 0x00000012,
448 Texture = 0x00000003,
456 RWTexture = 0x00000013,
461 Sampler = 0x00000004,
466 InputAttachment = 0x00000005,
482 RWBuffer = 0x00000016,
490 ByteAddressBuffer = 0x00000007,
498 RWByteAddressBuffer = 0x00000017,
505 enum class LITEFX_RENDERING_API BufferType {
522 Uniform = 0x00000003,
530 Storage = 0x00000004,
577 enum class LITEFX_RENDERING_API BufferUsage {
586 Staging = 0x00000001,
604 Dynamic = 0x00000010,
609 Readback = 0x00000100
615 enum class LITEFX_RENDERING_API IndexType {
630 enum class LITEFX_RENDERING_API ShaderStage {
639 TessellationControl = 0x00000002,
644 TessellationEvaluation = 0x00000004,
652 Geometry = 0x00000008,
657 Fragment = 0x00000010,
662 Compute = 0x00000020,
674 enum class LITEFX_RENDERING_API PolygonMode {
683 Wireframe = 0x00000002,
695 enum class LITEFX_RENDERING_API CullMode {
699 FrontFaces = 0x00000001,
704 BackFaces = 0x00000002,
714 Disabled = 0x0000000F
722 enum class LITEFX_RENDERING_API CullOrder {
726 ClockWise = 0x00000001,
731 CounterClockWise = 0x00000002
737 enum class LITEFX_RENDERING_API RenderTargetType {
746 DepthStencil = 0x00000002,
761 enum class LITEFX_RENDERING_API ImageDimensions {
786 enum class LITEFX_RENDERING_API MultiSamplingLevel {
827 enum class LITEFX_RENDERING_API FilterMode {
831 Nearest = 0x00000001,
844 enum class LITEFX_RENDERING_API MipMapMode {
848 Nearest = 0x00000001,
859 enum class LITEFX_RENDERING_API BorderMode {
868 RepeatMirrored = 0x00010001,
873 ClampToEdge = 0x00000002,
878 ClampToEdgeMirrored = 0x00010002,
883 ClampToBorder = 0x00000003,
890 enum class LITEFX_RENDERING_API CompareOperation {
914 LessEqual = 0x00000004,
919 GreaterEqual = 0x00000005,
924 NotEqual = 0x00000006,
936 enum class LITEFX_RENDERING_API StencilOperation {
950 Replace = 0x00000002,
955 IncrementClamp = 0x00000003,
960 DecrementClamp = 0x00000004,
970 IncrementWrap = 0x00000006,
975 DecrementWrap = 0x00000007
982 enum class LITEFX_RENDERING_API BlendFactor {
986 OneMinusSourceColor = 3,
987 DestinationColor = 4,
988 OneMinusDestinationColor = 5,
990 OneMinusSourceAlpha = 7,
991 DestinationAlpha = 8,
992 OneMinusDestinationAlpha = 9,
994 OneMinusConstantColor = 11,
996 OneMinusConstantAlpha = 13,
997 SourceAlphaSaturate = 14,
999 OneMinusSource1Color = 16,
1001 OneMinusSource1Alpha = 18
1008 enum class LITEFX_RENDERING_API WriteMask {
1034 enum class LITEFX_RENDERING_API BlendOperation {
1037 ReverseSubtract = 0x03,
1046 enum class LITEFX_RENDERING_API ResourceState {
1066 Common = 0x00000001,
1087 VertexBuffer = 0x00000002,
1108 IndexBuffer = 0x0000003,
1129 UniformBuffer = 0x00000004,
1150 ReadOnly = 0x00000005,
1173 GenericRead = 0x00000006,
1194 ReadWrite = 0x00000007,
1215 CopySource = 0x00000010,
1236 CopyDestination = 0x00000011,
1259 RenderTarget = 0x00000020,
1282 DepthRead = 0x00000021,
1305 DepthWrite = 0x00000022,
1328 Present = 0x00000023,
1351 ResolveSource = 0x00000024,
1374 ResolveDestination = 0x00000025,
1383 Undefined = 0x7FFFFFFF
1399 return static_cast<UInt32>(format) & 0x000000FF;
1407 return (
static_cast<UInt32>(format) & 0xFF000000) >> 24;
1415 return (
static_cast<UInt32>(format) & 0x0000FF00) >> 8;
1421 size_t LITEFX_RENDERING_API
getSize(
const Format& format);
1427 bool LITEFX_RENDERING_API
hasDepth(
const Format& format);
1433 bool LITEFX_RENDERING_API
hasStencil(
const Format& format);
1447 virtual const
String& name() const noexcept = 0;
1475 virtual const
String& name() const noexcept override;
1702 bool release(const
IPipeline& pipeline);
1709 bool release(const
IBuffer& buffer);
1730 bool release(const
IImage& image);
1737 bool release(const
ISampler& sampler);
1769 virtual
UInt64 uniqueId() const noexcept = 0;
1775 virtual
UInt32 vendorId() const noexcept = 0;
1781 virtual
UInt32 deviceId() const noexcept = 0;
1787 virtual GraphicsAdapterType type() const noexcept = 0;
1793 virtual
UInt32 driverVersion() const noexcept = 0;
1799 virtual
UInt32 apiVersion() const noexcept = 0;
1805 virtual
UInt64 dedicatedMemory() const noexcept = 0;
1836 virtual const ShaderStage& type() const noexcept = 0;
1842 virtual const
String& fileName() const noexcept = 0;
1848 virtual const
String& entryPoint() const noexcept = 0;
1872 bool Enable{
false };
1877 BlendFactor SourceColor{ BlendFactor::One };
1882 BlendFactor DestinationColor{ BlendFactor::Zero };
1887 BlendFactor SourceAlpha{ BlendFactor::One };
1892 BlendFactor DestinationAlpha{ BlendFactor::Zero };
1897 BlendOperation ColorOperation{ BlendOperation::Add };
1902 BlendOperation AlphaOperation{ BlendOperation::Add };
1907 WriteMask WriteMask{ WriteMask::R | WriteMask::G | WriteMask::B | WriteMask::A };
1918 virtual const
String& name() const noexcept = 0;
1928 virtual const
UInt32& location() const noexcept = 0;
1934 virtual const RenderTargetType& type() const noexcept = 0;
1940 virtual const Format& format() const noexcept = 0;
1949 virtual const
bool& clearBuffer() const noexcept = 0;
1958 virtual const
bool& clearStencil() const noexcept = 0;
1969 virtual const
Vector4f& clearValues() const noexcept = 0;
1981 virtual const
bool& isVolatile() const noexcept = 0;
2011 explicit RenderTarget(
const UInt32& location,
const RenderTargetType& type,
const Format& format,
const bool& clearBuffer,
const Vector4f& clearValues = { 0.f , 0.f, 0.f, 0.f },
const bool& clearStencil =
true,
const bool& isVolatile =
false,
const BlendState& blendState = {});
2025 explicit RenderTarget(
const String& name,
const UInt32& location,
const RenderTargetType& type,
const Format& format,
const bool& clearBuffer,
const Vector4f& clearValues = { 0.f , 0.f, 0.f, 0.f },
const bool& clearStencil =
true,
const bool& isVolatile =
false,
const BlendState& blendState = {});
2036 virtual const
String& name() const noexcept override;
2039 virtual const
UInt32& location() const noexcept override;
2042 virtual const RenderTargetType& type() const noexcept override;
2045 virtual const Format& format() const noexcept override;
2048 virtual const
bool& clearBuffer() const noexcept override;
2051 virtual const
bool& clearStencil() const noexcept override;
2054 virtual const
Vector4f& clearValues() const noexcept override;
2057 virtual const
bool& isVolatile() const noexcept override;
2060 virtual const
BlendState& blendState() const noexcept override;
2078 bool Enable{
true };
2088 CompareOperation Operation{ CompareOperation::Always };
2105 bool Enable{
false };
2131 StencilOperation StencilFailOp{ StencilOperation::Keep };
2136 StencilOperation StencilPassOp{ StencilOperation::Replace };
2141 StencilOperation DepthFailOp{ StencilOperation::Keep };
2146 CompareOperation Operation{ CompareOperation::Never };
2157 bool Enable{
false };
2187 explicit DepthStencilState(
const DepthState& depthState,
const DepthBias& depthBias,
const StencilState& stencilState)
noexcept;
2226 virtual
DepthState& depthState() const noexcept;
2232 virtual
DepthBias& depthBias() const noexcept;
2253 virtual const PolygonMode& polygonMode() const noexcept = 0;
2259 virtual const CullMode& cullMode() const noexcept = 0;
2265 virtual const CullOrder& cullOrder() const noexcept = 0;
2275 virtual const
Float& lineWidth() const noexcept = 0;
2299 explicit Rasterizer(
const PolygonMode& polygonMode,
const CullMode& cullMode,
const CullOrder& cullOrder,
const Float& lineWidth = 1.f,
const DepthStencilState& depthStencilState = {})
noexcept;
2306 virtual const PolygonMode& polygonMode() const noexcept override;
2309 virtual const CullMode& cullMode() const noexcept override;
2312 virtual const CullOrder& cullOrder() const noexcept override;
2315 virtual const
Float& lineWidth() const noexcept override;
2321 virtual PolygonMode& polygonMode() noexcept;
2322 virtual CullMode& cullMode() noexcept;
2323 virtual CullOrder& cullOrder() noexcept;
2324 virtual
Float& lineWidth() noexcept;
2340 virtual
RectF getRectangle() const noexcept = 0;
2346 virtual
void setRectangle(const
RectF& rectangle) noexcept = 0;
2352 virtual
float getMinDepth() const noexcept = 0;
2358 virtual
void setMinDepth(const
float& depth) const noexcept = 0;
2364 virtual
float getMaxDepth() const noexcept = 0;
2370 virtual
void setMaxDepth(const
float& depth) const noexcept = 0;
2394 virtual
RectF getRectangle() const noexcept override;
2397 virtual
void setRectangle(const
RectF& rectangle) noexcept override;
2400 virtual
Float getMinDepth() const noexcept override;
2403 virtual
void setMinDepth(const
Float& depth) const noexcept override;
2406 virtual
Float getMaxDepth() const noexcept override;
2409 virtual
void setMaxDepth(const
Float& depth) const noexcept override;
2424 virtual
RectF getRectangle() const noexcept = 0;
2430 virtual
void setRectangle(const
RectF& rectangle) noexcept = 0;
2452 virtual
RectF getRectangle() const noexcept override;
2455 virtual
void setRectangle(const
RectF& rectangle) noexcept override;
2491 virtual const
UInt32& location() const noexcept;
2497 virtual const BufferFormat& format() const noexcept;
2503 virtual const
UInt32& offset() const noexcept;
2513 virtual const AttributeSemantic& semantic() const noexcept;
2523 virtual const
UInt32& semanticIndex() const noexcept;
2541 virtual
size_t elementSize() const noexcept = 0;
2550 virtual const
UInt32& binding() const noexcept = 0;
2556 virtual const BufferType& type() const noexcept = 0;
2588 virtual const IndexType& indexType() const noexcept = 0;
2622 virtual const DescriptorType& descriptorType() const noexcept = 0;
2634 virtual const
UInt32& descriptors() const noexcept = 0;
2645 virtual const
ISampler* staticSampler() const noexcept = 0;
2662 virtual
void map(const
void* const data, const
size_t& size, const
UInt32& element = 0) = 0;
2670 virtual
void map(
Span<const
void* const> data, const
size_t& elementSize, const
UInt32& firstElement = 0) = 0;
2690 virtual const
UInt32& elements() const noexcept = 0;
2705 virtual
size_t size() const noexcept = 0;
2716 virtual
size_t elementSize() const noexcept = 0;
2724 virtual
size_t elementAlignment() const noexcept = 0;
2735 virtual
size_t alignedElementSize() const noexcept = 0;
2744 virtual const
bool& writable() const noexcept = 0;
2752 virtual const ResourceState& state(const
UInt32& subresource = 0) const = 0;
2768 virtual ResourceState& state(const
UInt32& subresource = 0) = 0;
2783 virtual const BufferType& type() const noexcept = 0;
2803 virtual
size_t size(const
UInt32& level) const noexcept = 0;
2820 virtual const Format& format() const noexcept = 0;
2830 virtual const ImageDimensions& dimensions() const noexcept = 0;
2836 virtual const
UInt32& levels() const noexcept = 0;
2842 virtual const
UInt32& layers() const noexcept = 0;
2852 virtual const
UInt32& planes() const noexcept = 0;
2858 virtual const MultiSamplingLevel& samples() const noexcept = 0;
2865 return level + (layer * this->levels()) + (plane * this->levels() * this->layers());
2881 virtual const FilterMode& getMinifyingFilter() const noexcept = 0;
2887 virtual const FilterMode& getMagnifyingFilter() const noexcept = 0;
2893 virtual const BorderMode& getBorderModeU() const noexcept = 0;
2899 virtual const BorderMode& getBorderModeV() const noexcept = 0;
2905 virtual const BorderMode& getBorderModeW() const noexcept = 0;
2914 virtual const
Float& getAnisotropy() const noexcept = 0;
2920 virtual const MipMapMode& getMipMapMode() const noexcept = 0;
2926 virtual const
Float& getMipMapBias() const noexcept = 0;
2932 virtual const
Float& getMaxLOD() const noexcept = 0;
2938 virtual const
Float& getMinLOD() const noexcept = 0;
2954 void transition(
IBuffer& buffer, const ResourceState& targetState) {
2955 this->doTransition(buffer, targetState);
2965 this->doTransition(buffer, element, targetState);
2974 void transition(
IBuffer& buffer,
const ResourceState& sourceState,
const ResourceState& targetState) {
2975 this->doTransition(buffer, sourceState, targetState);
2987 this->doTransition(buffer, sourceState, element, targetState);
2996 this->doTransition(image, targetState);
3008 this->doTransition(image, level, layer, plane, targetState);
3017 void transition(
IImage& image,
const ResourceState& sourceState,
const ResourceState& targetState) {
3018 this->doTransition(image, sourceState, targetState);
3031 this->doTransition(image, sourceState, level, layer, plane, targetState);
3042 this->doWaitFor(buffer);
3053 this->doWaitFor(image);
3057 virtual void doTransition(
IBuffer& buffer,
const ResourceState& targetState) = 0;
3058 virtual void doTransition(
IBuffer& buffer,
const UInt32& element,
const ResourceState& targetState) = 0;
3059 virtual void doTransition(
IBuffer& buffer,
const ResourceState& sourceState,
const ResourceState& targetState) = 0;
3060 virtual void doTransition(
IBuffer& buffer,
const ResourceState& sourceState,
const UInt32& element,
const ResourceState& targetState) = 0;
3061 virtual void doTransition(
IImage& image,
const ResourceState& targetState) = 0;
3062 virtual void doTransition(
IImage& image,
const UInt32& level,
const UInt32& layer,
const UInt32& plane,
const ResourceState& targetState) = 0;
3063 virtual void doTransition(
IImage& image,
const ResourceState& sourceState,
const ResourceState& targetState) = 0;
3064 virtual void doTransition(
IImage& image,
const ResourceState& sourceState,
const UInt32& level,
const UInt32& layer,
const UInt32& plane,
const ResourceState& targetState) = 0;
3065 virtual void doWaitFor(
const IBuffer& buffer) = 0;
3066 virtual void doWaitFor(
const IImage& image) = 0;
3086 this->doUpdate(binding, buffer, bufferElement, elements, firstDescriptor);
3111 this->doUpdate(binding, texture, descriptor, firstLevel, levels, firstLayer, layers);
3121 this->doUpdate(binding, sampler, descriptor);
3130 this->doAttach(binding, image);
3134 virtual void doUpdate(
const UInt32& binding,
const IBuffer& buffer,
const UInt32& bufferElement,
const UInt32& elements,
const UInt32& firstDescriptor)
const = 0;
3136 virtual void doUpdate(
const UInt32& binding,
const ISampler& sampler,
const UInt32& descriptor)
const = 0;
3137 virtual void doAttach(
const UInt32& binding,
const IImage& image)
const = 0;
3153 return this->getDescriptors();
3176 virtual const ShaderStage& shaderStages() const noexcept = 0;
3182 virtual
UInt32 uniforms() const noexcept = 0;
3188 virtual
UInt32 storages() const noexcept = 0;
3207 virtual
UInt32 samplers() const noexcept = 0;
3214 virtual
UInt32 staticSamplers() const noexcept = 0;
3220 virtual
UInt32 inputAttachments() const noexcept = 0;
3250 return this->getDescriptorSet(descriptors);
3261 return this->getDescriptorSets(descriptorSets, descriptors);
3269 this->releaseDescriptorSet(descriptorSet);
3276 virtual
void releaseDescriptorSet(const
IDescriptorSet& descriptorSet) const noexcept = 0;
3291 virtual const
UInt32& space() const noexcept = 0;
3297 virtual const
UInt32& binding() const noexcept = 0;
3304 virtual const
UInt32& offset() const noexcept = 0;
3311 virtual const
UInt32& size() const noexcept = 0;
3317 virtual const ShaderStage& stage() const noexcept = 0;
3332 virtual const
UInt32& size() const noexcept = 0;
3350 return this->getRanges();
3371 return this->getModules();
3399 return this->parsePipelineLayout();
3427 return this->getDescriptorSets();
3483 return this->getVertexBufferLayouts();
3503 virtual const PrimitiveTopology&
topology() const noexcept = 0;
3522 return this->getProgram();
3530 return this->getLayout();
3554 virtual
void begin() const = 0;
3563 virtual
void end() const = 0;
3576 void barrier(const
IBarrier& barrier, const
bool& invert = false) const noexcept {
3577 this->cmdBarrier(barrier, invert);
3594 this->cmdGenerateMipMaps(image);
3607 this->cmdTransfer(source, target, sourceElement, targetElement, elements);
3643 this->cmdTransfer(source, target, sourceElement, firstSubresource, elements);
3656 this->cmdTransfer(source, target, sourceSubresource, targetSubresource, subresources);
3692 this->cmdTransfer(source, target, firstSubresource, targetElement, subresources);
3699 this->cmdUse(pipeline);
3711 this->cmdBind(descriptorSet, pipeline);
3725 this->cmdBind(buffer);
3738 this->cmdBind(buffer);
3764 virtual
void drawIndexed(const
UInt32& indices, const
UInt32& instances = 1, const
UInt32& firstIndex = 0, const
Int32& vertexOffset = 0, const
UInt32& firstInstance = 0) const noexcept = 0;
3772 this->cmdPushConstants(layout, memory);
3786 this->cmdDraw(vertexBuffer, instances, firstVertex, firstInstance);
3801 this->cmdDrawIndexed(indexBuffer, instances, firstIndex, vertexOffset, firstInstance);
3817 this->cmdDrawIndexed(vertexBuffer, indexBuffer, instances, firstIndex, vertexOffset, firstInstance);
3821 virtual void cmdBarrier(
const IBarrier& barrier,
const bool& invert)
const noexcept = 0;
3822 virtual void cmdGenerateMipMaps(
IImage& image)
noexcept = 0;
3823 virtual void cmdTransfer(
const IBuffer& source,
const IBuffer& target,
const UInt32& sourceElement,
const UInt32& targetElement,
const UInt32& elements)
const = 0;
3824 virtual void cmdTransfer(
const IBuffer& source,
const IImage& target,
const UInt32& sourceElement,
const UInt32& firstSubresource,
const UInt32& elements)
const = 0;
3825 virtual void cmdTransfer(
const IImage& source,
const IImage& target,
const UInt32& sourceSubresource,
const UInt32& targetSubresource,
const UInt32& subresources)
const = 0;
3826 virtual void cmdTransfer(
const IImage& source,
const IBuffer& target,
const UInt32& firstSubresource,
const UInt32& targetElement,
const UInt32& subresources)
const = 0;
3827 virtual void cmdUse(
const IPipeline& pipeline)
const noexcept = 0;
3829 virtual void cmdBind(
const IVertexBuffer& buffer)
const noexcept = 0;
3830 virtual void cmdBind(
const IIndexBuffer& buffer)
const noexcept = 0;
3831 virtual void cmdPushConstants(
const IPushConstantsLayout& layout,
const void*
const memory)
const noexcept = 0;
3833 virtual void cmdDrawIndexed(
const IIndexBuffer& indexBuffer,
const UInt32& instances,
const UInt32& firstIndex,
const Int32& vertexOffset,
const UInt32& firstInstance)
const = 0;
3850 return this->getInputAssembler();
3858 return this->getRasterizer();
3880 virtual
UInt32& stencilRef() const noexcept = 0;
3906 virtual const
bool& alphaToCoverage() const noexcept = 0;
3937 virtual const
UInt32& bufferIndex() const noexcept = 0;
3946 virtual const
Size2d& size() const noexcept = 0;
3955 virtual
size_t getWidth() const noexcept = 0;
3964 virtual
size_t getHeight() const noexcept = 0;
3972 return this->getCommandBuffers();
3989 return this->getImages();
4013 virtual
Array<const
IImage*> getImages() const noexcept = 0;
4040 return this->getFrameBuffers();
4049 return this->getPipelines();
4075 virtual
bool hasPresentTarget() const noexcept = 0;
4087 virtual const MultiSamplingLevel& multiSamplingLevel() const noexcept = 0;
4094 virtual
void begin(const
UInt32& buffer) = 0;
4103 virtual
void end() const = 0;
4109 virtual
void resizeFrameBuffers(const
Size2d& renderArea) = 0;
4121 virtual
void changeMultiSamplingLevel(const MultiSamplingLevel& samples) = 0;
4128 this->setAttachments(descriptorSet);
4134 virtual
void setAttachments(const
IDescriptorSet& descriptorSet) const = 0;
4149 virtual const Format& surfaceFormat() const noexcept = 0;
4155 virtual const
UInt32& buffers() const noexcept = 0;
4161 virtual const
Size2d& renderArea() const noexcept = 0;
4168 return this->getImages();
4200 virtual
void reset(const Format& surfaceFormat, const
Size2d& renderArea, const
UInt32& buffers) = 0;
4206 [[nodiscard]] virtual
UInt32 swapBackBuffer() const = 0;
4209 virtual
Array<const
IImage*> getImages() const noexcept = 0;
4230 virtual
bool isBound() const noexcept = 0;
4236 virtual const QueuePriority& priority() const noexcept = 0;
4242 virtual const QueueType& type() const noexcept = 0;
4249 virtual
void bind() = 0;
4254 virtual
void release() = 0;
4262 return this->getCommandBuffer(beginRecording);
4275 return this->submitCommandBuffer(commandBuffer);
4288 return this->submitCommandBuffers(commandBuffers);
4338 UniquePtr<
IBuffer> createBuffer(const BufferType& type, const BufferUsage& usage, const
size_t& elementSize, const
UInt32& elements = 1, const
bool& allowWrite = false)
const {
4339 return this->getBuffer(type, usage, elementSize, elements, allowWrite);
4353 return this->getBuffer(name, type, usage, elementSize, elements, allowWrite);
4369 return this->getVertexBuffer(layout, usage, elements);
4386 return this->getVertexBuffer(name, layout, usage, elements);
4402 return this->getIndexBuffer(layout, usage, elements);
4419 return this->getIndexBuffer(name, layout, usage, elements);
4430 return this->getAttachment(format, size, samples);
4442 return this->getAttachment(name, format, size, samples);
4461 UniquePtr<IImage> createTexture(
const Format& format,
const Size3d& size,
const ImageDimensions& dimension = ImageDimensions::DIM_2,
const UInt32& levels = 1,
const UInt32& layers = 1,
const MultiSamplingLevel& samples = MultiSamplingLevel::x1,
const bool& allowWrite =
false)
const {
4462 return this->getTexture(format, size, dimension, levels, layers, samples, allowWrite);
4482 UniquePtr<IImage> createTexture(
const String& name,
const Format& format,
const Size3d& size,
const ImageDimensions& dimension = ImageDimensions::DIM_2,
const UInt32& levels = 1,
const UInt32& layers = 1,
const MultiSamplingLevel& samples = MultiSamplingLevel::x1,
const bool& allowWrite =
false)
const {
4483 return this->getTexture(name, format, size, dimension, levels, layers, samples, allowWrite);
4500 return this->getTextures(elements, format, size, dimension, layers, levels, samples, allowWrite);
4518 UniquePtr<ISampler> createSampler(
const FilterMode& magFilter = FilterMode::Nearest,
const FilterMode& minFilter = FilterMode::Nearest,
const BorderMode& borderU = BorderMode::Repeat,
const BorderMode& borderV = BorderMode::Repeat,
const BorderMode& borderW = BorderMode::Repeat,
const MipMapMode& mipMapMode = MipMapMode::Nearest,
const Float& mipMapBias = 0.f,
const Float& maxLod = std::numeric_limits<Float>::max(),
const Float& minLod = 0.f,
const Float& anisotropy = 0.f)
const {
4519 return this->getSampler(magFilter, minFilter, borderU, borderV, borderW, mipMapMode, mipMapBias, maxLod, minLod, anisotropy);
4538 UniquePtr<ISampler> createSampler(
const String& name,
const FilterMode& magFilter = FilterMode::Nearest,
const FilterMode& minFilter = FilterMode::Nearest,
const BorderMode& borderU = BorderMode::Repeat,
const BorderMode& borderV = BorderMode::Repeat,
const BorderMode& borderW = BorderMode::Repeat,
const MipMapMode& mipMapMode = MipMapMode::Nearest,
const Float& mipMapBias = 0.f,
const Float& maxLod = std::numeric_limits<Float>::max(),
const Float& minLod = 0.f,
const Float& anisotropy = 0.f)
const {
4539 return this->getSampler(name, magFilter, minFilter, borderU, borderV, borderW, mipMapMode, mipMapBias, maxLod, minLod, anisotropy);
4558 Array<UniquePtr<ISampler>>
createSamplers(
const UInt32& elements,
const FilterMode& magFilter = FilterMode::Nearest,
const FilterMode& minFilter = FilterMode::Nearest,
const BorderMode& borderU = BorderMode::Repeat,
const BorderMode& borderV = BorderMode::Repeat,
const BorderMode& borderW = BorderMode::Repeat,
const MipMapMode& mipMapMode = MipMapMode::Nearest,
const Float& mipMapBias = 0.f,
const Float& maxLod = std::numeric_limits<Float>::max(),
const Float& minLod = 0.f,
const Float& anisotropy = 0.f)
const {
4559 return this->getSamplers(elements, magFilter, minFilter, borderU, borderV, borderW, mipMapMode, mipMapBias, maxLod, minLod, anisotropy);
4563 virtual UniquePtr<IBuffer> getBuffer(
const BufferType& type,
const BufferUsage& usage,
const size_t& elementSize,
const UInt32& elements,
const bool& allowWrite)
const = 0;
4564 virtual UniquePtr<IBuffer> getBuffer(
const String& name,
const BufferType& type,
const BufferUsage& usage,
const size_t& elementSize,
const UInt32& elements,
const bool& allowWrite)
const = 0;
4569 virtual UniquePtr<IImage> getAttachment(
const Format& format,
const Size2d& size,
const MultiSamplingLevel& samples)
const = 0;
4570 virtual UniquePtr<IImage> getAttachment(
const String& name,
const Format& format,
const Size2d& size,
const MultiSamplingLevel& samples)
const = 0;
4571 virtual UniquePtr<IImage> getTexture(
const Format& format,
const Size3d& size,
const ImageDimensions& dimension,
const UInt32& levels,
const UInt32& layers,
const MultiSamplingLevel& samples,
const bool& allowWrite)
const = 0;
4572 virtual UniquePtr<IImage> getTexture(
const String& name,
const Format& format,
const Size3d& size,
const ImageDimensions& dimension,
const UInt32& levels,
const UInt32& layers,
const MultiSamplingLevel& samples,
const bool& allowWrite)
const = 0;
4573 virtual Array<UniquePtr<IImage>> getTextures(
const UInt32& elements,
const Format& format,
const Size3d& size,
const ImageDimensions& dimension,
const UInt32& layers,
const UInt32& levels,
const MultiSamplingLevel& samples,
const bool& allowWrite)
const = 0;
4574 virtual UniquePtr<ISampler> getSampler(
const FilterMode& magFilter,
const FilterMode& minFilter,
const BorderMode& borderU,
const BorderMode& borderV,
const BorderMode& borderW,
const MipMapMode& mipMapMode,
const Float& mipMapBias,
const Float& maxLod,
const Float& minLod,
const Float& anisotropy)
const = 0;
4575 virtual UniquePtr<ISampler> getSampler(
const String& name,
const FilterMode& magFilter,
const FilterMode& minFilter,
const BorderMode& borderU,
const BorderMode& borderV,
const BorderMode& borderW,
const MipMapMode& mipMapMode,
const Float& mipMapBias,
const Float& maxLod,
const Float& minLod,
const Float& anisotropy)
const = 0;
4576 virtual Array<UniquePtr<ISampler>> getSamplers(
const UInt32& elements,
const FilterMode& magFilter,
const FilterMode& minFilter,
const BorderMode& borderU,
const BorderMode& borderV,
const BorderMode& borderW,
const MipMapMode& mipMapMode,
const Float& mipMapBias,
const Float& maxLod,
const Float& minLod,
const Float& anisotropy)
const = 0;
4661 return this->getNewBarrier();
4702 return this->getAdapters();
4738 return this->device(name);
4747 return this->device(name);
Definition: buffer_attribute.cpp:9
Definition: depth_stencil_state.cpp:9
Definition: device_state.cpp:9
The base class for an app backend.
Definition: app.hpp:18
Stores meta data about a buffer attribute, i.e. a member or field of a descriptor or buffer.
Definition: rendering_api.hpp:2461
virtual ~BufferAttribute() noexcept
Stores the depth/stencil state of a see IRasterizer.
Definition: rendering_api.hpp:2066
A class that can be used to manage the state of a IGraphicsDevice.
Definition: rendering_api.hpp:1489
The interface for a memory barrier.
Definition: rendering_api.hpp:2944
void transition(IImage &image, const ResourceState &sourceState, const ResourceState &targetState)
Inserts a transition for all sub-resources of image from sourceState into targetState .
Definition: rendering_api.hpp:3017
void transition(IBuffer &buffer, const ResourceState &sourceState, const UInt32 &element, const ResourceState &targetState)
Inserts a transition for the sub-resource element of buffer from sourceState into targetState .
Definition: rendering_api.hpp:2986
void transition(IImage &image, const UInt32 &level, const UInt32 &layer, const UInt32 &plane, const ResourceState &targetState)
Inserts a transition for a sub-resource of image into targetState .
Definition: rendering_api.hpp:3007
void transition(IImage &image, const ResourceState &targetState)
Inserts a transition for all sub-resources of image into targetState .
Definition: rendering_api.hpp:2995
void waitFor(const IImage &image)
Inserts a barrier that waits for all read/write accesses to image to be finished before continuing.
Definition: rendering_api.hpp:3052
virtual ~IBarrier() noexcept=default
void transition(IBuffer &buffer, const ResourceState &sourceState, const ResourceState &targetState)
Inserts a transition for all sub-resources of buffer from sourceState into targetState .
Definition: rendering_api.hpp:2974
void transition(IImage &image, const ResourceState &sourceState, const UInt32 &level, const UInt32 &layer, const UInt32 &plane, const ResourceState &targetState)
Inserts a transition for a sub-resource of image from sourceState into targetState .
Definition: rendering_api.hpp:3030
void waitFor(const IBuffer &buffer)
Inserts a barrier that waits for all read/write accesses to buffer to be finished before continuing.
Definition: rendering_api.hpp:3041
void transition(IBuffer &buffer, const UInt32 &element, const ResourceState &targetState)
Inserts a transition for the sub-resource element of buffer into targetState .
Definition: rendering_api.hpp:2964
Base interface for buffer objects.
Definition: rendering_api.hpp:2774
virtual ~IBuffer() noexcept=default
Describes a buffer layout.
Definition: rendering_api.hpp:2532
virtual ~IBufferLayout() noexcept=default
The interface for a command buffer.
Definition: rendering_api.hpp:3541
void transfer(const IImage &source, const IBuffer &target, const UInt32 &firstSubresource=0, const UInt32 &targetElement=0, const UInt32 &subresources=1) const
Performs an image-to-buffer transfer from source to target .
Definition: rendering_api.hpp:3691
void bind(const IDescriptorSet &descriptorSet, const IPipeline &pipeline) const noexcept
Binds the provided descriptor set to the provided pipeline.
Definition: rendering_api.hpp:3710
void drawIndexed(const IIndexBuffer &indexBuffer, const UInt32 &instances=1, const UInt32 &firstIndex=0, const Int32 &vertexOffset=0, const UInt32 &firstInstance=0) const
Draws the currently bound vertex buffer using the index buffer provided in indexBuffer .
Definition: rendering_api.hpp:3800
void transfer(const IImage &source, const IImage &target, const UInt32 &sourceSubresource=0, const UInt32 &targetSubresource=0, const UInt32 &subresources=1) const
Performs an image-to-image transfer from source to target .
Definition: rendering_api.hpp:3655
void draw(const IVertexBuffer &vertexBuffer, const UInt32 &instances=1, const UInt32 &firstVertex=0, const UInt32 &firstInstance=0) const
Draws all vertices from the vertex buffer provided in vertexBuffer .
Definition: rendering_api.hpp:3785
void drawIndexed(const IVertexBuffer &vertexBuffer, const IIndexBuffer &indexBuffer, const UInt32 &instances=1, const UInt32 &firstIndex=0, const Int32 &vertexOffset=0, const UInt32 &firstInstance=0) const
Draws the vertex buffer provided by vertexBuffer using the index buffer, provided by indexBuffer .
Definition: rendering_api.hpp:3816
void transfer(const IBuffer &source, const IBuffer &target, const UInt32 &sourceElement=0, const UInt32 &targetElement=0, const UInt32 &elements=1) const
Performs a buffer-to-buffer transfer from source to target .
Definition: rendering_api.hpp:3606
void bind(const IIndexBuffer &buffer) const noexcept
Binds a index buffer to the pipeline.
Definition: rendering_api.hpp:3737
void use(const IPipeline &pipeline) const noexcept
Sets the active pipeline state.
Definition: rendering_api.hpp:3698
void generateMipMaps(IImage &image) noexcept
Uses the image at level 0 to generate mip-maps for the remaining levels.
Definition: rendering_api.hpp:3593
virtual void dispatch(const Vector3u &threadCount) const noexcept=0
Executes a compute shader.
virtual void draw(const UInt32 &vertices, const UInt32 &instances=1, const UInt32 &firstVertex=0, const UInt32 &firstInstance=0) const noexcept=0
Draws a number of vertices from the currently bound vertex buffer.
virtual ~ICommandBuffer() noexcept=default
void bind(const IVertexBuffer &buffer) const noexcept
Binds a vertex buffer to the pipeline.
Definition: rendering_api.hpp:3724
void transfer(const IBuffer &source, const IImage &target, const UInt32 &sourceElement=0, const UInt32 &firstSubresource=0, const UInt32 &elements=1) const
Performs a buffer-to-image transfer from source to target .
Definition: rendering_api.hpp:3642
The interface for a command queue.
Definition: rendering_api.hpp:4215
virtual ~ICommandQueue() noexcept=default
virtual UInt64 currentFence() const noexcept=0
Returns the value of the latest fence inserted into the queue.
UInt64 submit(const ICommandBuffer &commandBuffer) const
Submits a single command buffer and inserts a fence to wait for it.
Definition: rendering_api.hpp:4274
UInt64 submit(const Array< const ICommandBuffer * > &commandBuffers) const
Submits a set of command buffers and inserts a fence to wait for them.
Definition: rendering_api.hpp:4287
virtual void waitFor(const UInt64 &fence) const noexcept=0
Waits for a certain fence value to complete on the command queue.
The interface for a compute pipeline.
Definition: rendering_api.hpp:3916
virtual ~IComputePipeline() noexcept=default
Describes a the layout of a single descriptor within a DescriptorSet.
Definition: rendering_api.hpp:2613
virtual ~IDescriptorLayout() noexcept=default
The interface for a descriptor set.
Definition: rendering_api.hpp:3072
void attach(const UInt32 &binding, const IImage &image) const
Attaches an image as an input attachment to a descriptor bound at .
Definition: rendering_api.hpp:3129
void update(const UInt32 &binding, const IImage &texture, const UInt32 &descriptor=0, const UInt32 &firstLevel=0, const UInt32 &levels=0, const UInt32 &firstLayer=0, const UInt32 &layers=0) const
Updates a texture within the current descriptor set.
Definition: rendering_api.hpp:3110
void update(const UInt32 &binding, const ISampler &sampler, const UInt32 &descriptor=0) const
Updates a sampler within the current descriptor set.
Definition: rendering_api.hpp:3120
virtual ~IDescriptorSet() noexcept=default
The interface for a descriptor set layout.
Definition: rendering_api.hpp:3143
virtual ~IDescriptorSetLayout() noexcept=default
Array< UniquePtr< IDescriptorSet > > allocateMultiple(const UInt32 &descriptorSets, const UInt32 &descriptors=0) const
Allocates an array of descriptor sets.
Definition: rendering_api.hpp:3260
void free(const IDescriptorSet &descriptorSet) const noexcept
Marks a descriptor set as unused, so that it can be handed out again instead of allocating a new one.
Definition: rendering_api.hpp:3268
virtual const UInt32 & space() const noexcept=0
Returns the space index of the descriptor set.
virtual const IDescriptorLayout & descriptor(const UInt32 &binding) const =0
Returns the descriptor layout for the descriptor bound to the binding point provided with binding .
Describes a chunk of device memory.
Definition: rendering_api.hpp:2676
virtual ~IDeviceMemory() noexcept=default
The interface for a frame buffer.
Definition: rendering_api.hpp:3924
virtual void resize(const Size2d &renderArea)=0
Causes the frame buffer to be invalidated and recreated with a new size.
virtual const ICommandBuffer & commandBuffer(const UInt32 &index) const =0
Returns a command buffer that records draw commands for the frame buffer.
virtual const IImage & image(const UInt32 &location) const =0
Returns the image that stores the output attachment for the render target mapped the location passed ...
Array< const IImage * > images() const noexcept
Returns the images that store the output attachments for the render targets of the RenderPass.
Definition: rendering_api.hpp:3988
virtual ~IFrameBuffer() noexcept=default
Represents a physical graphics adapter.
Definition: rendering_api.hpp:1754
virtual ~IGraphicsAdapter() noexcept=default
The interface for a graphics device that.
Definition: rendering_api.hpp:4582
virtual MultiSamplingLevel maximumMultiSamplingLevel(const Format &format) const noexcept=0
Queries the device for the maximum supported number of multi-sampling levels.
virtual ~IGraphicsDevice() noexcept=default
virtual void wait() const =0
Waits until the device is idle.
The interface for a graphics factory.
Definition: rendering_api.hpp:4324
Array< UniquePtr< IImage > > createTextures(const UInt32 &elements, const Format &format, const Size3d &size, const ImageDimensions &dimension=ImageDimensions::DIM_2, const UInt32 &layers=1, const UInt32 &levels=1, const MultiSamplingLevel &samples=MultiSamplingLevel::x1, const bool &allowWrite=false) const
Creates an array of textures, based on the layout .
Definition: rendering_api.hpp:4499
UniquePtr< IBuffer > createBuffer(const String &name, const BufferType &type, const BufferUsage &usage, const size_t &elementSize, const UInt32 &elements=1, const bool &allowWrite=false) const
Creates a buffer of type type .
Definition: rendering_api.hpp:4352
UniquePtr< IImage > createTexture(const Format &format, const Size3d &size, const ImageDimensions &dimension=ImageDimensions::DIM_2, const UInt32 &levels=1, const UInt32 &layers=1, const MultiSamplingLevel &samples=MultiSamplingLevel::x1, const bool &allowWrite=false) const
Creates a texture, based on the layout .
Definition: rendering_api.hpp:4461
UniquePtr< IVertexBuffer > createVertexBuffer(const IVertexBufferLayout &layout, const BufferUsage &usage, const UInt32 &elements=1) const
Creates a vertex buffer, based on the layout
Definition: rendering_api.hpp:4368
virtual ~IGraphicsFactory() noexcept=default
UniquePtr< ISampler > createSampler(const String &name, const FilterMode &magFilter=FilterMode::Nearest, const FilterMode &minFilter=FilterMode::Nearest, const BorderMode &borderU=BorderMode::Repeat, const BorderMode &borderV=BorderMode::Repeat, const BorderMode &borderW=BorderMode::Repeat, const MipMapMode &mipMapMode=MipMapMode::Nearest, const Float &mipMapBias=0.f, const Float &maxLod=std::numeric_limits< Float >::max(), const Float &minLod=0.f, const Float &anisotropy=0.f) const
Creates a texture sampler, based on the layout .
Definition: rendering_api.hpp:4538
UniquePtr< IIndexBuffer > createIndexBuffer(const String &name, const IIndexBufferLayout &layout, const BufferUsage &usage, const UInt32 &elements) const
Creates an index buffer, based on the layout .
Definition: rendering_api.hpp:4418
UniquePtr< IImage > createAttachment(const String &name, const Format &format, const Size2d &size, const MultiSamplingLevel &samples=MultiSamplingLevel::x1) const
Creates an image that is used as render target attachment.
Definition: rendering_api.hpp:4441
Array< UniquePtr< ISampler > > createSamplers(const UInt32 &elements, const FilterMode &magFilter=FilterMode::Nearest, const FilterMode &minFilter=FilterMode::Nearest, const BorderMode &borderU=BorderMode::Repeat, const BorderMode &borderV=BorderMode::Repeat, const BorderMode &borderW=BorderMode::Repeat, const MipMapMode &mipMapMode=MipMapMode::Nearest, const Float &mipMapBias=0.f, const Float &maxLod=std::numeric_limits< Float >::max(), const Float &minLod=0.f, const Float &anisotropy=0.f) const
Creates an array of texture samplers, based on the layout .
Definition: rendering_api.hpp:4558
UniquePtr< IImage > createTexture(const String &name, const Format &format, const Size3d &size, const ImageDimensions &dimension=ImageDimensions::DIM_2, const UInt32 &levels=1, const UInt32 &layers=1, const MultiSamplingLevel &samples=MultiSamplingLevel::x1, const bool &allowWrite=false) const
Creates a texture, based on the layout .
Definition: rendering_api.hpp:4482
UniquePtr< IVertexBuffer > createVertexBuffer(const String &name, const IVertexBufferLayout &layout, const BufferUsage &usage, const UInt32 &elements=1) const
Creates a vertex buffer, based on the layout
Definition: rendering_api.hpp:4385
UniquePtr< ISampler > createSampler(const FilterMode &magFilter=FilterMode::Nearest, const FilterMode &minFilter=FilterMode::Nearest, const BorderMode &borderU=BorderMode::Repeat, const BorderMode &borderV=BorderMode::Repeat, const BorderMode &borderW=BorderMode::Repeat, const MipMapMode &mipMapMode=MipMapMode::Nearest, const Float &mipMapBias=0.f, const Float &maxLod=std::numeric_limits< Float >::max(), const Float &minLod=0.f, const Float &anisotropy=0.f) const
Creates a texture sampler, based on the layout .
Definition: rendering_api.hpp:4518
UniquePtr< IImage > createAttachment(const Format &format, const Size2d &size, const MultiSamplingLevel &samples=MultiSamplingLevel::x1) const
Creates an image that is used as render target attachment.
Definition: rendering_api.hpp:4429
UniquePtr< IIndexBuffer > createIndexBuffer(const IIndexBufferLayout &layout, const BufferUsage &usage, const UInt32 &elements) const
Creates an index buffer, based on the layout .
Definition: rendering_api.hpp:4401
Describes a generic image.
Definition: rendering_api.hpp:2789
virtual ~IImage() noexcept=default
The interface for an index buffer.
Definition: rendering_api.hpp:3458
virtual ~IIndexBuffer() noexcept=default
Describes a index buffer layout.
Definition: rendering_api.hpp:2579
virtual ~IIndexBufferLayout() noexcept=default
Allows for data to be mapped into the object.
Definition: rendering_api.hpp:2651
virtual ~IMappable() noexcept=default
The interface for a pipeline.
Definition: rendering_api.hpp:3512
virtual ~IPipeline() noexcept=default
SharedPtr< const IPipelineLayout > layout() const noexcept
Returns the layout of the render pipeline.
Definition: rendering_api.hpp:3529
The interface for a pipeline layout.
Definition: rendering_api.hpp:3410
virtual const IPushConstantsLayout * pushConstants() const noexcept=0
Returns the push constants layout, or nullptr, if the pipeline does not use any push constants.
virtual ~IPipelineLayout() noexcept=default
The interface for a push constants layout.
Definition: rendering_api.hpp:3323
virtual ~IPushConstantsLayout() noexcept=default
Describes a range within a IPushConstantsLayout.
Definition: rendering_api.hpp:3282
virtual ~IPushConstantsRange() noexcept=default
Represents the rasterizer state of a RenderPipeline.
Definition: rendering_api.hpp:2244
virtual ~IRasterizer() noexcept=default
The interface to access a render backend.
Definition: rendering_api.hpp:4692
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:4737
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 ~IRenderBackend() noexcept=default
virtual const IGraphicsAdapter * findAdapter(const Optional< UInt64 > &adapterId=std::nullopt) const =0
Finds an adapter using its unique ID.
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:4746
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...
The interface for a render pass.
Definition: rendering_api.hpp:4019
virtual ~IRenderPass() noexcept=default
virtual Span< const RenderTarget > renderTargets() const noexcept=0
Returns the list of render targets, the render pass renders into.
virtual const RenderTarget & renderTarget(const UInt32 &location) const =0
Returns the render target mapped to the location provided by location .
Array< const IRenderPipeline * > pipelines() const noexcept
Returns an array of all render pipelines, owned by the render pass.
Definition: rendering_api.hpp:4048
The interface for a render pipeline.
Definition: rendering_api.hpp:3840
SharedPtr< IRasterizer > rasterizer() const noexcept
Returns the rasterizer state used by the render pipeline.
Definition: rendering_api.hpp:3857
virtual Array< const IViewport * > viewports() const noexcept=0
Returns the viewports, the render pipeline can draw to.
virtual ~IRenderPipeline() noexcept=default
Represents a render target, i.e. an abstract view of the output of an RenderPass.
Definition: rendering_api.hpp:1862
virtual ~IRenderTarget() noexcept=default
Describes a texture sampler.
Definition: rendering_api.hpp:2872
virtual ~ISampler() noexcept=default
The interface of a scissor.
Definition: rendering_api.hpp:2415
virtual ~IScissor() noexcept=default
Represents a single shader module, i.e. a part of a IShaderProgram.
Definition: rendering_api.hpp:1827
virtual ~IShaderModule() noexcept=default
The interface for a shader program.
Definition: rendering_api.hpp:3361
virtual ~IShaderProgram() noexcept=default
SharedPtr< IPipelineLayout > reflectPipelineLayout() const
Uses shader reflection to extract the pipeline layout of a shader. May not be available in all backen...
Definition: rendering_api.hpp:3398
The interface for a state resource.
Definition: rendering_api.hpp:1438
virtual ~IStateResource() noexcept=default
Represents a surface to render to.
Definition: rendering_api.hpp:1815
virtual ~ISurface() noexcept=default
Interface for a swap chain.
Definition: rendering_api.hpp:4140
virtual void present(const IFrameBuffer &frameBuffer) const =0
Queues a present that gets executed after frameBuffer signals its readiness.
virtual Array< Format > getSurfaceFormats() const noexcept=0
Returns an array of supported formats, that can be drawn to the surface.
virtual ~ISwapChain() noexcept=default
The interface for a vertex buffer.
Definition: rendering_api.hpp:3443
virtual ~IVertexBuffer() noexcept=default
Describes a vertex buffer layout.
Definition: rendering_api.hpp:2563
virtual ~IVertexBufferLayout() noexcept=default
Interface for a viewport.
Definition: rendering_api.hpp:2331
virtual ~IViewport() noexcept=default
Implements a IRasterizer.
Definition: rendering_api.hpp:2287
virtual ~Rasterizer() noexcept
Implements a render target.
Definition: rendering_api.hpp:1994
virtual ~RenderTarget() noexcept
Implements a scissor.
Definition: rendering_api.hpp:2436
Scissor(Scissor &&) noexcept=delete
Base class for a resource that can be identified by a name string within a DeviceState.
Definition: rendering_api.hpp:1453
StateResource(const StateResource &)=delete
virtual ~StateResource() noexcept
StateResource(StateResource &&)=delete
Implements a viewport.
Definition: rendering_api.hpp:2376
Viewport(Viewport &&) noexcept=delete
Implements the IResource interface.
Definition: containers.hpp:371
Definition: rasterizer.cpp:9
Definition: render_target.cpp:9
Definition: scissor.cpp:9
Definition: state_resource.cpp:9
Definition: viewport.cpp:9
uint32_t UInt32
Definition: math.hpp:37
uint16_t UInt16
Definition: math.hpp:35
float_t Float
Definition: math.hpp:40
uint64_t UInt64
Definition: math.hpp:39
int32_t Int32
Definition: math.hpp:36
uint8_t Byte
Definition: math.hpp:33
UInt32 getBufferFormatChannels(const BufferFormat &format)
Returns the number of channels for a buffer format.
Definition: rendering_api.hpp:1398
LITEFX_DEFINE_FLAGS(QueueType)
bool LITEFX_RENDERING_API hasStencil(const Format &format)
Returns true, if the format contains a stencil channel.
Definition: convert.cpp:187
bool LITEFX_RENDERING_API hasDepth(const Format &format)
Returns true, if the format contains a depth channel.
Definition: convert.cpp:173
size_t LITEFX_RENDERING_API getSize(const Format &format)
Returns the size of an element of a specified format.
Definition: convert.cpp:6
UInt32 getBufferFormatChannelSize(const BufferFormat &format)
Returns the number of bytes used by a channel of a buffer format.
Definition: rendering_api.hpp:1406
UInt32 getBufferFormatType(const BufferFormat &format)
Returns the underlying data type of a buffer format.
Definition: rendering_api.hpp:1414
std::string String
Definition: string.hpp:19
std::vector< T > Array
Represents a dynamic array.
Definition: containers.hpp:58
std::span< T > Span
Represents a view of an array.
Definition: containers.hpp:72
std::shared_ptr< T > SharedPtr
Represents a shared pointer, that expresses non-exclusive ownership.
Definition: containers.hpp:94
std::unique_ptr< T, TDeleter > UniquePtr
Represents a unique pointer, that expresses exclusive ownership.
Definition: containers.hpp:87
std::string_view StringView
Definition: string.hpp:21
std::optional< T > Optional
Represents an optional value.
Definition: containers.hpp:79
Definition: graphics.hpp:11
Describes the rasterizer depth bias.
Definition: rendering_api.hpp:2100
Describes the rasterizer depth state.
Definition: rendering_api.hpp:2073
Describes the rasterizer stencil state.
Definition: rendering_api.hpp:2152
Describes a stencil test for either front or back faces.
Definition: rendering_api.hpp:2126
Describes the blend state of the render target.
Definition: rendering_api.hpp:1867