demos: Make the demos work in the Windows build.

Commit 02fe9f5bdf introduced linking the
Windows build of the demos with d3d12 and dxgi, while also still linking
to libvkd3d-utils.la. That happens to more or less work on Wine; we get
vkd3d-utils' D3D12CreateDevice(), and Wine's
IDXGIFactory2_CreateSwapChainForHwnd(), but because Wine's
implementation of d3d12 swapchains uses vkd3d, we're able to use the
resulting swapchain buffers even though the instance of vkd3d used by
Wine may not be the same instance of vkd3d used by the demos. Perhaps
unsurprisingly, things don't go nearly as well on Windows.

We could of course stop linking the demos to vkd3d-utils on Windows, but
that's not that interesting; we're trying to show what vkd3d can do
here, not what d3d12 can do.
This commit is contained in:
Henri Verbeet
2025-04-21 18:02:41 +02:00
parent 883ffc5fd6
commit dfe3ad5551
Notes: Henri Verbeet 2025-04-28 13:01:05 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1468
6 changed files with 142 additions and 31 deletions

View File

@@ -29,7 +29,10 @@ struct demo_win32
struct demo
{
struct demo_win32 win32;
union
{
struct demo_win32 win32;
} u;
size_t window_count;
@@ -76,7 +79,7 @@ static inline void demo_cleanup(struct demo *demo)
static inline bool demo_init(struct demo *demo, void *user_data)
{
if (!demo_win32_init(&demo->win32))
if (!demo_win32_init(&demo->u.win32))
{
fprintf(stderr, "Failed to initialise demo.\n");
return false;