2929/// \file
3030/// Defines Diligent::ISuperResolution interface and related data structures
3131
32- #include "../../GraphicsEngine/ interface/DeviceObject .h"
32+ #include "../../../Primitives/ interface/Object .h"
3333#include "../../GraphicsEngine/interface/GraphicsTypes.h"
3434#include "../../GraphicsEngine/interface/TextureView.h"
3535#include "../../GraphicsEngine/interface/DeviceContext.h"
@@ -62,7 +62,10 @@ DEFINE_FLAG_ENUM_OPERATORS(SUPER_RESOLUTION_FLAGS)
6262
6363/// This structure describes the super resolution upscaler object and is part of the creation
6464/// parameters given to ISuperResolutionFactory::CreateSuperResolution().
65- struct SuperResolutionDesc DILIGENT_DERIVE (DeviceObjectAttribs )
65+ struct SuperResolutionDesc
66+ {
67+ /// Object name.
68+ const Char * Name DEFAULT_INITIALIZER (nullptr );
6669
6770 /// Unique identifier of the super resolution variant to create.
6871 ///
@@ -107,13 +110,6 @@ struct SuperResolutionDesc DILIGENT_DERIVE(DeviceObjectAttribs)
107110 /// Optional. Used for temporal upscaling to guide the denoiser for areas with inaccurate motion information (e.g., alpha-blended objects).
108111 TEXTURE_FORMAT ReactiveMaskFormat DEFAULT_INITIALIZER (TEX_FORMAT_UNKNOWN );
109112
110- /// Ignore history mask texture format.
111- ///
112- /// Optional. Used for temporal upscaling to indicate regions where temporal history
113- /// should be completely discarded (binary mask: 0 = use history, 1 = ignore history).
114- /// Unlike the reactive mask which provides proportional control, this is a binary decision.
115- TEXTURE_FORMAT IgnoreHistoryMaskFormat DEFAULT_INITIALIZER (TEX_FORMAT_UNKNOWN );
116-
117113 /// Exposure scale texture format.
118114 ///
119115 /// Optional. When auto-exposure is disabled, specifies the format of the 1x1 exposure
@@ -178,7 +174,7 @@ struct ExecuteSuperResolutionAttribs
178174 /// where temporal history should be completely discarded.
179175 /// Unlike the reactive mask which provides proportional control,
180176 /// this is a binary decision (discard or keep).
181- /// Only used when SuperResolutionDesc::IgnoreHistoryMaskFormat != TEX_FORMAT_UNKNOWN .
177+ /// Format must be TEX_FORMAT_R8_UINT .
182178 ITextureView * pIgnoreHistoryMaskTextureSRV DEFAULT_INITIALIZER (nullptr );
183179
184180 /// Jitter offset X applied to the projection matrix (in pixels).
@@ -263,35 +259,33 @@ typedef struct ExecuteSuperResolutionAttribs ExecuteSuperResolutionAttribs;
263259#define DILIGENT_INTERFACE_NAME ISuperResolution
264260#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
265261
266- #define ISuperResolutionInclusiveMethods \
267- IDeviceObjectInclusiveMethods; \
262+ #define ISuperResolutionInclusiveMethods \
263+ IObjectInclusiveMethods; \
268264 ISuperResolutionMethods SuperResolution
269265
270266/// Super resolution upscaler interface.
271267///
272268/// The super resolution object encapsulates a hardware-accelerated or software-based super resolution
273269/// effect (e.g., MetalFX on Metal, DirectSR on D3D12).
274270/// It is created via ISuperResolutionFactory::CreateSuperResolution().
275- DILIGENT_BEGIN_INTERFACE (ISuperResolution , IDeviceObject )
271+ DILIGENT_BEGIN_INTERFACE (ISuperResolution , IObject )
276272{
277- #if DILIGENT_CPP_INTERFACE
278273 /// Returns the super resolution description used to create the object.
279- virtual const SuperResolutionDesc & METHOD (GetDesc )() const override = 0 ;
280- #endif
274+ VIRTUAL const SuperResolutionDesc REF METHOD (GetDesc )(THIS ) CONST PURE ;
281275
282276 /// Returns the optimal jitter offset for the given frame index.
283277
284- /// \param [in] Index - Frame index. The sequence wraps automatically.
285- /// \param [out] pJitterX - Jitter offset X in pixel space, typically in [-0.5, 0.5] range.
286- /// \param [out] pJitterY - Jitter offset Y in pixel space, typically in [-0.5, 0.5] range.
278+ /// \param [in] Index - Frame index. The sequence wraps automatically.
279+ /// \param [out] JitterX - Jitter offset X in pixel space, typically in [-0.5, 0.5] range.
280+ /// \param [out] JitterY - Jitter offset Y in pixel space, typically in [-0.5, 0.5] range.
287281 ///
288282 /// For temporal upscaling, the upscaler provides a recommended jitter pattern
289283 /// (e.g. Halton sequence) that should be applied to the projection matrix each frame.
290284 /// For spatial upscaling, both values are set to zero.
291285 VIRTUAL void METHOD (GetJitterOffset )(THIS_
292286 Uint32 Index ,
293- float * pJitterX ,
294- float * pJitterY ) CONST PURE ;
287+ float REF JitterX ,
288+ float REF JitterY ) CONST PURE ;
295289
296290
297291 /// Executes the super resolution upscaler.
@@ -315,8 +309,7 @@ DILIGENT_END_INTERFACE
315309#if DILIGENT_C_INTERFACE
316310
317311// clang-format off
318- # define ISuperResolution_GetDesc (This ) (const struct SuperResolutionDesc*)IDeviceObject_GetDesc(This)
319-
312+ # define ISuperResolution_GetDesc (This ) CALL_IFACE_METHOD (SuperResolution , GetDesc , This )
320313# define ISuperResolution_GetJitterOffset (This , ...) CALL_IFACE_METHOD (SuperResolution , GetJitterOffset , This , __VA_ARGS__ )
321314# define ISuperResolution_Execute (This , ...) CALL_IFACE_METHOD (SuperResolution , Execute , This , __VA_ARGS__ )
322315
0 commit comments