diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8b1d3cbd1..e58b2beec 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,11 @@ -23.9.7 +23.9.7.1 +======== + + Fixed a few visual glitches in Starfield HDR remastering, by restricting the feature + to render-passes only and ignoring compute-only resources. + + The resolution restrictions are not necessary when ignoring compute, and have been removed. + +23.9.7 ====== + Added HDR Pipeline Remastering to Starfield diff --git a/include/SpecialK/DLL_VERSION.H b/include/SpecialK/DLL_VERSION.H index 09d36c0c3..23dc8a2f6 100644 --- a/include/SpecialK/DLL_VERSION.H +++ b/include/SpecialK/DLL_VERSION.H @@ -3,8 +3,8 @@ #define SK_YEAR 23 #define SK_MONTH 9 #define SK_DATE 7 -#define SK_REV_N 0 -#define SK_REV 0 +#define SK_REV_N 1 +#define SK_REV 1 #ifndef _A2 #define _A2(a) #a diff --git a/src/render/d3d12/d3d12_device.cpp b/src/render/d3d12/d3d12_device.cpp index 8eeb9f54e..07ed74d02 100644 --- a/src/render/d3d12/d3d12_device.cpp +++ b/src/render/d3d12/d3d12_device.cpp @@ -2043,27 +2043,27 @@ _COM_Outptr_opt_ void **ppvResource ) { if (pDesc != nullptr) // Not optional, but some games try it anyway :) { - switch (SK_GetCurrentGameID ()) - { - case SK_GAME_ID::Starfield: - { - if (__SK_HDR_16BitSwap && pDesc->Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D && pDesc->Format == DXGI_FORMAT_R8G8B8A8_TYPELESS) - { - SK_LOGi0 (L"D3D12Device_CreateCommittedResource: %hs (%dx%d)", SK_DXGI_FormatToStr (pDesc->Format).data (), pDesc->Width, pDesc->Height); - - auto desc = *pDesc; - desc.Format = DXGI_FORMAT_R16G16B16A16_TYPELESS; - - HRESULT hr = - D3D12Device_CreateCommittedResource_Original ( This, - pHeapProperties, HeapFlags, &desc, InitialResourceState, - pOptimizedClearValue, riidResource, ppvResource ); - - if (SUCCEEDED (hr)) - return hr; - } - } break; - } + //switch (SK_GetCurrentGameID ()) + //{ + // case SK_GAME_ID::Starfield: + // { + // if (__SK_HDR_16BitSwap && pDesc->Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D && pDesc->Format == DXGI_FORMAT_R8G8B8A8_TYPELESS) + // { + // SK_LOGi0 (L"D3D12Device_CreateCommittedResource: %hs (%dx%d)", SK_DXGI_FormatToStr (pDesc->Format).data (), pDesc->Width, pDesc->Height); + // + // auto desc = *pDesc; + // desc.Format = DXGI_FORMAT_R16G16B16A16_TYPELESS; + // + // HRESULT hr = + // D3D12Device_CreateCommittedResource_Original ( This, + // pHeapProperties, HeapFlags, &desc, InitialResourceState, + // pOptimizedClearValue, riidResource, ppvResource ); + // + // if (SUCCEEDED (hr)) + // return hr; + // } + // } break; + //} if ( ppvResource != nullptr && riidResource == IID_ID3D12Resource && @@ -2158,8 +2158,17 @@ _COM_Outptr_opt_ void **ppvResource ) { case SK_GAME_ID::Starfield: { - if (__SK_HDR_16BitSwap && pDesc->Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D && pDesc->Format == DXGI_FORMAT_R8G8B8A8_TYPELESS && (pDesc->Width > 1024 || pDesc->Height > 1024) && ( ( pDesc->Flags & ( D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | - D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS ) ) ) ) + auto &rb = SK_GetCurrentRenderBackend (); + + SK_ComQIPtr + pSwapChain (rb.swapchain); + + DXGI_SWAP_CHAIN_DESC swapDesc = { }; + + if (pSwapChain.p != nullptr) + pSwapChain->GetDesc (&swapDesc); + + if (__SK_HDR_16BitSwap && pDesc->Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D && pDesc->Format == DXGI_FORMAT_R8G8B8A8_TYPELESS && /*pDesc->Height == swapDesc.BufferDesc.Height && */((pDesc->Flags & (D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET)))) { SK_LOGi0 (L"D3D12Device_CreatePlacedResource: %hs (%dx%d)", SK_DXGI_FormatToStr (pDesc->Format).data (), pDesc->Width, pDesc->Height);