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;
241 return formatter<string_view>::format(name, ctx);
246struct LITEFX_RENDERING_API std::formatter<BufferType> : std::formatter<std::string_view> {
248 string_view name =
"Invalid";
251 case Index: name =
"Index";
break;
252 case Vertex: name =
"Vertex";
break;
253 case Uniform: name =
"Uniform";
break;
254 case Storage: name =
"Storage";
break;
255 case Texel: name =
"Texel";
break;
258 case Indirect: name =
"Indirect";
break;
259 case Other: name =
"Other";
break;
261 return formatter<string_view>::format(name, ctx);
266struct LITEFX_RENDERING_API std::formatter<ResourceUsage> : std::formatter<std::string_view> {
270 if (t == ResourceUsage::None)
271 names.emplace_back(
"None");
272 else if (t == ResourceUsage::Default)
273 names.emplace_back(
"Default");
276 if ((t & ResourceUsage::AllowWrite) == ResourceUsage::AllowWrite)
277 names.emplace_back(
"AllowWrite");
278 if ((t & ResourceUsage::TransferSource) == ResourceUsage::TransferSource)
279 names.emplace_back(
"TransferSource");
280 if ((t & ResourceUsage::TransferDestination) == ResourceUsage::TransferDestination)
281 names.emplace_back(
"TransferDestination");
282 if ((t & ResourceUsage::AccelerationStructureBuildInput) == ResourceUsage::AccelerationStructureBuildInput)
283 names.emplace_back(
"AccelerationStructureBuildInput");
287 return formatter<string_view>::format(name, ctx);
292struct LITEFX_RENDERING_API std::formatter<ResourceHeap> : std::formatter<std::string_view> {
294 string_view name =
"Invalid";
297 case Staging: name =
"Staging";
break;
298 case Resource: name =
"Resource";
break;
299 case Dynamic: name =
"Dynamic";
break;
300 case Readback: name =
"Readback";
break;
302 return formatter<string_view>::format(name, ctx);
307struct LITEFX_RENDERING_API std::formatter<IndexType> : std::formatter<std::string_view> {
309 string_view name =
"Invalid";
312 case UInt16: name =
"UInt16";
break;
313 case UInt32: name =
"UInt32";
break;
315 return formatter<string_view>::format(name, ctx);
320struct LITEFX_RENDERING_API std::formatter<LiteFX::Rendering::PrimitiveTopology> : std::formatter<std::string_view> {
322 string_view name =
"Invalid";
325 case PointList: name =
"PointList";
break;
326 case LineList: name =
"LineList";
break;
328 case LineStrip: name =
"LineStrip";
break;
331 return formatter<string_view>::format(name, ctx);
336struct LITEFX_RENDERING_API std::formatter<ShaderStage> : std::formatter<std::string_view> {
340 if (t == ShaderStage::Other)
341 names.emplace_back(
"Other");
342 else if (t == ShaderStage::MeshPipeline)
343 names.emplace_back(
"Mesh Shading");
344 if (t == ShaderStage::RayTracingPipeline)
345 names.emplace_back(
"Ray Tracing");
348 if ((t & ShaderStage::Vertex) == ShaderStage::Vertex)
349 names.emplace_back(
"Vertex");
350 if ((t & ShaderStage::TessellationControl) == ShaderStage::TessellationControl)
351 names.emplace_back(
"Tessellation Control");
352 if ((t & ShaderStage::TessellationEvaluation) == ShaderStage::TessellationEvaluation)
353 names.emplace_back(
"Tessellation Evaluation");
354 if ((t & ShaderStage::Geometry) == ShaderStage::Geometry)
355 names.emplace_back(
"Geometry");
356 if ((t & ShaderStage::Fragment) == ShaderStage::Fragment)
357 names.emplace_back(
"Fragment");
358 if ((t & ShaderStage::Compute) == ShaderStage::Compute)
359 names.emplace_back(
"Compute");
360 if ((t & ShaderStage::Mesh) == ShaderStage::Mesh)
361 names.emplace_back(
"Mesh");
362 if ((t & ShaderStage::Task) == ShaderStage::Task)
363 names.emplace_back(
"Task");
364 if ((t & ShaderStage::RayGeneration) == ShaderStage::RayGeneration)
365 names.emplace_back(
"Ray Generation");
366 if ((t & ShaderStage::AnyHit) == ShaderStage::AnyHit)
367 names.emplace_back(
"Any Hit");
368 if ((t & ShaderStage::ClosestHit) == ShaderStage::ClosestHit)
369 names.emplace_back(
"Closest Hit");
370 if ((t & ShaderStage::Intersection) == ShaderStage::Intersection)
371 names.emplace_back(
"Intersection");
372 if ((t & ShaderStage::Miss) == ShaderStage::Miss)
373 names.emplace_back(
"Miss");
374 if ((t & ShaderStage::Callable) == ShaderStage::Callable)
375 names.emplace_back(
"Callable");
379 return formatter<string_view>::format(name, ctx);
384struct LITEFX_RENDERING_API std::formatter<BufferFormat> : std::formatter<std::string_view> {
392 names.emplace_back(
"X");
395 names.emplace_back(
"XY");
398 names.emplace_back(
"XYZ");
401 names.emplace_back(
"XYZW");
404 return formatter<string_view>::format(
"Invalid", ctx);
410 names.emplace_back(
"8");
413 names.emplace_back(
"16");
416 names.emplace_back(
"32");
419 names.emplace_back(
"64");
422 return formatter<string_view>::format(
"Invalid", ctx);
428 names.emplace_back(
"F");
431 names.emplace_back(
"I");
434 names.emplace_back(
"S");
437 return formatter<string_view>::format(
"Invalid", ctx);
442 return formatter<string_view>::format(name, ctx);
447struct LITEFX_RENDERING_API std::formatter<PolygonMode> : std::formatter<std::string_view> {
453 case Solid: name =
"Solid";
break;
454 case Wireframe: name =
"Wireframe";
break;
455 case Point: name =
"Point";
break;
456 default: name =
"Invalid";
break;
459 return formatter<string_view>::format(name, ctx);
464struct LITEFX_RENDERING_API std::formatter<CullMode> : std::formatter<std::string_view> {
471 case BackFaces: name =
"BackFaces";
break;
472 case Both: name =
"Both";
break;
473 case Disabled: name =
"Disabled";
break;
474 default: name =
"Invalid";
break;
477 return formatter<string_view>::format(name, ctx);
482struct LITEFX_RENDERING_API std::formatter<CullOrder> : std::formatter<std::string_view> {
488 case ClockWise: name =
"ClockWise";
break;
490 default: name =
"Invalid";
break;
493 return formatter<string_view>::format(name, ctx);
498struct LITEFX_RENDERING_API std::formatter<RenderTargetType> : std::formatter<std::string_view> {
504 case Color: name =
"Color";
break;
506 case Present: name =
"Present";
break;
507 default: name =
"Invalid";
break;
510 return formatter<string_view>::format(name, ctx);
515struct LITEFX_RENDERING_API std::formatter<MultiSamplingLevel> : std::formatter<std::string_view> {
521 case x1: name =
"1";
break;
522 case x2: name =
"2";
break;
523 case x4: name =
"4";
break;
524 case x8: name =
"8";
break;
525 case x16: name =
"16";
break;
526 case x32: name =
"32";
break;
527 case x64: name =
"64";
break;
528 default: name =
"Invalid";
break;
531 return formatter<string_view>::format(name, ctx);
536struct LITEFX_RENDERING_API std::formatter<FilterMode> : std::formatter<std::string_view> {
542 case Nearest: name =
"Nearest";
break;
543 case Linear: name =
"Linear";
break;
544 default: name =
"Invalid";
break;
547 return formatter<string_view>::format(name, ctx);
552struct LITEFX_RENDERING_API std::formatter<MipMapMode> : std::formatter<std::string_view> {
558 case Nearest: name =
"Nearest";
break;
559 case Linear: name =
"Linear";
break;
560 default: name =
"Invalid";
break;
563 return formatter<string_view>::format(name, ctx);
568struct LITEFX_RENDERING_API std::formatter<BorderMode> : std::formatter<std::string_view> {
574 case Repeat: name =
"Repeat";
break;
579 default: name =
"Invalid";
break;
582 return formatter<string_view>::format(name, ctx);
587struct LITEFX_RENDERING_API std::formatter<AttributeSemantic> : std::formatter<std::string_view> {
593 case Binormal: name =
"Binormal";
break;
596 case Color: name =
"Color";
break;
597 case Normal: name =
"Normal";
break;
598 case Position: name =
"Position";
break;
600 case PointSize: name =
"PointSize";
break;
601 case Tangent: name =
"Tangent";
break;
603 default: name =
"Unknown";
break;
606 return formatter<string_view>::format(name, ctx);
611struct LITEFX_RENDERING_API std::formatter<GeometryFlags> : std::formatter<std::string_view> {
615 if (t == GeometryFlags::None)
616 names.emplace_back(
"None");
619 if ((t & GeometryFlags::Opaque) == GeometryFlags::Opaque)
620 names.emplace_back(
"Opaque");
621 if ((t & GeometryFlags::OneShotAnyHit) == GeometryFlags::OneShotAnyHit)
622 names.emplace_back(
"OneShotAnyHit");
626 return formatter<string_view>::format(name, ctx);
631struct LITEFX_RENDERING_API std::formatter<AccelerationStructureFlags> : std::formatter<std::string_view> {
635 if (t == AccelerationStructureFlags::None)
636 names.emplace_back(
"None");
639 if ((t & AccelerationStructureFlags::AllowUpdate) == AccelerationStructureFlags::AllowUpdate)
640 names.emplace_back(
"AllowUpdate");
641 if ((t & AccelerationStructureFlags::AllowCompaction) == AccelerationStructureFlags::AllowCompaction)
642 names.emplace_back(
"AllowCompaction");
643 if ((t & AccelerationStructureFlags::PreferFastTrace) == AccelerationStructureFlags::AllowCompaction)
644 names.emplace_back(
"PreferFastTrace");
645 if ((t & AccelerationStructureFlags::PreferFastBuild) == AccelerationStructureFlags::PreferFastBuild)
646 names.emplace_back(
"PreferFastBuild");
647 if ((t & AccelerationStructureFlags::MinimizeMemory) == AccelerationStructureFlags::MinimizeMemory)
648 names.emplace_back(
"MinimizeMemory");
652 return formatter<string_view>::format(name, ctx);
657struct LITEFX_RENDERING_API std::formatter<InstanceFlags> : std::formatter<std::string_view> {
661 if (t == InstanceFlags::None)
662 names.emplace_back(
"None");
665 if ((t & InstanceFlags::DisableCull) == InstanceFlags::DisableCull)
666 names.emplace_back(
"DisableCull");
667 if ((t & InstanceFlags::FlipWinding) == InstanceFlags::FlipWinding)
668 names.emplace_back(
"FlipWinding");
669 if ((t & InstanceFlags::ForceOpaque) == InstanceFlags::ForceOpaque)
670 names.emplace_back(
"ForceOpaque");
671 if ((t & InstanceFlags::ForceNonOpaque) == InstanceFlags::ForceNonOpaque)
672 names.emplace_back(
"ForceNonOpaque");
676 return formatter<string_view>::format(name, ctx);
uint16_t UInt16
A type for an unsigned 16 bit integer.
Definition math.hpp:46
uint32_t UInt32
A type for an unsigned 32 bit integer.
Definition math.hpp:56
BorderMode
Describes how to treat texture coordinates that are outside the domain [0..1].
Definition rendering_api.hpp:1184
@ 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:1018
@ CounterClockWise
Vertices are evaluated in a counter clock-wise manner.
@ ClockWise
Vertices are evaluated in a clock-wise manner.
MipMapMode
Describes the filter operation between two mip-map levels.
Definition rendering_api.hpp:1169
CullMode
Describes which faces are culled by the Rasterizer stage.
Definition rendering_api.hpp:991
@ 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:799
RenderTargetType
Describes the type of a render target.
Definition rendering_api.hpp:1033
@ 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:1927
GraphicsAdapterType
Defines different types of graphics adapters.
Definition rendering_api.hpp:75
@ 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:750
PrimitiveTopology
Describes the topology of a mesh primitive.
Definition rendering_api.hpp:765
@ 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:970
@ 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:540
@ 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:1857
AttributeSemantic
Describes the semantic of a buffer attribute.
Definition rendering_api.hpp:371
@ BlendIndices
The attribute contains blend indices.
@ PointSize
The attribute contains a point size.
@ Binormal
The attribute contains a bi-normal vector.
@ 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:1935
ResourceUsage
Describes the intended usage for a resource.
Definition rendering_api.hpp:690
GeometryFlags
Controls how a geometry that is part of a bottom-level acceleration structure (BLAS) behaves during r...
Definition rendering_api.hpp:1794
DescriptorType
Describes the type of a IDescriptor.
Definition rendering_api.hpp:436
@ RWStructuredBuffer
A writable shader storage object in Vulkan. Maps to a read/write structured buffer in DirectX.
@ 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.
@ 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:159
@ 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:113
ResourceHeap
Defines where a resource (buffer or image) memory is located and from where it can be accessed.
Definition rendering_api.hpp:649
@ 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.
@ Resource
Creates a resource that can be read by the GPU.
@ Readback
Creates a buffer that can be written on the GPU and read by the CPU.
AccelerationStructureFlags
Controls how an acceleration structure should be built.
Definition rendering_api.hpp:1816
FilterMode
Describes the filter operation when accessing a pixel from a texture coordinate.
Definition rendering_api.hpp:1152
@ Linear
Linearly interpolate between the two closest texels with respect to the texture coordinate.
@ Nearest
Take the nearest texel with respect to the texture coordinate.
BufferFormat
Describes a buffer attribute format.
Definition rendering_api.hpp:339
constexpr UInt32 getBufferFormatChannels(BufferFormat format)
Returns the number of channels for a buffer format.
Definition rendering_api.hpp:1919
Format
Describes a texel format.
Definition rendering_api.hpp:182
MultiSamplingLevel
Describes the number of samples with which a IImage is sampled.
Definition rendering_api.hpp:1111
@ 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