Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

Add .gitignore #3

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
39fb033
[build] Simplify src/meson.build
misyltoad Nov 16, 2019
7d9acf3
[build] Setup base build scripts for native building
misyltoad Nov 16, 2019
d2649af
[build] Ignore D3D10 for DXVK Native
misyltoad Nov 16, 2019
c573230
[include] Basic Windows headers/definitions for native
misyltoad Nov 16, 2019
5678018
[include] Implement SDL2 wsi helpers
misyltoad Nov 16, 2019
e210ed0
[wsi] Implement WSI abstraction module
misyltoad Nov 16, 2019
e20e99e
[wsi] Implement SDL2 WSI
misyltoad Nov 16, 2019
55c4915
[vulkan] Hook up presenter to new WSI abstraction
misyltoad Nov 16, 2019
ca4f2cf
[util] Move win32 specific implementations to their own files
misyltoad Nov 16, 2019
0a08738
[util] Use native directory slash for delimiting exe name
misyltoad Nov 16, 2019
ae59643
[util] Native linux implementations
misyltoad Nov 16, 2019
3edf98c
[dxvk] Implement SDL2 WSI
misyltoad Nov 16, 2019
e033609
[dxvk] Disable thread priority for state cache workers when building …
misyltoad Nov 16, 2019
1d6325a
[dxgi] Hook DXGI up to new WSI abstractions
misyltoad Nov 16, 2019
5aff06e
[build] Fix dxgi's so name on native, and disable definition spec sim…
misyltoad Nov 16, 2019
77a98a0
[d3d10] Use get_id platform abstraction for device mutex
misyltoad Nov 16, 2019
e32a451
[d3d11] Hook up D3D11 to new WSI abstraction
misyltoad Nov 16, 2019
b9816db
[build] Fix d3d11's so name on native, and disable definition spec sm…
misyltoad Nov 16, 2019
a50b9b7
[d3d11] Fix MinGW include version checks for native
misyltoad Nov 16, 2019
f9d68c8
[d3d11] Disable apitrace checking for native
misyltoad Nov 16, 2019
7fc9d35
[d3d11] Disable GDI when building native
misyltoad Nov 16, 2019
e6224c8
[d3d11] Make frame latency events/fence code platform agnostic
misyltoad Nov 30, 2019
8bc619d
[wsi] Support building natively on Windows
misyltoad Nov 30, 2019
abe20d5
[wsi] Rename monitor_cast/window_cast to toHwnd/toMonitor
misyltoad Nov 30, 2019
01d8cc0
[vulkan] Add a vulkan_native header for VkFullScreenExclusiveEXT
misyltoad Dec 30, 2019
8664757
[d3d9] Hook up D3D9 to new WSI
misyltoad Dec 31, 2019
09535a1
[util] Use WSI abstraction for util_monitor
misyltoad Mar 11, 2020
c1e4d5e
[include] Declare DUMMYUNIONNAME and DUMMYSTRUCTNAME
misyltoad Mar 28, 2020
a6b7544
add .gitignore
Arxcis Apr 5, 2020
c3b7f69
.gitignore - !include/native/directx/README.txt
Arxcis Apr 5, 2020
263ac9c
change README.txt -> README.md
Arxcis Apr 5, 2020
5330ded
.gitignore - add newline
Arxcis Apr 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Build-folder where we put meson build files
#
# Example:
# meson build/
# ninja -C build/
#
build/

