vkd3d-utils: Implement the event functions for Windows.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
This commit is contained in:
Alexandre Julliard 2022-02-04 12:07:30 +01:00
parent 2a1470cddf
commit 923ea7bb1e
2 changed files with 37 additions and 8 deletions

View File

@ -327,6 +327,41 @@ HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename
}
/* Events */
#ifdef _WIN32
HANDLE vkd3d_create_event(void)
{
return CreateEventA(NULL, FALSE, FALSE, NULL);
}
HRESULT vkd3d_signal_event(HANDLE event)
{
SetEvent(event);
return S_OK;
}
unsigned int vkd3d_wait_event(HANDLE event, unsigned int milliseconds)
{
return WaitForSingleObject(event, milliseconds);
}
void vkd3d_destroy_event(HANDLE event)
{
CloseHandle(event);
}
#else /* _WIN32 */
#include <pthread.h>
struct vkd3d_event
{
pthread_mutex_t mutex;
pthread_cond_t cond;
BOOL is_signaled;
};
HANDLE vkd3d_create_event(void)
{
struct vkd3d_event *event;
@ -434,6 +469,8 @@ void vkd3d_destroy_event(HANDLE event)
vkd3d_free(impl);
}
#endif /* _WIN32 */
HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3D10Blob **blob)
{
HRESULT hr;

View File

@ -23,7 +23,6 @@
#define NONAMELESSUNION
#define VK_NO_PROTOTYPES
#include <pthread.h>
#include <vkd3d.h>
#include <vkd3d_shader.h>
#include <vkd3d_d3dcompiler.h>
@ -32,11 +31,4 @@
#include "vkd3d_memory.h"
#include <vkd3d_utils.h>
struct vkd3d_event
{
pthread_mutex_t mutex;
pthread_cond_t cond;
BOOL is_signaled;
};
#endif /* __VKD3D_UTILS_PRIVATE_H */