|
29 | 29 | /// \file |
30 | 30 | /// Defines Diligent::ISuperResolution interface and related data structures |
31 | 31 |
|
32 | | -#include "../../GraphicsEngine/interface/DeviceObject.h" |
| 32 | +#include "../../../Primitives/interface/Object.h" |
33 | 33 | #include "../../GraphicsEngine/interface/GraphicsTypes.h" |
34 | 34 | #include "../../GraphicsEngine/interface/TextureView.h" |
35 | 35 | #include "../../GraphicsEngine/interface/DeviceContext.h" |
@@ -62,7 +62,10 @@ DEFINE_FLAG_ENUM_OPERATORS(SUPER_RESOLUTION_FLAGS) |
62 | 62 |
|
63 | 63 | /// This structure describes the super resolution upscaler object and is part of the creation |
64 | 64 | /// 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); |
66 | 69 |
|
67 | 70 | /// Unique identifier of the super resolution variant to create. |
68 | 71 | /// |
@@ -107,13 +110,6 @@ struct SuperResolutionDesc DILIGENT_DERIVE(DeviceObjectAttribs) |
107 | 110 | /// Optional. Used for temporal upscaling to guide the denoiser for areas with inaccurate motion information (e.g., alpha-blended objects). |
108 | 111 | TEXTURE_FORMAT ReactiveMaskFormat DEFAULT_INITIALIZER(TEX_FORMAT_UNKNOWN); |
109 | 112 |
|
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 | | - |
117 | 113 | /// Exposure scale texture format. |
118 | 114 | /// |
119 | 115 | /// Optional. When auto-exposure is disabled, specifies the format of the 1x1 exposure |
@@ -178,7 +174,7 @@ struct ExecuteSuperResolutionAttribs |
178 | 174 | /// where temporal history should be completely discarded. |
179 | 175 | /// Unlike the reactive mask which provides proportional control, |
180 | 176 | /// 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. |
182 | 178 | ITextureView* pIgnoreHistoryMaskTextureSRV DEFAULT_INITIALIZER(nullptr); |
183 | 179 |
|
184 | 180 | /// Jitter offset X applied to the projection matrix (in pixels). |
@@ -263,21 +259,19 @@ typedef struct ExecuteSuperResolutionAttribs ExecuteSuperResolutionAttribs; |
263 | 259 | #define DILIGENT_INTERFACE_NAME ISuperResolution |
264 | 260 | #include "../../../Primitives/interface/DefineInterfaceHelperMacros.h" |
265 | 261 |
|
266 | | -#define ISuperResolutionInclusiveMethods \ |
267 | | - IDeviceObjectInclusiveMethods; \ |
| 262 | +#define ISuperResolutionInclusiveMethods \ |
| 263 | + IObjectInclusiveMethods; \ |
268 | 264 | ISuperResolutionMethods SuperResolution |
269 | 265 |
|
270 | 266 | /// Super resolution upscaler interface. |
271 | 267 | /// |
272 | 268 | /// The super resolution object encapsulates a hardware-accelerated or software-based super resolution |
273 | 269 | /// effect (e.g., MetalFX on Metal, DirectSR on D3D12). |
274 | 270 | /// It is created via ISuperResolutionFactory::CreateSuperResolution(). |
275 | | -DILIGENT_BEGIN_INTERFACE(ISuperResolution, IDeviceObject) |
| 271 | +DILIGENT_BEGIN_INTERFACE(ISuperResolution, IObject) |
276 | 272 | { |
277 | | -#if DILIGENT_CPP_INTERFACE |
278 | 273 | /// 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; |
281 | 275 |
|
282 | 276 | /// Returns the optimal jitter offset for the given frame index. |
283 | 277 |
|
@@ -315,8 +309,7 @@ DILIGENT_END_INTERFACE |
315 | 309 | #if DILIGENT_C_INTERFACE |
316 | 310 |
|
317 | 311 | // 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) |
320 | 313 | # define ISuperResolution_GetJitterOffset(This, ...) CALL_IFACE_METHOD(SuperResolution, GetJitterOffset, This, __VA_ARGS__) |
321 | 314 | # define ISuperResolution_Execute(This, ...) CALL_IFACE_METHOD(SuperResolution, Execute, This, __VA_ARGS__) |
322 | 315 |
|
|
0 commit comments