@@ -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,120 @@ 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+ /// The upscaler is a native hardware-accelerated implementation (e.g. MetalFX, DirectSR)
3276+ /// as opposed to a custom software fallback.
3277+ SUPER_RESOLUTION_SPATIAL_CAP_FLAG_NATIVE = 1u << 0 ,
3278+
3279+ SUPER_RESOLUTION_SPATIAL_CAP_FLAG_LAST = SUPER_RESOLUTION_SPATIAL_CAP_FLAG_NATIVE
3280+ };
3281+ DEFINE_FLAG_ENUM_OPERATORS (SUPER_RESOLUTION_SPATIAL_CAP_FLAGS )
3282+
3283+
3284+ /// Capability flags for temporal super resolution upscaling.
3285+ DILIGENT_TYPED_ENUM (SUPER_RESOLUTION_TEMPORAL_CAP_FLAGS , Uint32 )
3286+ {
3287+ SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_NONE = 0u ,
3288+
3289+ /// The upscaler is a native hardware-accelerated implementation (e.g. MetalFX, DirectSR)
3290+ /// as opposed to a custom software fallback.
3291+ SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_NATIVE = 1u << 0 ,
3292+
3293+ /// The upscaler supports exposure scale texture input.
3294+ SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_EXPOSURE_SCALE_TEXTURE = 1u << 1 ,
3295+
3296+ /// The upscaler supports ignore history mask texture input.
3297+ /// When set, the backend processes the pIgnoreHistoryMaskTextureSRV field
3298+ /// in ExecuteSuperResolutionAttribs.
3299+ SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_IGNORE_HISTORY_MASK = 1u << 2 ,
3300+
3301+ /// The upscaler supports reactive mask texture input.
3302+ /// When set, the backend processes the pReactiveMaskTextureSRV field
3303+ /// in ExecuteSuperResolutionAttribs.
3304+ SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_REACTIVE_MASK = 1u << 3 ,
3305+
3306+ /// The upscaler supports the sharpness control parameter.
3307+ /// When set, the Sharpness field in ExecuteSuperResolutionAttribs is used.
3308+ SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_SHARPNESS = 1u << 4 ,
3309+
3310+ SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_LAST = SUPER_RESOLUTION_TEMPORAL_CAP_FLAG_SHARPNESS
3311+ };
3312+ DEFINE_FLAG_ENUM_OPERATORS (SUPER_RESOLUTION_TEMPORAL_CAP_FLAGS )
3313+
3314+
3315+ /// Information about a supported super resolution upscaler variant
3316+ struct SuperResolutionUpscalerInfo
3317+ {
3318+ /// Human-readable name of the upscaler variant (e.g. "MetalFX Spatial", "MetalFX Temporal").
3319+ Char Name [128 ] DEFAULT_INITIALIZER ({});
3320+
3321+ /// Unique identifier for this upscaler variant.
3322+ /// Pass this VariantId to SuperResolutionUpscalerDesc when creating an upscaler.
3323+ INTERFACE_ID VariantId DEFAULT_INITIALIZER ({});
3324+
3325+ /// Upscaler type. Determines which input textures and parameters are required.
3326+ SUPER_RESOLUTION_UPSCALER_TYPE Type DEFAULT_INITIALIZER (SUPER_RESOLUTION_UPSCALER_TYPE_SPATIAL );
3327+
3328+ #if defined(DILIGENT_SHARP_GEN )
3329+ Uint32 CapFlags DEFAULT_INITIALIZER (0 );
3330+ #else
3331+ union
3332+ {
3333+ /// Capability flags for SUPER_RESOLUTION_UPSCALER_TYPE_SPATIAL.
3334+ SUPER_RESOLUTION_SPATIAL_CAP_FLAGS SpatialCapFlags DEFAULT_INITIALIZER (SUPER_RESOLUTION_SPATIAL_CAP_FLAG_NONE );
3335+
3336+ /// Capability flags for SUPER_RESOLUTION_UPSCALER_TYPE_TEMPORAL.
3337+ SUPER_RESOLUTION_TEMPORAL_CAP_FLAGS TemporalCapFlags ;
3338+ };
3339+ #endif
3340+ };
3341+ typedef struct SuperResolutionUpscalerInfo SuperResolutionUpscalerInfo ;
3342+
3343+
3344+ /// Super resolution properties, reported via GraphicsAdapterInfo
3345+ struct SuperResolutionProperties
3346+ {
3347+ /// Array of supported upscaler variants and their capabilities.
3348+ SuperResolutionUpscalerInfo Upscalers [DILIGENT_MAX_SUPER_RESOLUTION_UPSCALERS ] DEFAULT_INITIALIZER ({});
3349+
3350+ /// The number of valid elements in the Upscalers array.
3351+ Uint8 NumUpscalers DEFAULT_INITIALIZER (0 );
3352+
3353+ #if DILIGENT_CPP_INTERFACE && !defined(DILIGENT_SHARP_GEN )
3354+ bool operator == (const SuperResolutionProperties & RHS ) const
3355+ {
3356+ if (NumUpscalers != RHS .NumUpscalers )
3357+ return false;
3358+ for (Uint8 i = 0 ; i < NumUpscalers ; ++ i )
3359+ {
3360+ if (!(Upscalers [i ].VariantId == RHS .Upscalers [i ].VariantId &&
3361+ Upscalers [i ].Type == RHS .Upscalers [i ].Type &&
3362+ Upscalers [i ].SpatialCapFlags == RHS .Upscalers [i ].SpatialCapFlags &&
3363+ memcmp (Upscalers [i ].Name , RHS .Upscalers [i ].Name , sizeof (Upscalers [i ].Name )) == 0 ))
3364+ return false;
3365+ }
3366+ return true ;
3367+ }
3368+ #endif
3369+ };
3370+ typedef struct SuperResolutionProperties SuperResolutionProperties ;
3371+
3372+
32543373/// Command queue properties
32553374struct CommandQueueInfo
32563375{
@@ -3342,6 +3461,9 @@ struct GraphicsAdapterInfo
33423461 /// Sparse resource properties, see Diligent::SparseResourceProperties.
33433462 SparseResourceProperties SparseResources ;
33443463
3464+ /// Super resolution upscaler properties, see Diligent::SuperResolutionProperties.
3465+ SuperResolutionProperties SuperResolution ;
3466+
33453467 /// Supported device features, see Diligent::DeviceFeatures.
33463468
33473469 /// The feature state indicates:
@@ -3388,6 +3510,7 @@ struct GraphicsAdapterInfo
33883510 ComputeShader == RHS .ComputeShader &&
33893511 DrawCommand == RHS .DrawCommand &&
33903512 SparseResources == RHS .SparseResources &&
3513+ SuperResolution == RHS .SuperResolution &&
33913514 Features == RHS .Features &&
33923515 memcmp (Description , RHS .Description , sizeof (Description )) == 0 ;
33933516 }
0 commit comments