Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install vkd3d on Linux/macOS #29

Merged
merged 3 commits into from
Oct 28, 2024

Conversation

madebr
Copy link
Contributor

@madebr madebr commented Oct 27, 2024

In libsdl-org/SDL_ttf#412 (comment), I was informed efxc.exe is needed for compiling directx11 shaders.

This pr builds efxc2 on ever platform as a Windows executable,
and also installs it.
A later pr can wrap the fxc.exe in a shell script calling wine fxc.exe.

After this pr, a linux install prefix (including all deps) looks like this:

SDL3_gpu_shadercross-3.0.0-linux-x64
├── bin
│   └── shadercross
├── include
│   └── SDL3_gpu_shadercross
│       └── SDL_gpu_shadercross.h
├── lib
│   ├── cmake
│   │   └── SDL3_gpu_shadercross
│   │       ├── SDL3_gpu_shadercrossConfig.cmake
│   │       ├── SDL3_gpu_shadercrossConfigVersion.cmake
│   │       ├── SDL3_gpu_shadercross-shared-targets.cmake
│   │       ├── SDL3_gpu_shadercross-shared-targets-noconfig.cmake
│   │       ├── SDL3_gpu_shadercross-static-targets.cmake
│   │       └── SDL3_gpu_shadercross-static-targets-noconfig.cmake
│   ├── libdxcompiler.so
│   ├── libdxil.so
│   ├── libSDL3_gpu_shadercross.a
│   ├── libSDL3_gpu_shadercross.so -> libSDL3_gpu_shadercross.so.0
│   ├── libSDL3_gpu_shadercross.so.0 -> libSDL3_gpu_shadercross.so.0.0.0
│   ├── libSDL3_gpu_shadercross.so.0.0.0
│   ├── libSDL3.so.0 -> libSDL3.so.0.1.5
│   ├── libSDL3.so.0.1.5
│   ├── libspirv-cross-c-shared.so -> libspirv-cross-c-shared.so.0
│   ├── libspirv-cross-c-shared.so.0 -> libspirv-cross-c-shared.so.0.64.0
│   ├── libspirv-cross-c-shared.so.0.64.0
│   ├── libvkd3d-shader.so -> libvkd3d-shader.so.1.11.0
│   ├── libvkd3d-shader.so.1 -> libvkd3d-shader.so.1.11.0
│   ├── libvkd3d-shader.so.1.11.0
│   ├── libvkd3d.so -> libvkd3d.so.1.13.0
│   ├── libvkd3d.so.1 -> libvkd3d.so.1.13.0
│   ├── libvkd3d.so.1.13.0
│   ├── libvkd3d-utils.so -> libvkd3d-utils.so.1.5.2
│   ├── libvkd3d-utils.so.1 -> libvkd3d-utils.so.1.5.2
│   ├── libvkd3d-utils.so.1.5.2
│   └── pkgconfig
│       └── sdl3-gpu-shadercross.pc
└── share
    └── licenses
        ├── dxc
        │   ├── LICENSE-LLVM.txt
        │   └── LICENSE-MS.txt
        ├── SDL3_gpu_shadercross
        │   └── LICENSE.txt
        ├── spirv-cross
        │   └── LICENSE
        └── vkd3d
            └── COPYING

@madebr madebr marked this pull request as draft October 28, 2024 00:30
@thatcosmonaut
Copy link
Collaborator

I'm really not sure that this is necessary. FXC is effectively just a D3DCompile frontend, and the shadercross library is already calling into D3DCompile to produce DXBC bytecode.

@madebr madebr force-pushed the efcx-exe-for-each-platform branch 13 times, most recently from 02b4865 to 84b9124 Compare October 28, 2024 20:23
@madebr
Copy link
Contributor Author

madebr commented Oct 28, 2024

I'm really not sure that this is necessary. FXC is effectively just a D3DCompile frontend, and the shadercross library is already calling into D3DCompile to produce DXBC bytecode.

Indeed. Installing vkd3d does the job as well.

@madebr madebr marked this pull request as ready for review October 28, 2024 20:28
@madebr madebr changed the title Efcx exe for each platform install vkd3d on Linux/macOS Oct 28, 2024
@madebr madebr changed the title install vkd3d on Linux/macOS Install vkd3d on Linux/macOS Oct 28, 2024
Comment on lines +348 to +349
elseif(APPLE)
# FIXME: Apple probably needs to do something similar as Linux, but using otool
Copy link
Contributor Author

@madebr madebr Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ready.

Using shadercross of a downloaded linux archive, I could create dxbc shaders for the SDL_ttf example libsdl-org/SDL_ttf#412

There might still be an issue with macOS due to missing rpaths.

@madebr madebr merged commit 1897239 into libsdl-org:master Oct 28, 2024
4 checks passed
@madebr madebr deleted the efcx-exe-for-each-platform branch October 28, 2024 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants