@@ -428,6 +428,101 @@ void CD3D11VP::GetVPParams(D3D11_VIDEO_PROCESSOR_CAPS& caps, UINT& rateConvIndex
428428 rateConvCaps = m_RateConvCaps;
429429}
430430
431+ HRESULT CD3D11VP::SetSuperRes (const int iType)
432+ {
433+ // This func calls into both Intel & NV functions, so that we can tell Intel to disable itself if only NV was picked, or vice-versa
434+
435+ // Intel VP SuperRes
436+ HRESULT hr;
437+ {
438+ constexpr GUID GUID_INTEL_VPE_INTERFACE = {
439+ 0xedd1d4b9 ,
440+ 0x8659 ,
441+ 0x4cbc ,
442+ {0xa4 , 0xd6 , 0x98 , 0x31 , 0xa2 , 0x16 , 0x3a , 0xc3 } };
443+
444+ enum : UINT {
445+ kIntelVpeFnVersion = 0x01 ,
446+ kIntelVpeFnMode = 0x20 ,
447+ kIntelVpeFnScaling = 0x37 ,
448+ };
449+
450+ enum : UINT {
451+ kIntelVpeVersion3 = 0x0003 ,
452+ };
453+
454+ enum : UINT {
455+ kIntelVpeModeNone = 0x0 ,
456+ kIntelVpeModePreproc = 0x01 ,
457+ };
458+
459+ enum : UINT {
460+ kIntelVpeScalingDefault = 0x0 ,
461+ kIntelVpeScalingSuperResolution = 0x2 ,
462+ };
463+
464+ struct IntelVpeExt {
465+ UINT function;
466+ void * param;
467+ };
468+
469+ IntelVpeExt ext = {};
470+ UINT param = 0 ;
471+ ext.param = ¶m;
472+
473+ ext.function = kIntelVpeFnVersion ;
474+ param = kIntelVpeVersion3 ;
475+ hr = m_pVideoContext->VideoProcessorSetOutputExtension (
476+ m_pVideoProcessor, &GUID_INTEL_VPE_INTERFACE, sizeof (ext), &ext);
477+ if (!SUCCEEDED (hr)) {
478+ return hr;
479+ }
480+
481+ ext.function = kIntelVpeFnMode ;
482+ param = (iType == SUPERRES_Intel) ? kIntelVpeModePreproc : kIntelVpeModeNone ;
483+ hr = m_pVideoContext->VideoProcessorSetOutputExtension (
484+ m_pVideoProcessor, &GUID_INTEL_VPE_INTERFACE, sizeof (ext), &ext);
485+ if (!SUCCEEDED (hr)) {
486+ return hr;
487+ }
488+
489+ ext.function = kIntelVpeFnScaling ;
490+ param = (iType == SUPERRES_Intel) ? kIntelVpeScalingSuperResolution : kIntelVpeScalingDefault ;
491+
492+ hr = m_pVideoContext->VideoProcessorSetStreamExtension (
493+ m_pVideoProcessor, 0 , &GUID_INTEL_VPE_INTERFACE, sizeof (ext), &ext);
494+ if (!SUCCEEDED (hr)) {
495+ return hr;
496+ }
497+ }
498+
499+ // NVIDIA RTX Super Resolution
500+ {
501+ constexpr GUID kNvidiaPPEInterfaceGUID = {
502+ 0xd43ce1b3 ,
503+ 0x1f4b ,
504+ 0x48ac ,
505+ {0xba , 0xee , 0xc3 , 0xc2 , 0x53 , 0x75 , 0xe6 , 0xf7 } };
506+ constexpr UINT kStreamExtensionVersionV1 = 0x1 ;
507+ constexpr UINT kStreamExtensionMethodSuperResolution = 0x2 ;
508+
509+ struct {
510+ UINT version;
511+ UINT method;
512+ UINT enable;
513+ } stream_extension_info = { kStreamExtensionVersionV1 ,
514+ kStreamExtensionMethodSuperResolution , iType == SUPERRES_Nvidia ? 1 : 0 };
515+
516+ hr = m_pVideoContext->VideoProcessorSetStreamExtension (m_pVideoProcessor, 0 , &kNvidiaPPEInterfaceGUID ,
517+ sizeof (stream_extension_info), &stream_extension_info);
518+ if (!SUCCEEDED (hr)) {
519+ return hr;
520+ }
521+ }
522+
523+ return hr;
524+ }
525+
431526HRESULT CD3D11VP::SetRectangles (const RECT* pSrcRect, const RECT* pDstRect)
432527{
433528 CheckPointer (m_pVideoContext, E_ABORT);
0 commit comments