Commit Graph

102 Commits

Author SHA1 Message Date
Joshua Ashton a62117cd13 build: Disable stdcall alias-ing and use kill-at
Disable stdcall aliasing and enable kill-at to ensure our exported
functions don't have the @8, @40, etc suffixes.

This still keeps `--enable-stdcall-fixup` as otherwise the linker can
get confused trying to find exports from the .def. This does not result
in aliases being added, just for them to be found to add to the export
table.

This also switches d3d11 to use the MinGW provided dxgi.lib for linking
and d3d10 to use the MinGW provided d3d11.lib for linking.
Unfortunately the .a's we output seem to still have the @blah that we
killed so we cannot use them for internal linkage since using kill-at.

Tested that what we get out of MinGW now is what we want with dllexp.

Supercedes: #3590

Exports

```
➜  build git:(master) ✗ winedump -j export src/dxgi/dxgi.dll
Contents of src/dxgi/dxgi.dll: 129505860 bytes

  Name:            DXGI.DLL
  Characteristics: 00000000
  TimeDateStamp:   64C97A2D Tue Aug  1 22:33:33 2023
  Version:         0.00
  Ordinal base:    9
  # of functions:  9
  # of Names:      5
Addresses of functions: 00423028
Addresses of name ordinals: 00423060
Addresses of names: 0042304C

  Entry Pt  Ordn  Name
  00007C17     9 CreateDXGIFactory
  00007BF3    10 CreateDXGIFactory1
  00007B62    11 CreateDXGIFactory2
  00007C3B    16 DXGIDeclareAdapterRemovalSupport
  00007CD8    17 DXGIGetDebugInterface1

Done dumping src/dxgi/dxgi.dll
```

```
➜  build git:(fix-stdcall-32-bit) winedump -j export src/d3d11/d3d11.dll
Contents of src/d3d11/d3d11.dll: 263021637 bytes

  Name:            D3D11.DLL
  Characteristics: 00000000
  TimeDateStamp:   64C97A2E Tue Aug  1 22:33:34 2023
  Version:         0.00
  Ordinal base:    18
  # of functions:  7
  # of Names:      4
Addresses of functions: 005E3028
Addresses of name ordinals: 005E3054
Addresses of names: 005E3044

  Entry Pt  Ordn  Name
  00020045    18 D3D11CoreCreateDevice
  000200AA    22 D3D11CreateDevice
  0002010E    23 D3D11CreateDeviceAndSwapChain
  0002025F    24 D3D11On12CreateDevice

Done dumping src/d3d11/d3d11.dll
```

Import of DXGI in D3D11

