@@ -1856,6 +1856,10 @@ struct DeviceFeatures
18561856 /// Indicates if device supports formatted buffers.
18571857 DEVICE_FEATURE_STATE FormattedBuffers DEFAULT_INITIALIZER (DEVICE_FEATURE_STATE_DISABLED );
18581858
1859+ /// Indicates if the device supports hardware super resolution (upscaling).
1860+ /// MetalFX on Metal, DirectSR on D3D12.
1861+ DEVICE_FEATURE_STATE SuperResolution DEFAULT_INITIALIZER (DEVICE_FEATURE_STATE_DISABLED );
1862+
18591863#if DILIGENT_CPP_INTERFACE
18601864 constexpr DeviceFeatures () noexcept {}
18611865
@@ -1906,11 +1910,12 @@ struct DeviceFeatures
19061910 Handler(TextureSubresourceViews) \
19071911 Handler(NativeMultiDraw) \
19081912 Handler(AsyncShaderCompilation) \
1909- Handler(FormattedBuffers)
1913+ Handler(FormattedBuffers) \
1914+ Handler(SuperResolution)
19101915
19111916 explicit constexpr DeviceFeatures (DEVICE_FEATURE_STATE State ) noexcept
19121917 {
1913- static_assert (sizeof (* this ) == 47 , "Did you add a new feature to DeviceFeatures? Please add it to ENUMERATE_DEVICE_FEATURES." );
1918+ static_assert (sizeof (* this ) == 48 , "Did you add a new feature to DeviceFeatures? Please add it to ENUMERATE_DEVICE_FEATURES." );
19141919 #define INIT_FEATURE (Feature ) Feature = State;
19151920 ENUMERATE_DEVICE_FEATURES (INIT_FEATURE )
19161921 #undef INIT_FEATURE
@@ -3251,6 +3256,104 @@ struct SparseResourceProperties
32513256typedef struct SparseResourceProperties SparseResourceProperties ;
32523257
32533258
3259+ /// Super resolution upscaler type
3260+ DILIGENT_TYPED_ENUM (SUPER_RESOLUTION_UPSCALER_TYPE , Uint8 )
3261+ {
3262+ /// Spatial upscaling only (single frame, no motion vectors required).
3263+ SUPER_RESOLUTION_UPSCALER_TYPE_SPATIAL = 0u ,
3264+
3265+ /// Temporal upscaling (uses motion vectors and history accumulation).
3266+ SUPER_RESOLUTION_UPSCALER_TYPE_TEMPORAL
3267+ };
3268+
3269+
3270+ /// Capability flags for spatial super resolution upscaling.
3271+ DILIGENT_TYPED_ENUM (SUPER_RESOLUTION_SPATIAL_CAP_FLAGS , Uint32 )
3272+ {
3273+ SUPER_RESOLUTION_SPATIAL_CAP_FLAG_NONE = 0u ,
3274+
3275+ SUPER_RESOLUTION_SPATIAL_CAP_FLAG_LAST = SUPER_RESOLUTION_SPATIAL_CAP_FLAG_NONE
3276+ };
3277+ DEFINE_FLAG_ENUM_OPERATORS (SUPER_RESOLUTION_SPATIAL_CAP_FLAGS )
3278+
3279+
3280+ /// Capability flags for temporal super resolution upscaling.
3281+ DILIGENT_TYPED_ENUM (SUPER_RESOLUTION_TEMPORAL_CAP_FLAGS , Uint32 )
3282+ {
3283+ SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_NONE = 0u ,
3284+
3285+ /// The upscaler supports exposure scale texture input.
3286+ SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_EXPOSURE_SCALE_TEXTURE = 1u << 0 ,
3287+
3288+ /// The upscaler supports ignore history mask texture input.
3289+ /// When set, the backend processes the pIgnoreHistoryMaskTextureSRV field
3290+ /// in ExecuteSuperResolutionAttribs.
3291+ SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_IGNORE_HISTORY_MASK = 1u << 1 ,
3292+
3293+ /// The upscaler supports reactive mask texture input.
3294+ /// When set, the backend processes the pReactiveMaskTextureSRV field
3295+ /// in ExecuteSuperResolutionAttribs.
3296+ SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_REACTIVE_MASK = 1u << 2 ,
3297+
3298+ /// The upscaler supports the sharpness control parameter.
3299+ /// When set, the Sharpness field in ExecuteSuperResolutionAttribs is used.
3300+ SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_SHARPNESS = 1u << 3 ,
3301+
3302+ SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_LAST = SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_SHARPNESS
3303+ };
3304+ DEFINE_FLAG_ENUM_OPERATORS (SUPER_RESOLUTION_TEMPORAL_CAP_FLAGS )
3305+
3306+
3307+ /// Information about a supported super resolution upscaler variant
3308+ struct SuperResolutionUpscalerInfo
3309+ {
3310+ /// Human-readable name of the upscaler variant (e.g. "MetalFX Spatial", "MetalFX Temporal").
3311+ Char Name [128 ] DEFAULT_INITIALIZER ({});
3312+
3313+ /// Unique identifier for this upscaler variant.
3314+ /// Pass this UID to SuperResolutionUpscalerDesc when creating an upscaler.
3315+ INTERFACE_ID UID DEFAULT_INITIALIZER ({});
3316+
3317+ /// Upscaler type. Determines which input textures and parameters are required.
3318+ SUPER_RESOLUTION_UPSCALER_TYPE Type DEFAULT_INITIALIZER (SUPER_RESOLUTION_UPSCALER_TYPE_SPATIAL );
3319+
3320+ /// Capability flags. Interpretation depends on Type:
3321+ /// - SPATIAL: see Diligent::SUPER_RESOLUTION_SPATIAL_CAP_FLAGS
3322+ /// - TEMPORAL: see Diligent::SUPER_RESOLUTION_TEMPORAL_CAP_FLAGS
3323+ Uint32 CapFlags DEFAULT_INITIALIZER (0 );
3324+ };
3325+ typedef struct SuperResolutionUpscalerInfo SuperResolutionUpscalerInfo ;
3326+
3327+
3328+ /// Super resolution properties, reported via GraphicsAdapterInfo
3329+ struct SuperResolutionProperties
3330+ {
3331+ /// Array of supported upscaler variants and their capabilities.
3332+ SuperResolutionUpscalerInfo Upscalers [DILIGENT_MAX_SUPER_RESOLUTION_UPSCALERS ] DEFAULT_INITIALIZER ({});
3333+
3334+ /// The number of valid elements in the Upscalers array.
3335+ Uint8 NumUpscalers DEFAULT_INITIALIZER (0 );
3336+
3337+ #if DILIGENT_CPP_INTERFACE
3338+ bool operator == (const SuperResolutionProperties & RHS ) const
3339+ {
3340+ if (NumUpscalers != RHS .NumUpscalers )
3341+ return false;
3342+ for (Uint8 i = 0 ; i < NumUpscalers ; ++ i )
3343+ {
3344+ if (!(Upscalers [i ].UID == RHS .Upscalers [i ].UID &&
3345+ Upscalers [i ].Type == RHS .Upscalers [i ].Type &&
3346+ Upscalers [i ].CapFlags == RHS .Upscalers [i ].CapFlags &&
3347+ memcmp (Upscalers [i ].Name , RHS .Upscalers [i ].Name , sizeof (Upscalers [i ].Name )) == 0 ))
3348+ return false;
3349+ }
3350+ return true ;
3351+ }
3352+ #endif
3353+ };
3354+ typedef struct SuperResolutionProperties SuperResolutionProperties ;
3355+
3356+
32543357/// Command queue properties
32553358struct CommandQueueInfo
32563359{
@@ -3342,6 +3445,9 @@ struct GraphicsAdapterInfo
33423445 /// Sparse resource properties, see Diligent::SparseResourceProperties.
33433446 SparseResourceProperties SparseResources ;
33443447
3448+ /// Super resolution upscaler properties, see Diligent::SuperResolutionProperties.
3449+ SuperResolutionProperties SuperResolution ;
3450+
33453451 /// Supported device features, see Diligent::DeviceFeatures.
33463452
33473453 /// The feature state indicates:
@@ -3388,6 +3494,7 @@ struct GraphicsAdapterInfo
33883494 ComputeShader == RHS .ComputeShader &&
33893495 DrawCommand == RHS .DrawCommand &&
33903496 SparseResources == RHS .SparseResources &&
3497+ SuperResolution == RHS .SuperResolution &&
33913498 Features == RHS .Features &&
33923499 memcmp (Description , RHS .Description , sizeof (Description )) == 0 ;
33933500 }
0 commit comments