Skip to content

Commit

Permalink
[host] d12: revert ivshmem heap order change
Browse files Browse the repository at this point in the history
Moving this prevented the RX580 crash early in init, but later
presents during the capture. As we want to ensure fallback to DXGI
if this happens we need to catch this fault during init. This moves
the order back so that we fail back into a working state.
  • Loading branch information
gnif committed Mar 9, 2024
1 parent 4d388d6 commit 90b27ae
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions host/platform/Windows/capture/D12/d12.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,21 @@ static bool d12_init(void * ivshmemBase, unsigned * alignSize)
*device, D3D12_COMMAND_LIST_TYPE_COMPUTE, &this->computeCommand, L"Compute"))
goto exit;

// Create the IVSHMEM heap
this->ivshmemBase = ivshmemBase;
comRef_defineLocal(ID3D12Heap, ivshmemHeap);
hr = ID3D12Device3_OpenExistingHeapFromAddress(
*device, ivshmemBase, &IID_ID3D12Heap, (void **)ivshmemHeap);
if (FAILED(hr))
{
DEBUG_WINERROR("Failed to open the framebuffer as a D3D12Heap", hr);
goto exit;
}

// Adjust the alignSize based on the required heap alignment
D3D12_HEAP_DESC heapDesc = ID3D12Heap_GetDesc(*ivshmemHeap);
*alignSize = heapDesc.Alignment;

// initialize the backend
if (!d12_backendInit(this->backend, this->debug, *device, *adapter, *output,
this->trackDamage))
Expand Down Expand Up @@ -362,21 +377,6 @@ static bool d12_init(void * ivshmemBase, unsigned * alignSize)
}
}

// Create the IVSHMEM heap
this->ivshmemBase = ivshmemBase;
comRef_defineLocal(ID3D12Heap, ivshmemHeap);
hr = ID3D12Device3_OpenExistingHeapFromAddress(
*device, ivshmemBase, &IID_ID3D12Heap, (void **)ivshmemHeap);
if (FAILED(hr))
{
DEBUG_WINERROR("Failed to open the framebuffer as a D3D12Heap", hr);
goto exit;
}

// Adjust the alignSize based on the required heap alignment
D3D12_HEAP_DESC heapDesc = ID3D12Heap_GetDesc(*ivshmemHeap);
*alignSize = heapDesc.Alignment;

comRef_toGlobal(this->factory , factory );
comRef_toGlobal(this->device , device );
comRef_toGlobal(this->copyQueue , copyQueue );
Expand Down

0 comments on commit 90b27ae

Please sign in to comment.