diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c index dd193d83601..0b48f16a0b2 100644 --- a/src/vulkan/wsi/wsi_common.c +++ b/src/vulkan/wsi/wsi_common.c @@ -38,7 +38,10 @@ #include #include #include + +#ifndef _WIN32 #include +#endif VkResult wsi_device_init(struct wsi_device *wsi, @@ -477,7 +480,10 @@ wsi_create_image(const struct wsi_swapchain *chain, VkResult result; memset(image, 0, sizeof(*image)); + +#ifndef _WIN32 image->dma_buf_fd = -1; +#endif result = wsi->CreateImage(chain->device, &info->create, &chain->alloc, &image->image); @@ -512,8 +518,10 @@ wsi_destroy_image(const struct wsi_swapchain *chain, { const struct wsi_device *wsi = chain->wsi; +#ifndef _WIN32 if (image->dma_buf_fd >= 0) close(image->dma_buf_fd); +#endif if (image->buffer.blit_cmd_buffers) { for (uint32_t i = 0; i < wsi->queue_family_count; i++) { diff --git a/src/vulkan/wsi/wsi_common_private.h b/src/vulkan/wsi/wsi_common_private.h index ae0b196b3aa..b5198d45b0b 100644 --- a/src/vulkan/wsi/wsi_common_private.h +++ b/src/vulkan/wsi/wsi_common_private.h @@ -74,12 +74,16 @@ struct wsi_image { VkCommandBuffer *blit_cmd_buffers; } buffer; +#ifndef _WIN32 uint64_t drm_modifier; +#endif int num_planes; uint32_t sizes[4]; uint32_t offsets[4]; uint32_t row_pitches[4]; +#ifndef _WIN32 int dma_buf_fd; +#endif }; struct wsi_swapchain {