3#include "rendering_api.hpp"
8struct LITEFX_RENDERING_API std::formatter<GraphicsAdapterType> : std::formatter<std::string_view> {
10 string_view name =
"Invalid";
13 case CPU: name =
"CPU";
break;
14 case GPU: name =
"GPU";
break;
15 case Other: name =
"Other";
break;
16 case None: name =
"None";
break;
18 return formatter<string_view>::format(name, ctx);
23struct LITEFX_RENDERING_API std::formatter<QueueType> : std::formatter<std::string_view> {
27 if (t == QueueType::None)
28 names.emplace_back(
"None");
29 else if(LITEFX_FLAG_IS_SET(t, QueueType::Other))
30 names.emplace_back(
"Other");
33 if ((t & QueueType::Compute) == QueueType::Compute)
34 names.emplace_back(
"Compute");
35 if ((t & QueueType::Graphics) == QueueType::Graphics)
36 names.emplace_back(
"Graphics");
37 if ((t & QueueType::Transfer) == QueueType::Transfer)
38 names.emplace_back(
"Transfer");
42 return formatter<string_view>::format(name, ctx);
47struct LITEFX_RENDERING_API std::formatter<QueuePriority> : std::formatter<std::string_view> {
54 case Normal: name =
"Normal";
break;
55 case High: name =
"High";
break;
56 case Realtime: name =
"Realtime";
break;
59 return formatter<string_view>::format(name, ctx);
64struct LITEFX_RENDERING_API std::formatter<Format> : std::formatter<std::string_view> {
66 string_view name =
"Invalid";
77 case R8_UNORM: name =
"R8_UNORM";
break;
78 case R8_SNORM: name =
"R8_SNORM";
break;
81 case R8_UINT: name =
"R8_UINT";
break;
82 case R8_SINT: name =
"R8_SINT";
break;
83 case R8_SRGB: name =
"R8_SRGB";
break;
88 case R8G8_UINT: name =
"R8G8_UINT";
break;
89 case R8G8_SINT: name =
"R8G8_SINT";
break;
90 case R8G8_SRGB: name =
"R8G8_SRGB";
break;
138 case R16_UNORM: name =
"R16_UNORM";
break;
139 case R16_SNORM: name =
"R16_SNORM";
break;
142 case R16_UINT: name =
"R16_UINT";
break;
143 case R16_SINT: name =
"R16_SINT";
break;
166 case R32_UINT: name =
"R32_UINT";
break;
167 case R32_SINT: name =
"R32_SINT";
break;
178 case R64_UINT: name =
"R64_UINT";
break;
179 case R64_SINT: name =
"R64_SINT";
break;
192 case D16_UNORM: name =
"D16_UNORM";
break;
195 case S8_UINT: name =
"S8_UINT";
break;
203 case BC2_UNORM: name =
"BC2_UNORM";
break;
204 case BC2_SRGB: name =
"BC2_SRGB";
break;
205 case BC3_UNORM: name =
"BC3_UNORM";
break;
206 case BC3_SRGB: name =
"BC3_SRGB";
break;
207 case BC4_UNORM: name =
"BC4_UNORM";
break;
208 case BC4_SNORM: name =
"BC4_SNORM";
break;
209 case BC5_UNORM: name =
"BC5_UNORM";
break;
210 case BC5_SNORM: name =
"BC5_SNORM";
break;
213 case BC7_UNORM: name =
"BC7_UNORM";
break;
214 case BC7_SRGB: name =
"BC7_SRGB";
break;
215 case None: name =
"None";
break;
216 case Other: name =
"Other";
break;
218 return formatter<string_view>::format(name, ctx);
223struct LITEFX_RENDERING_API std::formatter<DescriptorType> : std::formatter<std::string_view> {
225 string_view name =
"Invalid";
228 case Sampler: name =
"Sampler";
break;
232 case Texture: name =
"Texture";
break;
233 case RWTexture: name =
"RWTexture";
break;
234 case Buffer: name =
"Buffer";
break;
235 case RWBuffer: name =
"RWBuffer";
break;
243 return formatter<string_view>::format(name, ctx);
248struct LITEFX_RENDERING_API std::formatter<DescriptorHeapType> : std::formatter<std::string_view> {
250 string_view name =
"Invalid";
253 case Sampler: name =
"Sampler";
break;
254 case Resource: name =
"Resource";
break;
255 case None: name =
"None";
break;
257 return formatter<string_view>::format(name, ctx);
262struct LITEFX_RENDERING_API std::formatter<BufferType> : std::formatter<std::string_view> {
264 string_view name =
"Invalid";
267 case Index: name =
"Index";
break;
268 case Vertex: name =
"Vertex";
break;
269 case Uniform: name =
"Uniform";
break;
270 case Storage: name =
"Storage";
break;
271 case Texel: name =
"Texel";
break;
274 case Indirect: name =
"Indirect";
break;
275 case Other: name =
"Other";
break;
277 return formatter<string_view>::format(name, ctx);
282struct LITEFX_RENDERING_API std::formatter<ResourceUsage> : std::formatter<std::string_view> {
286 if (t == ResourceUsage::None)
287 names.emplace_back(
"None");
288 else if (t == ResourceUsage::Default)
289 names.emplace_back(
"Default");
292 if ((t & ResourceUsage::AllowWrite) == ResourceUsage::AllowWrite)
293 names.emplace_back(
"AllowWrite");
294 if ((t & ResourceUsage::TransferSource) == ResourceUsage::TransferSource)
295 names.emplace_back(
"TransferSource");
296 if ((t & ResourceUsage::TransferDestination) == ResourceUsage::TransferDestination)
297 names.emplace_back(
"TransferDestination");
298 if ((t & ResourceUsage::AccelerationStructureBuildInput) == ResourceUsage::AccelerationStructureBuildInput)
299 names.emplace_back(
"AccelerationStructureBuildInput");
303 return formatter<string_view>::format(name, ctx);
308struct LITEFX_RENDERING_API std::formatter<ResourceHeap> : std::formatter<std::string_view> {
310 string_view name =
"Invalid";
313 case Staging: name =
"Staging";
break;
314 case Resource: name =
"Resource";
break;
315 case Dynamic: name =
"Dynamic";
break;
316 case Readback: name =
"Readback";
break;
317 case GPUUpload: name =
"GPUUpload";
break;
319 return formatter<string_view>::format(name, ctx);
324struct LITEFX_RENDERING_API std::formatter<IndexType> : std::formatter<std::string_view> {
326 string_view name =
"Invalid";
329 case UInt16: name =
"UInt16";
break;
330 case UInt32: name =
"UInt32";
break;
332 return formatter<string_view>::format(name, ctx);
337struct LITEFX_RENDERING_API std::formatter<LiteFX::Rendering::PrimitiveTopology> : std::formatter<std::string_view> {
339 string_view name =
"Invalid";
342 case PointList: name =
"PointList";
break;
343 case LineList: name =
"LineList";
break;
345 case LineStrip: name =
"LineStrip";
break;
348 return formatter<string_view>::format(name, ctx);
353struct LITEFX_RENDERING_API std::formatter<ShaderStage> : std::formatter<std::string_view> {
357 if (t == ShaderStage::Other)
358 names.emplace_back(
"Other");
359 else if (t == ShaderStage::MeshPipeline)
360 names.emplace_back(
"Mesh Shading");
361 if (t == ShaderStage::RayTracingPipeline)
362 names.emplace_back(
"Ray Tracing");
365 if ((t & ShaderStage::Vertex) == ShaderStage::Vertex)
366 names.emplace_back(
"Vertex");
367 if ((t & ShaderStage::TessellationControl) == ShaderStage::TessellationControl)
368 names.emplace_back(
"Tessellation Control");
369 if ((t & ShaderStage::TessellationEvaluation) == ShaderStage::TessellationEvaluation)
370 names.emplace_back(
"Tessellation Evaluation");
371 if ((t & ShaderStage::Geometry) == ShaderStage::Geometry)
372 names.emplace_back(
"Geometry");
373 if ((t & ShaderStage::Fragment) == ShaderStage::Fragment)
374 names.emplace_back(
"Fragment");
375 if ((t & ShaderStage::Compute) == ShaderStage::Compute)
376 names.emplace_back(
"Compute");
377 if ((t & ShaderStage::Mesh) == ShaderStage::Mesh)
378 names.emplace_back(
"Mesh");
379 if ((t & ShaderStage::Task) == ShaderStage::Task)
380 names.emplace_back(
"Task");
381 if ((t & ShaderStage::RayGeneration) == ShaderStage::RayGeneration)
382 names.emplace_back(
"Ray Generation");
383 if ((t & ShaderStage::AnyHit) == ShaderStage::AnyHit)
384 names.emplace_back(
"Any Hit");
385 if ((t & ShaderStage::ClosestHit) == ShaderStage::ClosestHit)
386 names.emplace_back(
"Closest Hit");
387 if ((t & ShaderStage::Intersection) == ShaderStage::Intersection)
388 names.emplace_back(
"Intersection");
389 if ((t & ShaderStage::Miss) == ShaderStage::Miss)
390 names.emplace_back(
"Miss");
391 if ((t & ShaderStage::Callable) == ShaderStage::Callable)
392 names.emplace_back(
"Callable");
396 return formatter<string_view>::format(name, ctx);
401struct LITEFX_RENDERING_API std::formatter<BufferFormat> : std::formatter<std::string_view> {
409 names.emplace_back(
"X");
412 names.emplace_back(
"XY");
415 names.emplace_back(
"XYZ");
418 names.emplace_back(
"XYZW");
421 return formatter<string_view>::format(
"Invalid", ctx);
427 names.emplace_back(
"8");
430 names.emplace_back(
"16");
433 names.emplace_back(
"32");
436 names.emplace_back(
"64");
439 return formatter<string_view>::format(
"Invalid", ctx);
445 names.emplace_back(
"F");
448 names.emplace_back(
"I");
451 names.emplace_back(
"S");
454 return formatter<string_view>::format(
"Invalid", ctx);
459 return formatter<string_view>::format(name, ctx);
464struct LITEFX_RENDERING_API std::formatter<PolygonMode> : std::formatter<std::string_view> {
470 case Solid: name =
"Solid";
break;
471 case Wireframe: name =
"Wireframe";
break;
472 case Point: name =
"Point";
break;
473 default: name =
"Invalid";
break;
476 return formatter<string_view>::format(name, ctx);
481struct LITEFX_RENDERING_API std::formatter<CullMode> : std::formatter<std::string_view> {
488 case BackFaces: name =
"BackFaces";
break;
489 case Both: name =
"Both";
break;
490 case Disabled: name =
"Disabled";
break;
491 default: name =
"Invalid";
break;
494 return formatter<string_view>::format(name, ctx);
499struct LITEFX_RENDERING_API std::formatter<CullOrder> : std::formatter<std::string_view> {
505 case ClockWise: name =
"ClockWise";
break;
507 default: name =
"Invalid";
break;
510 return formatter<string_view>::format(name, ctx);
515struct LITEFX_RENDERING_API std::formatter<RenderTargetType> : std::formatter<std::string_view> {
521 case Color: name =
"Color";
break;
523 case Present: name =
"Present";
break;
524 default: name =
"Invalid";
break;
527 return formatter<string_view>::format(name, ctx);
532struct LITEFX_RENDERING_API std::formatter<MultiSamplingLevel> : std::formatter<std::string_view> {
538 case x1: name =
"1";
break;
539 case x2: name =
"2";
break;
540 case x4: name =
"4";
break;
541 case x8: name =
"8";
break;
542 case x16: name =
"16";
break;
543 case x32: name =
"32";
break;
544 case x64: name =
"64";
break;
545 default: name =
"Invalid";
break;
548 return formatter<string_view>::format(name, ctx);
553struct LITEFX_RENDERING_API std::formatter<FilterMode> : std::formatter<std::string_view> {
559 case Nearest: name =
"Nearest";
break;
560 case Linear: name =
"Linear";
break;
561 default: name =
"Invalid";
break;
564 return formatter<string_view>::format(name, ctx);
569struct LITEFX_RENDERING_API std::formatter<MipMapMode> : std::formatter<std::string_view> {
575 case Nearest: name =
"Nearest";
break;
576 case Linear: name =
"Linear";
break;
577 default: name =
"Invalid";
break;
580 return formatter<string_view>::format(name, ctx);
585struct LITEFX_RENDERING_API std::formatter<BorderMode> : std::formatter<std::string_view> {
591 case Repeat: name =
"Repeat";
break;
596 default: name =
"Invalid";
break;
599 return formatter<string_view>::format(name, ctx);
604struct LITEFX_RENDERING_API std::formatter<AttributeSemantic> : std::formatter<std::string_view> {
610 case Binormal: name =
"Binormal";
break;
613 case Color: name =
"Color";
break;
614 case Normal: name =
"Normal";
break;
615 case Position: name =
"Position";
break;
617 case PointSize: name =
"PointSize";
break;
618 case Tangent: name =
"Tangent";
break;
620 case Arbitrary: name =
"Arbitrary";
break;
621 default: name =
"Unknown";
break;
624 return formatter<string_view>::format(name, ctx);
629struct LITEFX_RENDERING_API std::formatter<GeometryFlags> : std::formatter<std::string_view> {
633 if (t == GeometryFlags::None)
634 names.emplace_back(
"None");
637 if ((t & GeometryFlags::Opaque) == GeometryFlags::Opaque)
638 names.emplace_back(
"Opaque");
639 if ((t & GeometryFlags::OneShotAnyHit) == GeometryFlags::OneShotAnyHit)
640 names.emplace_back(
"OneShotAnyHit");
644 return formatter<string_view>::format(name, ctx);
649struct LITEFX_RENDERING_API std::formatter<AccelerationStructureFlags> : std::formatter<std::string_view> {
653 if (t == AccelerationStructureFlags::None)
654 names.emplace_back(
"None");
657 if ((t & AccelerationStructureFlags::AllowUpdate) == AccelerationStructureFlags::AllowUpdate)
658 names.emplace_back(
"AllowUpdate");
659 if ((t & AccelerationStructureFlags::AllowCompaction) == AccelerationStructureFlags::AllowCompaction)
660 names.emplace_back(
"AllowCompaction");
661 if ((t & AccelerationStructureFlags::PreferFastTrace) == AccelerationStructureFlags::AllowCompaction)
662 names.emplace_back(
"PreferFastTrace");
663 if ((t & AccelerationStructureFlags::PreferFastBuild) == AccelerationStructureFlags::PreferFastBuild)
664 names.emplace_back(
"PreferFastBuild");
665 if ((t & AccelerationStructureFlags::MinimizeMemory) == AccelerationStructureFlags::MinimizeMemory)
666 names.emplace_back(
"MinimizeMemory");
670 return formatter<string_view>::format(name, ctx);
675struct LITEFX_RENDERING_API std::formatter<InstanceFlags> : std::formatter<std::string_view> {
679 if (t == InstanceFlags::None)
680 names.emplace_back(
"None");
683 if ((t & InstanceFlags::DisableCull) == InstanceFlags::DisableCull)
684 names.emplace_back(
"DisableCull");
685 if ((t & InstanceFlags::FlipWinding) == InstanceFlags::FlipWinding)
686 names.emplace_back(
"FlipWinding");
687 if ((t & InstanceFlags::ForceOpaque) == InstanceFlags::ForceOpaque)
688 names.emplace_back(
"ForceOpaque");
689 if ((t & InstanceFlags::ForceNonOpaque) == InstanceFlags::ForceNonOpaque)
690 names.emplace_back(
"ForceNonOpaque");
694 return formatter<string_view>::format(name, ctx);
uint16_t UInt16
A type for an unsigned 16 bit integer.
Definition math.hpp:51
uint32_t UInt32
A type for an unsigned 32 bit integer.
Definition math.hpp:61
BorderMode
Describes how to treat texture coordinates that are outside the domain [0..1].
Definition rendering_api.hpp:1356
@ RepeatMirrored
Mirror the texture.
@ Repeat
Repeat the texture.
@ ClampToEdge
Take the closest edge texel.
@ ClampToEdgeMirrored
Take the closest edge texel from the opposite site.
@ ClampToBorder
Return a pre-specified border color.
CullOrder
Describes the order or vertex winding, that is used to determine, whether a polygon is facing towards...
Definition rendering_api.hpp:1190
@ CounterClockWise
Vertices are evaluated in a counter clock-wise manner.
@ ClockWise
Vertices are evaluated in a clock-wise manner.
DescriptorHeapType
The target heap type for a descriptor.
Definition rendering_api.hpp:580
@ Resource
Binds all non-sampler resource views.
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
@ FrontFaces
The rasterizer will discard front-facing polygons.
@ Both
The rasterizer will discard front and back-facing polygons.
@ Disabled
The rasterizer will not discard any polygons.
@ BackFaces
The rasterizer will discard back-facing polygons.
ShaderStage
Describes the valid shader stages of a graphics pipeline.
Definition rendering_api.hpp:971
RenderTargetType
Describes the type of a render target.
Definition rendering_api.hpp:1205
@ DepthStencil
Represents a depth/stencil target.
@ Present
Represents a color target that should be presented.
constexpr UInt32 getBufferFormatChannelSize(BufferFormat format)
Returns the number of bytes used by a channel of a buffer format.
Definition rendering_api.hpp:2099
GraphicsAdapterType
Defines different types of graphics adapters.
Definition rendering_api.hpp:76
@ CPU
The adapter is a software driver.
@ GPU
The adapter is a dedicated GPU or integrated CPU adapter.
IndexType
Describes the element type of an index buffer.
Definition rendering_api.hpp:906
PrimitiveTopology
Describes the topology of a mesh primitive.
Definition rendering_api.hpp:937
@ PointList
A list of points where each vertex refers to an individual point.
@ TriangleStrip
A strip of triangles, where each vertex (except the first two) refers to the third vertex of the next...
@ LineList
A list of lines where each vertex pair refers to the start and end points of a line.
@ LineStrip
A strip of lines where each vertex (except the first one) refers to the end point for the next line s...
@ TriangleList
A list of triangles, where each triplet of vertices refers to a whole triangle.
PolygonMode
Describes the draw mode for polygons.
Definition rendering_api.hpp:1142
@ Point
Polygons are drawn as points at the vertex positions.
@ Wireframe
Polygons are only drawn as wire-frames.
@ Solid
Polygons are drawn as solid surfaces.
BufferType
Describes the type of a IBuffer.
Definition rendering_api.hpp:601
@ ShaderBindingTable
Describes a shader binding table for ray-tracing.
@ Index
Describes an index buffer.
@ Storage
Describes a shader storage buffer object (Vulkan) or unordered access view (DirectX).
@ Texel
Describes a shader texel storage buffer object (Vulkan) or unordered access view (DirectX).
@ Vertex
Describes a vertex buffer.
@ Uniform
Describes an uniform buffer object (Vulkan) or constant buffer view (DirectX).
InstanceFlags
Controls how an instance within a ITopLevelAccelerationStructure behaves during ray-tracing.
Definition rendering_api.hpp:2029
AttributeSemantic
Describes the semantic of a buffer attribute.
Definition rendering_api.hpp:372
@ BlendIndices
The attribute contains blend indices.
@ PointSize
The attribute contains a point size.
@ Binormal
The attribute contains a bi-normal vector.
@ Arbitrary
The attribute contains arbitrary data, that does not have any semantic associated with it.
@ Position
The attribute contains a position vector.
@ Tangent
The attribute contains a tangent vector.
@ BlendWeight
The attribute contains blend weights.
@ TransformedPosition
The attribute contains a pre-transformed position vector.
@ Color
The attribute contains a color value.
@ TextureCoordinate
The attribute contains a texture coordinate.
constexpr UInt32 getBufferFormatType(BufferFormat format)
Returns the underlying data type of a buffer format.
Definition rendering_api.hpp:2107
ResourceUsage
Describes the intended usage for a resource.
Definition rendering_api.hpp:761
GeometryFlags
Controls how a geometry that is part of a bottom-level acceleration structure (BLAS) behaves during r...
Definition rendering_api.hpp:1966
@ Linear
A linear allocation algorithm, that allocates memory blocks sequentially.
DescriptorType
Describes the type of a IDescriptor.
Definition rendering_api.hpp:442
@ RWStructuredBuffer
A writable shader storage object in Vulkan. Maps to a read/write structured buffer in DirectX.
@ SamplerDescriptorHeap
A special descriptor type that allows indexed access to the a portion of the global sampler heap.
@ InputAttachment
The result of a render target from an earlier render pass. Maps to a SubpassInput in HLSL.
@ AccelerationStructure
Represents a ray-tracing acceleration structure.
@ Sampler
A sampler state of a texture or image.
@ ByteAddressBuffer
Represents an unformatted buffer.
@ ResourceDescriptorHeap
Special descriptor type, that can bind all resources besides constant buffers, acceleration structure...
@ RWByteAddressBuffer
Represents an unformatted writable buffer.
@ Buffer
Represents a read-only texel buffer (uniform texel buffer).
@ RWTexture
A writable image.
@ RWBuffer
Represents a writable texel buffer (storage texel buffer).
@ Texture
A read-only sampled image.
@ StructuredBuffer
A shader storage buffer object in Vulkan. Maps to a structured buffer in DirectX.
@ ConstantBuffer
A uniform buffer in Vulkan. Maps to a constant buffer in DirectX.
QueuePriority
Specifies the priority with which a queue is scheduled on the GPU.
Definition rendering_api.hpp:160
@ High
A high queue priority.
@ Normal
The default queue priority.
@ Realtime
The highest possible queue priority. Submitting work to this queue might block other queues.
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
@ Staging
Creates a resource that can be mapped from the CPU in order to be transferred to the GPU later.
@ Dynamic
Creates a resource that can be mapped from the CPU and read by the GPU.
@ Readback
Creates a buffer that can be written on the GPU and read by the CPU.
@ GPUUpload
Creates a buffer that is directly allocated in GPU memory, but that can be efficiently written from t...
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
@ Nearest
Take the nearest texel with respect to the texture coordinate.
BufferFormat
Describes a buffer attribute format.
Definition rendering_api.hpp:340
constexpr UInt32 getBufferFormatChannels(BufferFormat format)
Returns the number of channels for a buffer format.
Definition rendering_api.hpp:2091
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
@ x32
Use 32 samples per pixel.
@ x16
Use 16 samples per pixel.
@ x1
The default number of samples. Multi-sampling will be deactivated, if this sampling level is used.
@ x2
Use 2 samples per pixel.
@ x64
Use 64 samples per pixel.
@ x4
Use 4 samples per pixel.
@ x8
Use 8 samples per pixel.
std::vector< T > Array
Represents a dynamic array.
Definition containers.hpp:73
constexpr auto Join(std::ranges::input_range auto &&elements, StringView delimiter=""sv)
Definition string.hpp:29
std::string String
Definition string.hpp:24