Skip to content

Commit

Permalink
GS/DX12: Use correct state for texture staging buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek authored and refractionpcsx2 committed Jun 4, 2022
1 parent 52a3777 commit eeb09c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions common/D3D12/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ void Context::ExecuteCommandList(bool wait_for_completion)
}

// Update fence when GPU has completed.
hr = m_command_queue->Signal(m_fence.get(), m_current_fence_value);
hr = m_command_queue->Signal(m_fence.get(), res.ready_fence_value);
pxAssertRel(SUCCEEDED(hr), "Signal fence");

MoveToNextCommandList();
Expand Down Expand Up @@ -555,9 +555,9 @@ void Context::DestroyPendingResources(CommandListResources& cmdlist)

for (const auto& it : cmdlist.pending_resources)
{
it.second->Release();
if (it.first)
it.first->Release();
it.second->Release();
}
cmdlist.pending_resources.clear();
}
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/GS/Renderers/DX12/GSTexture12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ ID3D12Resource* GSTexture12::AllocateUploadStagingBuffer(const void* data, u32 p
const D3D12_RESOURCE_DESC resource_desc = {
D3D12_RESOURCE_DIMENSION_BUFFER, 0, buffer_size, 1, 1, 1, DXGI_FORMAT_UNKNOWN, {1, 0}, D3D12_TEXTURE_LAYOUT_ROW_MAJOR,
D3D12_RESOURCE_FLAG_NONE};
HRESULT hr = g_d3d12_context->GetAllocator()->CreateResource(&allocation_desc, &resource_desc, D3D12_RESOURCE_STATE_COPY_SOURCE,
HRESULT hr = g_d3d12_context->GetAllocator()->CreateResource(&allocation_desc, &resource_desc, D3D12_RESOURCE_STATE_GENERIC_READ,
nullptr, allocation.put(), IID_PPV_ARGS(resource.put()));
if (FAILED(hr))
{
Expand Down

0 comments on commit eeb09c5

Please sign in to comment.