diff options
| author | lbavoil <[email protected]> | 2017-01-23 09:55:05 +0100 |
|---|---|---|
| committer | lbavoil <[email protected]> | 2017-01-23 09:55:05 +0100 |
| commit | 0e07a80f8c1443e047e283f30693cf708a3204ea (patch) | |
| tree | 460cb590a7dfc7d43a205f33fa0631f408b68940 /src/RenderTargets_DX11.h | |
| parent | Polish HLSL. No functional change. (diff) | |
| download | hbaoplus-0e07a80f8c1443e047e283f30693cf708a3204ea.tar.xz hbaoplus-0e07a80f8c1443e047e283f30693cf708a3204ea.zip | |
HBAO+ 3.1.0.21602716
Diffstat (limited to 'src/RenderTargets_DX11.h')
| -rw-r--r-- | src/RenderTargets_DX11.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/RenderTargets_DX11.h b/src/RenderTargets_DX11.h index 179c086..7676641 100644 --- a/src/RenderTargets_DX11.h +++ b/src/RenderTargets_DX11.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2016, NVIDIA CORPORATION. All rights reserved. +* Copyright (c) 2008-2017, NVIDIA CORPORATION. All rights reserved. * * NVIDIA CORPORATION and its licensors retain all intellectual property * and proprietary rights in and to this software, related documentation @@ -14,6 +14,10 @@ #include "Common.h" #include "RenderOptions.h" +#if USE_NVAPI +#include "nvapi.h" +#endif + namespace GFSDK { namespace SSAO @@ -91,6 +95,20 @@ public: THROW_IF_FAILED(pDevice->CreateShaderResourceView(pTexture, NULL, &pSRV)); THROW_IF_FAILED(pDevice->CreateRenderTargetView(pTexture, NULL, &pRTV)); +#if USE_NVAPI + NvAPI_Status Status = NvAPI_Initialize(); + NVDX_ObjectHandle NVHandle = nullptr; + if (Status == NVAPI_OK) + { + Status = NvAPI_D3D_GetObjectHandleForResource(pDevice, pTexture, &NVHandle); + if (NVHandle) + { + NvU32 HintValue = 1; + Status = NvAPI_D3D_SetResourceHint(pDevice, NVHandle, NVAPI_D3D_SRH_CATEGORY_SLI, NVAPI_D3D_SRH_SLI_APP_CONTROLLED_INTERFRAME_CONTENT_SYNC, &HintValue); + } + } +#endif + m_AllocatedSizeInBytes = Width * Height * ArraySize * GetFormatSizeInBytes(Format); } } |