mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-05-04 08:41:43 +00:00
Fixed dispatch size calculation for FT_Dx12
This commit is contained in:
@@ -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<UINT>((State::Instance().currentFeature->DisplayWidth() + InNumThreadsX - 1) / InNumThreadsX);
|
||||
dispatchHeight = (State::Instance().currentFeature->DisplayHeight() + InNumThreadsY - 1) / InNumThreadsY;
|
||||
dispatchWidth = static_cast<UINT>((bufferWidth + InNumThreadsX - 1) / InNumThreadsX);
|
||||
dispatchHeight = (bufferHeight + InNumThreadsY - 1) / InNumThreadsY;
|
||||
|
||||
InCmdList->Dispatch(dispatchWidth, dispatchHeight, 1);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user