```
  offset 005e1014 dxgi.dll
  Hint/Name Table: 005E408C
  TimeDateStamp:   00000000 (Thu Jan  1 01:00:00 1970)
  ForwarderChain:  00000000
  First thunk RVA: 005E4300
   Thunk    Ordn  Name
  005e4300     4  CreateDXGIFactory1
```
2023-08-01 23:35:09 +01:00
Philip Rebohle 228615b639 [d3d11] Rework D3D11CoreCreateDevice
FiveM calls this directly and apparently our signature wasn't quite
what they expect it to be.
2023-07-31 13:13:48 +02:00
Joshua Ashton d83e184afd [d3d10] Enable native builds
This started working at some point... may as well!
2022-10-15 18:17:29 +01:00
Joshua Ashton 25798f6fe1 [build] Set name_prefix to `libdxvk_` for native builds
Less rude and nicer than just d3d9.so.
Matches old DXVK native behaviour too.
2022-10-15 19:10:57 +02:00
Philip Rebohle c72c6ec6ed [d3d10] Remove d3d10.dll and d3d10_1.dll
These are incomplete and are already not being used anyway,
so just drop them.
2022-08-30 02:42:03 +02:00
Philip Rebohle 559fa50f54 [d3d11] Introduce d3d11.enableContextLock option 2022-08-24 12:27:02 +02:00
Philip Rebohle 1d2d712dfb
[d3d11] Move d3d11_context_common.* -> d3d11_context.* 2022-08-04 13:43:36 +02:00
Philip Rebohle 30b1cac0ae
[d3d11] Remove old D3D11DeviceContext class 2022-08-04 13:43:36 +02:00
Joshua Ashton 715493cd75 [d3d10] Mark D3D10ShaderReflection classes as final
Fixes warnings about calling delete on non-final inherited objects.
2022-08-02 13:09:34 +02:00
Georg Lehmann 2550cff149 [build] Cleanup build system.
No changes except dropping support for msvc before 15.3.
2022-03-17 01:38:58 +00:00
Philip Rebohle 89b1f025eb
[d3d10] Forward OpenSharedResource to D3D11 implementation
Trivial since the requested IID is passed by the application.
2022-03-04 19:13:30 +01:00
Vincent Grande f0e9700f34
[d3d10] Add missing include 2021-09-03 12:54:50 +02:00
Connor Abbott aae0e57a46
Don't add def file as an object
This is unnecessary even on mingw, and leads to duplicating the .def
file on the linking command line which winegcc complains about.
2021-07-03 14:28:28 +02:00
Joshua Ashton 0367bf95c4 [build] MSVC check cleanup 2021-03-03 18:57:42 +01:00
Philip Rebohle f1e069568d
[build] Remove .spec files
No longer needed now that we don't support winelib builds anymore.
2020-05-01 00:52:33 +02:00
Philip Rebohle 436357e280
[meta] Remove support for winelib builds
Untested, unmaintained, and constantly causing issues on various
setups for no apparent reason. Time to get rid of it for good.

