diff --git a/OptiScaler/shaders/format_transfer/FT_Dx12.cpp b/OptiScaler/shaders/format_transfer/FT_Dx12.cpp index 2436fc73..ef212171 100644 --- a/OptiScaler/shaders/format_transfer/FT_Dx12.cpp +++ b/OptiScaler/shaders/format_transfer/FT_Dx12.cpp @@ -95,6 +95,9 @@ bool FT_Dx12::CreateBufferResource(ID3D12Device* InDevice, ID3D12Resource* InSou texDesc.Format = format; texDesc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS; + bufferWidth = (uint32_t) texDesc.Width; + bufferHeight = texDesc.Height; + hr = InDevice->CreateCommittedResource(&heapProperties, D3D12_HEAP_FLAG_NONE, &texDesc, InState, nullptr, IID_PPV_ARGS(&_buffer)); @@ -188,9 +191,8 @@ bool FT_Dx12::Dispatch(ID3D12Device* InDevice, ID3D12GraphicsCommandList* InCmdL UINT dispatchWidth = 0; UINT dispatchHeight = 0; - dispatchWidth = - static_cast((State::Instance().currentFeature->DisplayWidth() + InNumThreadsX - 1) / InNumThreadsX); - dispatchHeight = (State::Instance().currentFeature->DisplayHeight() + InNumThreadsY - 1) / InNumThreadsY; + dispatchWidth = static_cast((bufferWidth + InNumThreadsX - 1) / InNumThreadsX); + dispatchHeight = (bufferHeight + InNumThreadsY - 1) / InNumThreadsY; InCmdList->Dispatch(dispatchWidth, dispatchHeight, 1); diff --git a/OptiScaler/shaders/format_transfer/FT_Dx12.h b/OptiScaler/shaders/format_transfer/FT_Dx12.h index af4d8ee4..0a4fabb6 100644 --- a/OptiScaler/shaders/format_transfer/FT_Dx12.h +++ b/OptiScaler/shaders/format_transfer/FT_Dx12.h @@ -19,6 +19,9 @@ class FT_Dx12 D3D12_GPU_DESCRIPTOR_HANDLE _gpuUavHandle[2] { { NULL }, { NULL } }; int _counter = 0; + uint32_t bufferWidth = 0; + uint32_t bufferHeight = 0; + uint32_t InNumThreadsX = 512; uint32_t InNumThreadsY = 1;