wineopenxr: Support acquiring/releasing images from D3D12 swapchains.

This commit is contained in:
Yuxuan Shui
2024-05-09 22:35:09 +01:00
committed by Arkadiusz Hiler
parent ef4785f325
commit 08c566d928
2 changed files with 221 additions and 11 deletions

View File

@ -9,6 +9,22 @@
struct IDXGIVkInteropDevice2;
typedef struct IDXGIVkInteropDevice2 IDXGIVkInteropDevice2;
typedef struct ID3D12DXVKInteropDevice ID3D12DXVKInteropDevice;
#define VK_PROCS \
X(vkAllocateCommandBuffers) \
X(vkBeginCommandBuffer) \
X(vkEndCommandBuffer) \
X(vkQueueSubmit) \
X(vkQueueWaitIdle) \
X(vkFreeCommandBuffers) \
X(vkCmdPipelineBarrier) \
X(vkCreateCommandPool) \
X(vkDestroyCommandPool) \
X(vkDestroyFence) \
X(vkCreateFence) \
X(vkWaitForFences) \
X(vkResetFences)
typedef struct wine_XrInstance {
XrInstance instance;
@ -23,8 +39,13 @@ typedef struct wine_XrInstance {
ID3D12DXVKInteropDevice *d3d12_device;
ID3D12CommandQueue *d3d12_queue;
/* For layout transitions for vkd3d-proton */
#define X(proc) PFN_##proc p_##proc;
VK_PROCS
#undef X
VkDevice vk_device;
VkQueue vk_queue;
VkCommandPool vk_command_pool;
} wine_XrInstance;
union CompositionLayer;
@ -56,9 +77,14 @@ typedef struct wine_XrSwapchain{
XrSwapchain swapchain;
XrSwapchainImageBaseHeader *images;
uint32_t image_count;
uint32_t acquired_count, acquired_start;
BOOL *acquired;
uint32_t *acquired_indices;
struct wine_XrSession *wine_session;
XrSwapchainCreateInfo create_info;
VkCommandBuffer *cmd_release;
VkCommandBuffer *cmd_acquire;
} wine_XrSwapchain;
struct openxr_func {