Skip to content

Commit 90b27ae

Browse files
committed
[host] d12: revert ivshmem heap order change
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.
1 parent 4d388d6 commit 90b27ae

File tree

1 file changed

+15
-15
lines changed
  • host/platform/Windows/capture/D12

1 file changed

+15
-15
lines changed

host/platform/Windows/capture/D12/d12.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,21 @@ static bool d12_init(void * ivshmemBase, unsigned * alignSize)
334334
*device, D3D12_COMMAND_LIST_TYPE_COMPUTE, &this->computeCommand, L"Compute"))
335335
goto exit;
336336

337+
// Create the IVSHMEM heap
338+
this->ivshmemBase = ivshmemBase;
339+
comRef_defineLocal(ID3D12Heap, ivshmemHeap);
340+
hr = ID3D12Device3_OpenExistingHeapFromAddress(
341+
*device, ivshmemBase, &IID_ID3D12Heap, (void **)ivshmemHeap);
342+
if (FAILED(hr))
343+
{
344+
DEBUG_WINERROR("Failed to open the framebuffer as a D3D12Heap", hr);
345+
goto exit;
346+
}
347+
348+
// Adjust the alignSize based on the required heap alignment
349+
D3D12_HEAP_DESC heapDesc = ID3D12Heap_GetDesc(*ivshmemHeap);
350+
*alignSize = heapDesc.Alignment;
351+
337352
// initialize the backend
338353
if (!d12_backendInit(this->backend, this->debug, *device, *adapter, *output,
339354
this->trackDamage))
@@ -362,21 +377,6 @@ static bool d12_init(void * ivshmemBase, unsigned * alignSize)
362377
}
363378
}
364379

365-
// Create the IVSHMEM heap
366-
this->ivshmemBase = ivshmemBase;
367-
comRef_defineLocal(ID3D12Heap, ivshmemHeap);
368-
hr = ID3D12Device3_OpenExistingHeapFromAddress(
369-
*device, ivshmemBase, &IID_ID3D12Heap, (void **)ivshmemHeap);
370-
if (FAILED(hr))
371-
{
372-
DEBUG_WINERROR("Failed to open the framebuffer as a D3D12Heap", hr);
373-
goto exit;
374-
}
375-
376-
// Adjust the alignSize based on the required heap alignment
377-
D3D12_HEAP_DESC heapDesc = ID3D12Heap_GetDesc(*ivshmemHeap);
378-
*alignSize = heapDesc.Alignment;
379-
380380
comRef_toGlobal(this->factory , factory );
381381
comRef_toGlobal(this->device , device );
382382
comRef_toGlobal(this->copyQueue , copyQueue );

0 commit comments

Comments
 (0)