From c7bf272d9d78cc10f4387fdb069de53877ea5a92 Mon Sep 17 00:00:00 2001 From: FakeMichau <49685661+FakeMichau@users.noreply.github.com> Date: Sat, 25 Apr 2026 23:35:56 +0200 Subject: [PATCH] Minor cleanup --- OptiScaler/shaders/hud_copy/HudCopy_Dx12.cpp | 4 +--- OptiScaler/shaders/hudless_compare/HC_Dx12.cpp | 5 ----- OptiScaler/shaders/render_ui/RUI_Dx12.cpp | 5 ----- OptiScaler/shaders/resource_flip/RF_Dx12.cpp | 3 +-- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/OptiScaler/shaders/hud_copy/HudCopy_Dx12.cpp b/OptiScaler/shaders/hud_copy/HudCopy_Dx12.cpp index aaee6c59..21e6bc9f 100644 --- a/OptiScaler/shaders/hud_copy/HudCopy_Dx12.cpp +++ b/OptiScaler/shaders/hud_copy/HudCopy_Dx12.cpp @@ -32,9 +32,6 @@ bool HudCopy_Dx12::Dispatch(ID3D12GraphicsCommandList* cmdList, ID3D12Resource* _counter = _counter % HudCopy_NUM_OF_HEAPS; FrameDescriptorHeap& currentHeap = _frameHeaps[_counter]; - auto hudlessDesc = hudless->GetDesc(); - auto presentDesc = present->GetDesc(); - if (_buffer == nullptr) { LOG_DEBUG("[{0}] Start!", _name); @@ -83,6 +80,7 @@ bool HudCopy_Dx12::Dispatch(ID3D12GraphicsCommandList* cmdList, ID3D12Resource* cmdList->SetComputeRootDescriptorTable(0, currentHeap.GetTableGPUStart()); + auto presentDesc = present->GetDesc(); UINT dispatchWidth = static_cast((presentDesc.Width + InNumThreadsX - 1) / InNumThreadsX); UINT dispatchHeight = (presentDesc.Height + InNumThreadsY - 1) / InNumThreadsY; diff --git a/OptiScaler/shaders/hudless_compare/HC_Dx12.cpp b/OptiScaler/shaders/hudless_compare/HC_Dx12.cpp index 10b353c4..a3d8eaa8 100644 --- a/OptiScaler/shaders/hudless_compare/HC_Dx12.cpp +++ b/OptiScaler/shaders/hudless_compare/HC_Dx12.cpp @@ -177,11 +177,6 @@ bool HC_Dx12::Dispatch(IDXGISwapChain3* sc, ID3D12GraphicsCommandList* cmdList, _counter++; _counter = _counter % HC_NUM_OF_HEAPS; - // Check existing buffer - D3D12_RESOURCE_DESC bufferDesc {}; - if (_buffer[_counter] != nullptr) - bufferDesc = _buffer[_counter]->GetDesc(); - if (!CreateBufferResource(_counter, _device, scBuffer, D3D12_RESOURCE_STATE_COPY_DEST)) { LOG_ERROR("CreateBufferResource error!"); diff --git a/OptiScaler/shaders/render_ui/RUI_Dx12.cpp b/OptiScaler/shaders/render_ui/RUI_Dx12.cpp index 98b8655d..8e9ce4ec 100644 --- a/OptiScaler/shaders/render_ui/RUI_Dx12.cpp +++ b/OptiScaler/shaders/render_ui/RUI_Dx12.cpp @@ -195,11 +195,6 @@ bool RUI_Dx12::Dispatch(IDXGISwapChain3* sc, ID3D12GraphicsCommandList* cmdList, _counter++; _counter = _counter % HC_NUM_OF_HEAPS; - // Check existing buffer - D3D12_RESOURCE_DESC bufferDesc {}; - if (_buffer[_counter] != nullptr) - bufferDesc = _buffer[_counter]->GetDesc(); - if (!CreateBufferResource(_counter, _device, scBuffer, D3D12_RESOURCE_STATE_COPY_DEST)) { LOG_ERROR("CreateBufferResource error!"); diff --git a/OptiScaler/shaders/resource_flip/RF_Dx12.cpp b/OptiScaler/shaders/resource_flip/RF_Dx12.cpp index 244185d8..8dfff445 100644 --- a/OptiScaler/shaders/resource_flip/RF_Dx12.cpp +++ b/OptiScaler/shaders/resource_flip/RF_Dx12.cpp @@ -20,11 +20,10 @@ bool RF_Dx12::Dispatch(ID3D12GraphicsCommandList* InCmdList, ID3D12Resource* InR _counter = _counter % RF_NUM_OF_HEAPS; FrameDescriptorHeap& currentHeap = _frameHeaps[_counter]; - auto inDesc = InResource->GetDesc(); - CreateShaderResourceView(_device, InResource, currentHeap.GetSrvCPU(0), false); CreateUnorderedAccessView(_device, OutResource, currentHeap.GetUavCPU(0), 0); + auto inDesc = InResource->GetDesc(); RFConstants constants {}; constants.height = height - 1;