Re: Unable to completely replace vkd3d with vkd3d-proton?
zhengxianwei <[email protected]>
| Newsgroups | gmane.comp.emulators.wine.devel |
|---|---|
| Message-ID | <CABeGAqWYYonPUmqCiC2ZRkr5ZEmpp=WpEzAy1tUjhx1+Wmqprg@mail.gmail.com> |
>
> Il 27/11/24 01:36, zhengxianwei ha scritto:
>
> > 1. It actually mentions two ways to test vkd3d. The first one is
> > available at: https://gitlab.winehq.org/wine/vkd3d/-/wikis/home
> > <https://gitlab.winehq.org/wine/vkd3d/-/wikis/home>
> > ```
> > Building Wine with Direct3D 12 support
> > Wine uses pkg-config to find vkd3d libraries. If vkd3d libraries are
> > installed system-wide, the Wine configure script should find the vkd3d
> > libraries automatically. You can also use PKG_CONFIG_PATH,
> > VKD3D_CFLAGS or VKD3D_LIBS to override pkg-config search
> > path, C compiler flags for libvkd3d, or linker flags for
> > libvkd3d, e.g.
> >
> > $ ../wine-git/configure PKG_CONFIG_PATH=$HOME/src/vulkan/install/lib/
> > pkgconfig
> > ```
> >
> > However, following the steps didn’t work. It seems that VKD3D_FLAGS and
> > VKD3D_LIBS have been deprecated?
> "Didn't work" is not a very complete or usable description of the
> problems you found, so it's hard to help you with that. However, if you
> want a build of vkd3d that is usable with Wine I think you're off course
> here. Page https://gitlab.winehq.org/wine/vkd3d/-/wikis/home is mostly
> about building vkd3d on a Linux/macOS system on its own, which is
> different to crosscompiling it to a .dll library (which is what you need
> to use it in Wine).
>
> Thank you very much for pointing out my mistake. I will do my best to
describe my question clearly next time.
My issue with building vkd3d has been resolved. I referred to the code
logic in Proton for building vkd3d:
Proton Build Logic
<https://github.com/ValveSoftware/Proton/blob/3c3d468971353a5302f401a1e017730970ab8921/Makefile.in#L419C39-L419C81>
.
The main issue was with the code provided on the webpage (Building a MinGW
WoW64 Wine with a Custom VKD3D Build
<https://gitlab.winehq.org/wine/vkd3d/-/wikis/Building-a-MinGW-WoW64-Wine-with-a-custom-vkd3d-build>),
which needs to be modified as follows:
```
$ ../wine-git/configure --enable-win64 \
CC='ccache gcc' x86_64_CC='ccache x86_64-w64-mingw32-gcc' \
--with-system-dllpath="$HOME/wine-dirs/vkd3d64-prefix/bin:<mingw 64-bit
gcc dynamic dependencies>" \
VKD3D_PE_CFLAGS="-I$HOME/wine-dirs/vulkan-sdk/x86_64/include
-I$HOME/wine-dirs/vkd3d64-prefix/include/vkd3d" \
VKD3D_PE_LIBS="-L$HOME/wine-dirs/vkd3d64-prefix/lib -lvkd3d
-lvkd3d-shader"
VKD3D_PE_LIBS="-L$HOME/wine-dirs/vkd3d64-prefix/lib -l:libvkd3d-1.dll
-l:libvkd3d-shader-1.dl"
```
I can't help, though, wondering a little bit about what's your ultimate
> goal. Are you trying to play some particular game? Are you trying to add
> vkd3d support for some particular game? Are you trying to do some vkd3d
> development without having a particular application in mind? Depending
> on what's your real goal, compiling a PE build of vkd3d might not
> necessarily be the easiest way to get there, especially if you're not
> much used to PE cross compilation.
I am attempting to run Photoshop 2023 (WineHQ AppDB link
<https://appdb.winehq.org/objectManager.php?sClass=version&iId=41345>).
Photoshop 2023 requires D3D12 support, which is provided by VKD3D. However,
after testing, I found that VKD3D lacks support for the tiled resource
feature. As a result, I switched to VKD3D-Proton.
Unfortunately, when using VKD3D-Proton to run the program, new issues
arise. Specifically, its HLSL implementation (part of the VKD3D module)
seems to lack support for function overloads (source code reference
<https://gitlab.winehq.org/wine/vkd3d/-/blob/master/libs/vkd3d-shader/hlsl.y?ref_type=heads#L3014>
).
For example, the following code fails to compile:
```
float mod(float x, float y) {
}
float mod(float2 x, float2 y) {
}
float mod(float3 x, float3 y) {
}
void func1() {
...
float t0 = mod(t, 2.0f);
}
```
I chose to use the native version of d3dcompiler_47.dll to override the
built-in version, which bypassed this issue. I am still considering whether
to attempt fixing the problem in VKD3D.
Since this is a private project, I might not contribute the fix back to the
community. My apologies for that.
On Wed, Nov 27, 2024 at 5:47 PM Giovanni Mascellani <
[email protected]> wrote:
> Hi,
>
> Il 27/11/24 01:36, zhengxianwei ha scritto:
> > 1. It actually mentions two ways to test vkd3d. The first one is
> > available at: https://gitlab.winehq.org/wine/vkd3d/-/wikis/home
> > <https://gitlab.winehq.org/wine/vkd3d/-/wikis/home>
> > ```
> > Building Wine with Direct3D 12 support
> > Wine uses pkg-config to find vkd3d libraries. If vkd3d libraries are
> > installed system-wide, the Wine configure script should find the vkd3d
> > libraries automatically. You can also use PKG_CONFIG_PATH,
> > VKD3D_CFLAGS or VKD3D_LIBS to override pkg-config search
> > path, C compiler flags for libvkd3d, or linker flags for
> > libvkd3d, e.g.
> >
> > $ ../wine-git/configure PKG_CONFIG_PATH=$HOME/src/vulkan/install/lib/
> > pkgconfig
> > ```
> >
> > However, following the steps didn’t work. It seems that VKD3D_FLAGS and
> > VKD3D_LIBS have been deprecated?
>
> "Didn't work" is not a very complete or usable description of the
> problems you found, so it's hard to help you with that. However, if you
> want a build of vkd3d that is usable with Wine I think you're off course
> here. Page https://gitlab.winehq.org/wine/vkd3d/-/wikis/home is mostly
> about building vkd3d on a Linux/macOS system on its own, which is
> different to crosscompiling it to a .dll library (which is what you need
> to use it in Wine).
>
> > 2. The second method is the one you provided on this page:
> >
> > When I tried following the instructions on this page, I encountered many
> > issues. It seems to treat vkd3d as a .dll file instead of an .a file.
> > Additionally, during ./configure, it seems to treat the host environment
> > as Windows, requiring dependencies to be reinstalled even if they are
> > already installed. It doesn’t feel like a testing environment meant for
> > Ubuntu x64. Is that correct?
>
> As before, saying that you "encountered many issues" doesn't help me a
> lot with understand what these issues are. You should describe
> explicitly what you're trying to do and which problems you find if you
> want to hope that somebody will be able to help you.
>
> It's correct that you need to build vkd3d as a .dll library (what we
> call a PE build) if you want to use it within Wine, and it's true that a
> standard Ubuntu environment requires some work before it's able to host
> such a compilation process. All of that is described in the page I
> already linked to you. It's a bit lengthy, unfortunately, and it
> requires some non-trivial knowledge about how compilation works, or at
> least the availability to study a little bit to acquire said knowledge,
> but that's what it is.
>
> I can't help, though, wondering a little bit about what's your ultimate
> goal. Are you trying to play some particular game? Are you trying to add
> vkd3d support for some particular game? Are you trying to do some vkd3d
> development without having a particular application in mind? Depending
> on what's your real goal, compiling a PE build of vkd3d might not
> necessarily be the easiest way to get there, especially if you're not
> much used to PE cross compilation.
>
> Gio.
>
>
>