Closes #1584.
2020-04-20 17:35:08 +02:00
Philip Rebohle 3697583f71
[d3d10] Separate d3d10core from d3d10
This way we skip compiling and linking unnecessary garbage
into the core library.
2020-03-18 22:01:11 +01:00
Joshua Ashton 7a134e49be
[d3d10] Implement D3D10[Core]GetVersion and D3D10[Core]RegisterLayers 2020-03-18 20:49:17 +01:00
Philip Rebohle da506f5932 [util] Add generic recursive spinlock 2020-03-15 03:43:04 +01:00
Philip Rebohle 33b0d4c991
[d3d10] Create type reflection objects on demand
See previous commits for details. Fixes #1507.
2020-03-12 21:03:31 +01:00
Philip Rebohle 3d81b3eb82
[d3d10] Create variable reflection objects on demand 2020-03-12 21:03:30 +01:00
Philip Rebohle 21fe6a3405
[d3d10] Create constant buffer reflection objects on demand
The reported constant buffer count does not necessarily match the
number of constant buffers that can be retrieved from reflection.
2020-03-12 21:03:30 +01:00
Joshua Ashton 74d23c22de [build] Use __CRT_UUID_DECL for uuid definitions
Closes #1463
2020-02-18 20:25:05 +01:00
Philip Rebohle be16da37d7 [d3d11] Introduce COM interface to set and get API version
Allows us to identify DirectX 10 applications correctly.
2020-01-28 16:32:58 +00:00
Philip Rebohle 409991b9db
[d3d10] Fix reported bind flags for D3D10 resources
Turns out that the UAV bind flag remains set in the D3D10 description,
even though D3D10 does not support the feature. Fixes wine test failures.
2019-10-11 17:15:33 +02:00
Joshua Ashton 19fa1c405c [d3d10] Remove unused copies of device ptr in D3D10 wrappers
Silences a warning when building with Clang, and removes duplicate unused data.
2019-10-06 00:28:19 +02:00
Philip Rebohle 8f6df2b7fb
[d3d10] Add some null pointer checks when dealing with resources
Also, fix some more awkward formatting.
2019-09-23 21:59:02 +02:00
Philip Rebohle cb60211ce0
[d3d10] Fix some awkward formatting 2019-09-23 21:47:30 +02:00
Philip Rebohle b0f6655b92
[d3d11] Implement ID3D11Query1 2019-09-16 16:13:34 +02:00
Philip Rebohle 293551dc8d
[d3d10] Fix winelib build
There's no IID_PPV_ARGS on wine.
2019-05-15 21:42:42 +02:00
Philip Rebohle 78ab26347d
[d3d10] Add static method implementing D3D10CreateDeviceAndSwapChain1
Same as the D3D11 change to make ReShade happy.
2019-05-15 17:18:05 +02:00
Philip Rebohle 81229d66cc
[d3d10] Explicitly define GUID for ID3D10StateBlock
Fixes linker errors when building against winelib.
2019-05-03 20:32:52 +02:00
Philip Rebohle 81821414b0
[d3d10] Implement state blocks
Improves compatibility to Wine's Direct2D implementation.
2019-05-03 13:08:57 +02:00
pchome 3eb9f35fc3 [build] Use `generator` to produce resource files 2019-04-06 11:33:45 +02:00
Sveinar Søpler 4f9dd8d3d0
[build] Add version info to compiled DLLs
Fixes #980.
2019-04-05 21:09:57 +02:00
Joshua Ashton d01110259c [d3d11, d3d10] Init returnptrs for CreateDevice funcs. 2019-02-27 23:17:08 +01:00
Joshua Ashton 995949a9f9 [d3d10] Fix and cleanup S_FALSE handling 2019-02-27 22:01:04 +01:00
Joshua Ashton ccf24db428 [d3d10] Fix null pBlendStateDesc being dereferenced on def. desc 2019-02-27 22:01:04 +01:00
Joshua Ashton 2454041903 [d3d10] nullptr checks for resource creation 2019-02-27 22:01:04 +01:00
Joshua Ashton 5ea8648cd9 [d3d11, d3d10, dxgi] Handle null ppvObject in QueryInterface. (#909)
When a null ppvObject is passed into a QueryInterface on any IUnknown, a E_POINTER should be returned as the result (and it should not crash.)

This matches native d3d11/d3d10/dxgi behaviour and the documentation found here https://docs.microsoft.com/en-us/windows/desktop/api/unknwn/nf-unknwn-iunknown-queryinterface(q_) for IUnknown.
2019-02-10 08:01:01 +01:00
Robin 7a69135ba1 [d3d10] Check if d3d11 pointers are null 2019-01-02 19:13:42 +01:00
Robin 4c9af44356 [d3d10] Use context lock instead of separate device lock 2018-12-30 21:08:52 +01:00
Philip Rebohle ef63328eb8
[d3d10] Initialize DSV pointer in OMGetRenderTargets
Completely redundant, but apparently MSVC refuses to compile the
code otherwise. Refs #801.
2018-12-07 13:43:14 +01:00
Philip Rebohle 1cc0455c8a
[dxgi] Remove old DXGIDevice implementation and IDXGIVkDevice
Both have been moved to the D3D11 module and are no longer needed.
2018-12-04 19:38:52 +01:00
Philip Rebohle 835d92b802 [d3d10] D3D10CreateDeviceAndSwapChain: Ignore swap chain if null
Like e4b91057ac, this might fix some
issues with ReShade in D3D10 games.
2018-12-02 15:52:17 +01:00
Philip Rebohle 28216909bd
[d3d10] Implement D3D10Multithread 2018-11-30 11:37:57 +01:00
dhewg a05c93dd17 cross build cleanup (#746)
- Don't turn off warnings for winelib builds, fix them. Using __declspec on winelib builds just doesn't make sense.
- Drop the custom cross property 'winelib'. Detect it instead.
- Move the libdl dependency to the build system
- Don't run wine during mingw build process. Same as for wine builds, see 715d2571
2018-11-04 16:18:32 +01:00
Philip Rebohle 851d9fb726
[general] Remove unnecessary include directories from build files
These are no longer needed because dxvk includes consistently
use relative file paths now, instead of global includes.
2018-11-02 14:54:39 +01:00
Philip Rebohle 6b5aa0b928
Merge branch 'vk_transform_feedback' 2018-10-13 08:00:51 +02:00
Philip Rebohle 8172d347be
Revert "[d3d10] Implement ID3D10Multithread"
This reverts commit 55d6eae210.

We probably don't need it, and the current implementation is broken.
2018-10-12 19:29:52 +02:00