// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
#include "PixelFormat.h"
#include "Enums.h"
///
/// Which resources are supported for a given format and given device.
///
API_ENUM(Attributes="Flags") enum class FormatSupport : int32
{
///
/// No features supported.
///
None = 0,
///
/// Buffer resources supported.
///
Buffer = 1,
///
/// Vertex buffers supported.
///
InputAssemblyVertexBuffer = 2,
///
/// Index buffers supported.
///
InputAssemblyIndexBuffer = 4,
///
/// Streaming output buffers supported.
///
StreamOutputBuffer = 8,
///
/// 1D texture resources supported.
///
Texture1D = 16,
///
/// 2D texture resources supported.
///
Texture2D = 32,
///
/// 3D texture resources supported.
///
Texture3D = 64,
///
/// Cube texture resources supported.
///
TextureCube = 128,
///
/// The shader Load function for texture objects is supported.
///
ShaderLoad = 256,
///
/// The shader Sample function for texture objects is supported.
///
ShaderSample = 512,
///
/// The shader SampleCmp and SampleCmpLevelZero functions for texture objects are supported.
///
ShaderSampleComparison = 1024,
///
/// Unused.
///
ShaderSampleMonoText = 2048,
///
/// Mipmaps are supported.
///
Mip = 4096,
///
/// Automatic generation of mipmaps is supported.
///
MipAutogen = 8192,
///
/// Render targets are supported.
///
RenderTarget = 16384,
///
/// Blend operations supported.
///
Blendable = 32768,
///
/// Depth stencils supported.
///
DepthStencil = 65536,
///
/// CPU locking supported.
///
CpuLockable = 131072,
///
/// Multisample antialiasing (MSAA) resolve operations are supported.
///
MultisampleResolve = 262144,
///
/// Format can be displayed on screen.
///
Display = 524288,
///
/// Format can't be cast to another format.
///
CastWithinBitLayout = 1048576,
///
/// Format can be used as a multi-sampled render target.
///
MultisampleRenderTarget = 2097152,
///
/// Format can be used as a multi-sampled texture and read into a shader with the shader Load function.
///
MultisampleLoad = 4194304,
///
/// Format can be used with the shader gather function.
///
ShaderGather = 8388608,
///
/// Format supports casting when the resource is a back buffer.
///
BackBufferCast = 16777216,
///
/// Format can be used for an unordered access view.
///
TypedUnorderedAccessView = 33554432,
///
/// Format can be used with the shader gather with comparison function.
///
ShaderGatherComparison = 67108864,
///
/// Format can be used with the decoder output.
///
DecoderOutput = 134217728,
///
/// Format can be used with the video processor output.
///
VideoProcessorOutput = 268435456,
///
/// Format can be used with the video processor input.
///
VideoProcessorInput = 536870912,
///
/// Format can be used with the video encoder.
///
VideoEncoder = 1073741824,
};
DECLARE_ENUM_OPERATORS(FormatSupport);
///
/// The features exposed for a particular format.
///
API_STRUCT() struct FormatFeatures
{
DECLARE_SCRIPTING_TYPE_MINIMAL(FormatFeatures);
///
/// Gets the maximum MSAA sample count for a particular .
///
API_FIELD() MSAALevel MSAALevelMax;
///
/// Support of a given format on the installed video device.
///
API_FIELD() FormatSupport Support;
FormatFeatures()
{
}
///
/// Initializes a new instance of the struct.
///
/// The format.
/// The MSAA level maximum.
/// The format support.
FormatFeatures(const PixelFormat format, MSAALevel msaaLevelMax, FormatSupport formatSupport)
: MSAALevelMax(msaaLevelMax)
, Support(formatSupport)
{
}
};
///
/// Graphics Device limits and constraints descriptor.
///
API_STRUCT() struct GPULimits
{
DECLARE_SCRIPTING_TYPE_MINIMAL(GPULimits);
///
/// True if device supports Compute shaders.
///
API_FIELD() bool HasCompute;
///
/// True if device supports Tessellation shaders (domain and hull shaders).
///
API_FIELD() bool HasTessellation;
///
/// True if device supports Geometry shaders.
///
API_FIELD() bool HasGeometryShaders;
///
/// True if device supports hardware geometry instancing.
///
API_FIELD() bool HasInstancing;
///
/// True if device supports rendering to volume textures using Geometry shaders.
///
API_FIELD() bool HasVolumeTextureRendering;
///
/// True if device supports indirect drawing (including pixel shader write to UAV).
///
API_FIELD() bool HasDrawIndirect;
///
/// True if device supports append/consume buffers with counters.
///
API_FIELD() bool HasAppendConsumeBuffers;
///
/// True if device supports separate render target blending states.
///
API_FIELD() bool HasSeparateRenderTargetBlendState;
///
/// True if device supports depth buffer texture as a shader resource view.
///
API_FIELD() bool HasDepthAsSRV;
///
/// True if device supports depth buffer clipping (see GPUPipelineState::Description::DepthClipEnable).
///
API_FIELD() bool HasDepthClip;
///
/// True if device supports depth buffer texture as a readonly depth buffer (can be sampled in the shader while performing depth-test).
///
API_FIELD() bool HasReadOnlyDepth;
///
/// True if device supports multisampled depth buffer texture as a shader resource view.
///
API_FIELD() bool HasMultisampleDepthAsSRV;
///
/// True if device supports reading from typed UAV in shader (common types such as R32G32B32A32, R16G16B16A16, R16, R8). This doesn't apply to single-component 32-bit formats.
///
API_FIELD() bool HasTypedUAVLoad;
///
/// The maximum amount of texture mip levels.
///
API_FIELD() int32 MaximumMipLevelsCount;
///
/// The maximum size of the 1D texture.
///
API_FIELD() int32 MaximumTexture1DSize;
///
/// The maximum length of 1D textures array.
///
API_FIELD() int32 MaximumTexture1DArraySize;
///
/// The maximum size of the 2D texture.
///
API_FIELD() int32 MaximumTexture2DSize;
///
/// The maximum length of 2D textures array.
///
API_FIELD() int32 MaximumTexture2DArraySize;
///
/// The maximum size of the 3D texture.
///
API_FIELD() int32 MaximumTexture3DSize;
///
/// The maximum size of the cube texture (both width and height).
///
API_FIELD() int32 MaximumTextureCubeSize;
///
/// The maximum degree of anisotropic filtering used for texture sampling.
///
API_FIELD() float MaximumSamplerAnisotropy;
};