yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Ellie Hermaszewskaformatf65d756bf

master
1.6 KiB65 linesraw
1#pragma once
2
3#include "slang.h"
4
5#if SLANG_LINUX_FAMILY
6
7#pragma push_macro("WIN32_LEAN_AND_MEAN")
8#pragma push_macro("NOMINMAX")
9#undef WIN32_LEAN_AND_MEAN
10#define WIN32_LEAN_AND_MEAN
11#undef NOMINMAX
12#define NOMINMAX
13#include <windows.h>
14#pragma pop_macro("NOMINMAX")
15#pragma pop_macro("WIN32_LEAN_AND_MEAN")
16
17////////////////////////////////////////////////////////////////
18//
19// It's important to note that due to platform constraints this can't be a
20// totally faithful implementation of the Windows API.
21//
22// Notably, the "wait all" case in WaitForMultipleObjects can't be made correct
23// on linux, as we can't atomically read from several fds and eventfd is the
24// interface available from vkd3d-proton.
25//
26////////////////////////////////////////////////////////////////
27
28//
29// The synchapi types and macros used in gfx
30//
31#define INFINITE 0xffffffff
32
33#define WAIT_FAILED 0xffffffff
34#define WAIT_OBJECT_0 0
35
36typedef struct _SECURITY_ATTRIBUTES* LPSECURITY_ATTRIBUTES;
37
38#define CREATE_EVENT_MANUAL_RESET 1
39#define CREATE_EVENT_INITIAL_SET 2
40
41#define SYNCHRONIZE 0x00100000
42#define STANDARD_RIGHTS_REQUIRED 0x000f0000
43#define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
44
45HANDLE CreateEventEx(
46    LPSECURITY_ATTRIBUTES lpEventAttributes,
47    LPCSTR lpName,
48    DWORD dwFlags,
49    DWORD dwDesiredAccess);
50
51BOOL CloseHandle(HANDLE h);
52
53BOOL ResetEvent(HANDLE h);
54
55BOOL SetEvent(HANDLE h);
56
57DWORD WaitForSingleObject(HANDLE h, DWORD ms);
58
59DWORD WaitForMultipleObjects(
60    DWORD nHandles,
61    const HANDLE* handles,
62    BOOL bWaitAll,
63    DWORD dwMilliseconds);
64
65#endif // SLANG_LINUX_FAMILY