# Ignore directx headers, because we are not allowed to redistribute them?
include/native/directx/*
!include/native/directx/README.md
11 changes: 11 additions & 0 deletions include/native/directx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# include/native/directx

Put your DirectX headers in here. These cannot be redisted due to current licensing reasons.

Example of how to get them:
```sh
brew install mingw-w64
# ...installing
cd ~/Cellar/mingw-w64/7.0.0_2/toolchain-x86_64/x86_64-w64-mingw32/include/
cp d3d*.h dxgi*.h ~/git/github/Joshua-Ashton/dxvk-native/include/native/directx/
```
3 changes: 3 additions & 0 deletions include/native/windows/oaidl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

// Don't care.
3 changes: 3 additions & 0 deletions include/native/windows/objbase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

// Don't care.
3 changes: 3 additions & 0 deletions include/native/windows/ocidl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

// Don't care.
3 changes: 3 additions & 0 deletions include/native/windows/ole2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

// Don't care.
3 changes: 3 additions & 0 deletions include/native/windows/rpc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

// Don't care.
3 changes: 3 additions & 0 deletions include/native/windows/rpcndr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

// Don't care.
16 changes: 16 additions & 0 deletions include/native/windows/unknwn.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once

#include "windows_base.h"

DEFINE_GUID(IID_IUnknown, 0x00000000,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46)
struct IUnknown {

public:

virtual HRESULT QueryInterface(REFIID riid, void** ppvObject) = 0;

virtual ULONG AddRef() = 0;
virtual ULONG Release() = 0;

};
DECLARE_UUIDOF_HELPER(IUnknown, 0x00000000,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46)
4 changes: 4 additions & 0 deletions include/native/windows/windows.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once

#include "windows_base.h"
#include "unknwn.h"
242 changes: 242 additions & 0 deletions include/native/windows/windows_base.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
#pragma once

#include <cstdint>
#include <cstring>

// GCC complains about the COM interfaces
// not having virtual destructors

// and class conversion for C...DESC helper types
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
#pragma GCC diagnostic ignored "-Wclass-conversion"
#endif // __GNUC__

struct SDL_Window;

using INT = int32_t;
using UINT = uint32_t;

using LONG = int32_t;
using ULONG = uint32_t;

using HRESULT = int32_t;

using WCHAR = wchar_t;

using BOOL = INT;
using WINBOOL = BOOL;

using UINT16 = uint16_t;
using UINT32 = uint32_t;
using UINT64 = uint64_t;
using VOID = void;

using SIZE_T = size_t;

using UINT8 = uint8_t;
using BYTE = uint8_t;

using SHORT = int16_t;
using USHORT = uint16_t;

using LONGLONG = int64_t;
using ULONGLONG = uint64_t;

using FLOAT = float;

struct GUID {
uint32_t Data1;
uint16_t Data2;
uint16_t Data3;
uint8_t Data4[8];
};

using UUID = GUID;
using REFIID = const GUID&;
using REFGUID = REFIID;

template <typename T>
constexpr GUID __uuidof_helper();

#define __uuidof(T) __uuidof_helper<T>()

inline bool operator==(const GUID& a, const GUID& b) { return std::memcmp(&a, &b, sizeof(GUID)) == 0; }
inline bool operator!=(const GUID& a, const GUID& b) { return std::memcmp(&a, &b, sizeof(GUID)) != 0; }

using DWORD = uint32_t;
using WORD = int32_t;

using HANDLE = void*;
using HMONITOR = HANDLE;
using HDC = HANDLE;
using HMODULE = HANDLE;
using HWND = HANDLE;

using LPSTR = char*;
using LPCSTR = const char*;
using LPCWSTR = const wchar_t*;

struct LUID {
DWORD LowPart;
LONG HighPart;
};

struct POINT {
LONG x;
LONG y;
};

struct RECT {
LONG left;
LONG top;
LONG right;
LONG bottom;
};

struct SIZE {
LONG cx;
LONG cy;
};

union LARGE_INTEGER {
struct {
DWORD LowPart;
LONG HighPart;
} u;
LONGLONG QuadPart;
};

struct SECURITY_ATTRIBUTES {
DWORD nLength;
void* lpSecurityDescriptor;
BOOL bInheritHandle;
};

struct PALETTEENTRY {
BYTE peRed;
BYTE peGreen;
BYTE peBlue;
BYTE peFlags;
};

struct RGNDATAHEADER {
DWORD dwSize;
DWORD iType;
DWORD nCount;
DWORD nRgnSize;
RECT rcBound;
};

struct RGNDATA {
RGNDATAHEADER rdh;
char Buffer[1];
};

// Ignore these.
#define STDMETHODCALLTYPE
#define __stdcall

#define CONST const

constexpr BOOL TRUE = 1;
constexpr BOOL FALSE = 0;

#define interface struct
#define MIDL_INTERFACE(x) struct
#define DEFINE_GUID(iid, a, b, c, d, e, f, g, h, i, j, k) constexpr GUID iid = {a,b,c,{d,e,f,g,h,i,j,k}};

#define DECLARE_UUIDOF_HELPER(type, a, b, c, d, e, f, g, h, i, j, k) extern "C++" { template <> constexpr GUID __uuidof_helper<type>() { return GUID{a,b,c,{d,e,f,g,h,i,j,k}}; } }

#define __CRT_UUID_DECL(type, a, b, c, d, e, f, g, h, i, j, k) DECLARE_UUIDOF_HELPER(type, a, b, c, d, e, f, g, h, i, j, k)

constexpr HRESULT S_OK = 0;
constexpr HRESULT S_FALSE = 1;

constexpr HRESULT E_INVALIDARG = 0x80070057;
constexpr HRESULT E_FAIL = 0x80004005;
constexpr HRESULT E_NOINTERFACE = 0x80004002;
constexpr HRESULT E_NOTIMPL = 0x80004001;
constexpr HRESULT E_OUTOFMEMORY = 0x8007000E;
constexpr HRESULT E_POINTER = 0x80004003;

constexpr HRESULT DXGI_STATUS_OCCLUDED = 0x087a0001;
constexpr HRESULT DXGI_STATUS_CLIPPED = 0x087a0002;
constexpr HRESULT DXGI_STATUS_NO_REDIRECTION = 0x087a0004;
constexpr HRESULT DXGI_STATUS_NO_DESKTOP_ACCESS = 0x087a0005;
constexpr HRESULT DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE = 0x087a0006;
constexpr HRESULT DXGI_STATUS_MODE_CHANGED = 0x087a0007;
constexpr HRESULT DXGI_STATUS_MODE_CHANGE_IN_PROGRESS = 0x087a0008;
constexpr HRESULT DXGI_STATUS_UNOCCLUDED = 0x087a0009;
constexpr HRESULT DXGI_STATUS_DDA_WAS_STILL_DRAWING = 0x087a000a;
constexpr HRESULT DXGI_STATUS_PRESENT_REQUIRED = 0x087a002f;

constexpr HRESULT DXGI_ERROR_INVALID_CALL = 0x887A0001;
constexpr HRESULT DXGI_ERROR_NOT_FOUND = 0x887A0002;
constexpr HRESULT DXGI_ERROR_MORE_DATA = 0x887A0003;
constexpr HRESULT DXGI_ERROR_UNSUPPORTED = 0x887A0004;
constexpr HRESULT DXGI_ERROR_DEVICE_REMOVED = 0x887A0005;
constexpr HRESULT DXGI_ERROR_DEVICE_HUNG = 0x887A0006;
constexpr HRESULT DXGI_ERROR_DEVICE_RESET = 0x887A0007;
constexpr HRESULT DXGI_ERROR_WAS_STILL_DRAWING = 0x887A000A;
constexpr HRESULT DXGI_ERROR_FRAME_STATISTICS_DISJOINT = 0x887A000B;
constexpr HRESULT DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE = 0x887A000C;
constexpr HRESULT DXGI_ERROR_DRIVER_INTERNAL_ERROR = 0x887A0020;
constexpr HRESULT DXGI_ERROR_NONEXCLUSIVE = 0x887A0021;
constexpr HRESULT DXGI_ERROR_NOT_CURRENTLY_AVAILABLE = 0x887A0022;
constexpr HRESULT DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED = 0x887A0023;
constexpr HRESULT DXGI_ERROR_REMOTE_OUTOFMEMORY = 0x887A0024;
constexpr HRESULT DXGI_ERROR_ACCESS_LOST = 0x887A0026;
constexpr HRESULT DXGI_ERROR_WAIT_TIMEOUT = 0x887A0027;
constexpr HRESULT DXGI_ERROR_SESSION_DISCONNECTED = 0x887A0028;
constexpr HRESULT DXGI_ERROR_RESTRICT_TO_OUTPUT_STALE = 0x887A0029;
constexpr HRESULT DXGI_ERROR_CANNOT_PROTECT_CONTENT = 0x887A002A;
constexpr HRESULT DXGI_ERROR_ACCESS_DENIED = 0x887A002B;
constexpr HRESULT DXGI_ERROR_NAME_ALREADY_EXISTS = 0x887A002C;
constexpr HRESULT DXGI_ERROR_SDK_COMPONENT_MISSING = 0x887A002D;

#define WINAPI
#define WINUSERAPI

#define MAKE_HRESULT(sev,fac,code) \
((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )

#define STDMETHOD(name) virtual HRESULT name
#define STDMETHOD_(type, name) virtual type name

#define THIS_
#define THIS

#define __C89_NAMELESSUNIONNAME
#define __C89_NAMELESSUNIONNAME1
#define __C89_NAMELESSUNIONNAME2
#define __C89_NAMELESSUNIONNAME3
#define __C89_NAMELESSUNIONNAME4
#define __C89_NAMELESSUNIONNAME5
#define __C89_NAMELESSUNIONNAME6
#define __C89_NAMELESSUNIONNAME7
#define __C89_NAMELESSUNIONNAME8
#define __C89_NAMELESS
#define DUMMYUNIONNAME
#define DUMMYSTRUCTNAME

#define DECLARE_INTERFACE(x) struct x
#define DECLARE_INTERFACE_(x, y) struct x : public y

#define BEGIN_INTERFACE
#define END_INTERFACE

#define PURE = 0

#define DECLSPEC_SELECTANY

#define __MSABI_LONG(x) x

#define ENUM_CURRENT_SETTINGS ((DWORD)-1)
#define ENUM_REGISTRY_SETTINGS ((DWORD)-2)

template <typename T>
inline bool FAILED(T hr) { return HRESULT(hr) < 0; }

template <typename T>
inline bool SUCCEEDED(T hr) { return !FAILED<T>(hr); }
26 changes: 26 additions & 0 deletions include/native/wsi/native_sdl2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <cstdint>
#include <windows.h>

#include <SDL2/SDL.h>

namespace dxvk::wsi {

inline SDL_Window* fromHwnd(HWND hWindow) {
return reinterpret_cast<SDL_Window*>(hWindow);
}

inline HWND toHwnd(SDL_Window* pWindow) {
return reinterpret_cast<HWND>(pWindow);
}

// Offset so null HMONITORs go to -1
inline int32_t fromHmonitor(HMONITOR hMonitor) {
return static_cast<int32_t>(reinterpret_cast<intptr_t>(hMonitor)) - 1;
}

// Offset so -1 display id goes to 0 == NULL
inline HMONITOR toHmonitor(int32_t displayId) {
return reinterpret_cast<HMONITOR>(static_cast<intptr_t>(displayId + 1));
}

}
9 changes: 9 additions & 0 deletions include/native/wsi/native_wsi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

#ifdef DXVK_WSI_WIN32
#error You shouldnt be using this code path.
#elif DXVK_WSI_SDL2
#include "wsi/native_sdl2.h"
#else
#error Unknown wsi!
#endif
Loading