Comments (13)
Ok, I found the problem.
I'm trying to link dxvk w/ libvulkan.so but it should be WINE's vulkan-1.dll.so :) The other problem that WINE don't provides libvulkan-1.def and libd3dcompiler_47.def and meson failed to find this libs.
So:
$ winebuild -w --def -o libd3dcompiler_47.def --export path/to/wine/dlls/d3dcompiler_47/d3dcompiler_47.spec -m64
$ winebuild -w --def -o libvulkan-1.def --export path/to/wine/dlls/vulkan-1/vulkan-1.spec -m64
than cp
them somewhere meson will able to find them
and use original
lib_d3dcompiler_47 = dxvk_compiler.find_library('d3dcompiler_47')
lib_vulkan = dxvk_compiler.find_library('vulkan-1')
With this changes I can successfully build and run tests.
$ WINEDLLOVERRIDES='d3dcompiler_47.dll=n' ./d3d11-triangle.exe
- finally reveals window with triangles.
from dxvk.
Hey, I have been working on this for the past two days. I managed to get it to build, and now I am working on runtime issues. A lot of my solutions are lot less clean than yours though.
As for your current problem, it has to do with windows strings. If you replace both of the functions in util_env.cpp with return ""; it bypasses the issue. Also, you might want to remove the dll override thing, because it stops the backtrace from showing up, which is how I found the solution to that problem
By the way, if you want to discuss this further, you might want to get on the discord.
EDIT: The Vkx discord (https://discord.gg/C8EEVmy)
from dxvk.
If I understand correctly it must be something like :
diff --git a/src/util/util_env.cpp b/src/util/util_env.cpp
index 0464bc3..f5f7fd8 100644
--- a/src/util/util_env.cpp
+++ b/src/util/util_env.cpp
@@ -5,6 +5,7 @@
namespace dxvk::env {
std::string getEnvVar(const wchar_t* name) {
+#ifndef WINEBUILD
DWORD len = ::GetEnvironmentVariableW(name, nullptr, 0);
std::wstring result;
@@ -17,10 +18,14 @@ namespace dxvk::env {
result.resize(len);
return str::fromws(result);
+#else
+ return "";
+#endif
}
std::string getExeName() {
+#ifndef WINEBUILD
std::wstring exePath;
exePath.resize(MAX_PATH + 1);
@@ -33,6 +38,9 @@ namespace dxvk::env {
return (n != std::string::npos)
? fullPath.substr(n + 1)
: fullPath;
+#else
+ return "";
+#endif
}
}
Ok, with this I have following output:
$ WINEDEBUG="+loaddll" ./d3d11-triangle.exe
...
trace:loaddll:load_builtin_dll Loaded L"C:\\windows\\system32\\user32.dll" at 0x7feca1990000: builtin
trace:loaddll:load_builtin_dll Loaded L"C:\\windows\\system32\\dxgi.dll-60mFyb.spec" at 0x7feca2070000: builtin
trace:loaddll:load_builtin_dll Loaded L"C:\\windows\\system32\\d3d11.dll-8gpwHe.spec" at 0x7feca0e30000: builtin
trace:loaddll:load_builtin_dll Loaded L"C:\\windows\\system32\\d3dcompiler_43.dll" at 0x7feca0b70000: builtin
trace:loaddll:load_builtin_dll Loaded L"C:\\windows\\system32\\imm32.dll" at 0x7feca06e0000: builtin
trace:loaddll:load_builtin_dll Loaded L"C:\\windows\\system32\\winex11.drv" at 0x7feca0430000: builtin
wine: Call from 0x7bc853ac to unimplemented function dxgi.dll.CreateDXGIFactory, aborting
fixme:seh:dwarf_get_ptr unsupported encoding 9b
fixme:seh:dwarf_get_ptr unsupported encoding c1
fixme:seh:dwarf_get_ptr unsupported encoding 9b
fixme:seh:dwarf_get_ptr unsupported encoding c1
err:seh:call_stack_handlers invalid frame 20062 (0x132000-0x230000)
err:seh:NtRaiseException Exception frame is not in stack limits => unable to dispatch exception.
It looks like .spec file needed for build or .fake build or both. At least wine attempting to load them.
from dxvk.
I solved this issue a few hours ago, you need to build with a spec file.
dxgi.spec:
@ stdcall CreateDXGIFactory(ptr ptr)
@ stdcall CreateDXGIFactory1(ptr ptr)
d3d11.spec
@ stdcall D3D11CreateDevice(ptr long ptr long ptr long long ptr ptr ptr)
@ stdcall D3D11CreateDeviceAndSwapChain(ptr long ptr long ptr long long ptr ptr ptr ptr ptr)
Then you need to add these to the LINK_ARGS when building
from dxvk.
If I understand this correctly... with this we can build dxvk for Linux without relying on a cross-compiling environment, but just wine and gcc? (the end result being a wine library rather than a Windows dll)
That'd be really handy for Arch users building dxvk from the AUR.
from dxvk.
@ssorgatem While that is one result, the main reason is to allow profiling. On linux it is impossible to profile PE executables.
from dxvk.
Awesome!
By the way, for some reason when I use vulkan-1.dll.so, I get undefined reference to vkGetInstanceProcAddr, however when i use wine's vulkan.dll.so, it compiles find, and even somewhat works, before crashing due to some unrelated issue.
Anyway, when I do get it working with vulkan.dll.so, it crashes on a null function pointer. And maybe the reason of this is that you are compiling the tests natively as well. I am curious what would happen if you tried this dll with a PE d3d11-using executable.
from dxvk.
I am curious what would happen if you tried this dll with a PE d3d11-using executable.
I have tested TW3 and it fails w/ Not implemented/Invalid blend/Unsupported program type errors in output. It's how it should be for now I guess. Other programs works as before even if have dependencies on d3d11 or dxgi.
from dxvk.
If this actually works, can you make a pull request out of if?
from dxvk.
I'm on it. But this requires build system modification and some problematic code dropping (e.g. env var support). Also I have no luck to build fully functional x86 version, maybe due to not portable memory management code.
Also I'm trying to do my best to keep current build system and project behaviour and minimize changes and dependencies required for linux build support. But I have some options I can play with:
- use
winebuild
for compilation and link stages, it decides what params to pass togcc
andld
by itself but have some hardcoded paths to wine files which also different between 32 and 64 versions ofwinebuild
andwine
versions - use
gcc
for compilation andwinebuild
for linking like wine does by itself, more control and more changes required but almost the same as above - use
gcc
only - requires even more changes to build system and passing all parameters and definitions whichwinebuild
passes by itself but provides full control on build process
Also *.spec
and *.def
files required on different build stages and need to be either present, generated or bundled. And therefore some parts like vulkan-1.dll.so
present only in wine-staging
but I have luck to successfully bundle and build vulkan libraries but all parts of project still connected by hands and requires a lot of interactions.
So I'm not sure you accept such PR but I'll create a separate branch in my repo and let you know.
from dxvk.
@doitsujin branch name winebuild
pchome@e7102cc
pchome@e5027ce
from dxvk.
I have set winebuild as default branch and added some options support.
- Installed
vulkan-1
don't required for build now, same ford3dcompiler_47
,dxgi
andd3d11
. - env, utils and tests can be disabled via
$ meson configure -Denv=false -Dutils=false -Dtests=false
- DLL redirects support via
-Ddll-redirects=true
(builds libraries with_vk
suffix)
Minimal requirement for functional build for now (due to crashes):
$ meson -Dwine-build=true --cross-file build-win64-wine.txt build.64
$ meson configure -Dprefix=/tmp/dxvk -Dbuildtype=release -Denv=false
Therefore
- shader dump/read directories defaulted to
dxvk_shader_dump
anddxvk_shader_read
- logs stored in current directory and prefixed w/
dxvk_
- game-specific options affected too (not sure if they works or used)
@doitsujin if those commits are ok for you I can create PRs or grab everything your want by yourself
https://github.com/pchome/dxvk/commits/winebuild
from dxvk.
64-bit winelib builds are now supported using the build-wine64.txt
cross file.
from dxvk.
Related Issues (20)
- SHADE : Wrath of Angels - Freeze on Loading Screens HOT 13
- [d3d9] Alan Wake (2010) crashes after getting past the menu HOT 2
- Don`t work - dxvk.deviceFilter with 2 gpu windows and linux HOT 9
- Bully Scholarship Edition - FMVs do not play properly on Windows HOT 7
- StarCraft 2 lighting on the Void Thrashing mission HOT 5
- Wine 9.0 flatpak not working with flatpaked dxvk HOT 3
- The Sims Castaway Stories - Choppy FPS HOT 7
- Incorrect primary team color for non-standard clothing in Team Fortress 2 HOT 28
- Question about frame rate option rework HOT 1
- Question about custom Vendor and Device IDs HOT 4
- [d3d11, regression] Max Payne 3 LOD Fade Breaks After d66f838 HOT 3
- Gears of War (2007 - GFWL) HOT 1
- EverQuest - Low FPS when in foreground. HOT 1
- DMC 4 Don't Open, Help me in that
- Borderlands 2 crash HOT 3
- DXVK v2.0-26 not works for Death Stranding Director's Cut on Proton HOT 1
- [d3d9, regressions] Alt-tab issues in fullscreen at non native resolutions
- [d3d8, regression] Rome Total War broken world map
- C&c generals zhor bug on dxvk+d8vk HOT 5
- 16-bit color mode HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dxvk.