[host] windows: fix compilation under gcc

This commit is contained in:
Geoffrey McRae
2024-01-31 01:33:43 +11:00
parent 72b25b99bc
commit cae4b2f4f9
6 changed files with 31 additions and 7 deletions

View File

@@ -6,10 +6,9 @@ add_library(capture_D12 STATIC
backend/dd.c
)
add_definitions("-DCOBJMACROS -DINITGUID -DWIDL_C_INLINE_WRAPPERS")
target_link_libraries(capture_D12
lg_common
platform_Windows
d3d11
dxgi
dwmapi

View File

@@ -111,6 +111,19 @@ static ID3D12Resource * d12_frameBufferToResource(
FrameBuffer * frameBuffer,
unsigned size);
// workarounds
static D3D12_HEAP_DESC _ID3D12Heap_GetDesc(ID3D12Heap* This)
{
D3D12_HEAP_DESC __ret;
return *This->lpVtbl->GetDesc(This, &__ret);
}
static D3D12_RESOURCE_DESC _ID3D12Resource_GetDesc(ID3D12Resource* This) {
D3D12_RESOURCE_DESC __ret;
return *This->lpVtbl->GetDesc(This,&__ret);
}
// implementation
static const char * d12_getName(void)
@@ -262,7 +275,7 @@ retryCreateCommandQueue:
}
// Adjust the alignSize based on the required heap alignment
D3D12_HEAP_DESC heapDesc = ID3D12Heap_GetDesc(*ivshmemHeap);
D3D12_HEAP_DESC heapDesc = _ID3D12Heap_GetDesc(*ivshmemHeap);
*alignSize = heapDesc.Alignment;
// initialize the backend
@@ -329,7 +342,7 @@ static CaptureResult d12_waitFrame(unsigned frameBufferIndex,
goto exit;
}
D3D12_RESOURCE_DESC desc = ID3D12Resource_GetDesc(*src);
D3D12_RESOURCE_DESC desc = _ID3D12Resource_GetDesc(*src);
if (desc.Width != this->lastFormat.Width ||
desc.Height != this->lastFormat.Height ||
desc.Format != this->lastFormat.Format)
@@ -384,7 +397,7 @@ static CaptureResult d12_getFrame(unsigned frameBufferIndex,
goto exit;
// copy into the framebuffer resource
D3D12_RESOURCE_DESC desc = ID3D12Resource_GetDesc(*src);
D3D12_RESOURCE_DESC desc = _ID3D12Resource_GetDesc(*src);
D3D12_TEXTURE_COPY_LOCATION srcLoc =
{
.pResource = *src,