mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
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:
parent
2a1470cddf
commit
923ea7bb1e
@ -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;
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user