Skip to content

Commit

Permalink
D3D11: Add a temporary workaround for WineD3D backbuffers
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Mar 1, 2024
1 parent b7b35d5 commit 085e573
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/FNA3D_Driver_D3D11.c
Original file line number Diff line number Diff line change
Expand Up @@ -2749,17 +2749,23 @@ static void D3D11_INTERNAL_CreateBackbuffer(
D3D11_INTERNAL_DisposeBackbuffer(renderer);
}

/* Check for valid rendering support */
ID3D11Device_CheckFormatSupport(
renderer->device,
dxgiFormat,
&support
);

if (!((support & D3D11_FORMAT_SUPPORT_DISPLAY)))
/* FIXME: WineD3D does not expose D3D11_FORMAT_SUPPORT_DISPLAY,
* Remove this when it has been added (and backported to 9.0?).
*/
if (parameters->backBufferFormat != FNA3D_SURFACEFORMAT_COLOR)
{
FNA3D_LogError("Unsupported backbuffer DXGI format");
return;
/* Check for valid rendering support */
ID3D11Device_CheckFormatSupport(
renderer->device,
dxgiFormat,
&support
);

if (!((support & D3D11_FORMAT_SUPPORT_DISPLAY)))
{
FNA3D_LogError("Unsupported backbuffer DXGI format");
return;
}
}

/* Create or update the swapchain */
Expand Down

0 comments on commit 085e573

Please sign in to comment.