Compiling DirectXShaderCompiler on Linux/macOS #1236

Closed
Cry-Mory opened this Issue Apr 17, 2018 · 22 comments

Comments

Projects
None yet
9 participants
@Cry-Mory

Cry-Mory commented Apr 17, 2018

Do you know if is it possible to compile DirectXShaderCompiler on Linux? It is mainly for having the compiler to generate SPIR-V shaders for Vulkan from HLSL sources on Linux.

@Zingam

This comment has been minimized.

Show comment
Hide comment
@Zingam

Zingam Apr 19, 2018

I thought of asking the same. You should support Linux and possibly MacOS as the latter got a VulkanSDK.
One of my worst work experiences were having to compile the resources and run the code generation tools on Windows and then transferring them over to MacOS every morning and sometimes multiple time per day. The project itself was an iOS one.

Zingam commented Apr 19, 2018

I thought of asking the same. You should support Linux and possibly MacOS as the latter got a VulkanSDK.
One of my worst work experiences were having to compile the resources and run the code generation tools on Windows and then transferring them over to MacOS every morning and sometimes multiple time per day. The project itself was an iOS one.

@oscarbg

This comment has been minimized.

Show comment
Hide comment
@oscarbg

oscarbg Apr 19, 2018

DXC doesn't work with wine in the meanwhile?

oscarbg commented Apr 19, 2018

DXC doesn't work with wine in the meanwhile?

@gwihlidal

This comment has been minimized.

Show comment
Hide comment

gwihlidal commented Apr 20, 2018

Also see: #1082

@antiagainst

This comment has been minimized.

Show comment
Hide comment
@antiagainst

antiagainst May 8, 2018

Collaborator

Our primary goal is to get DXC/SPIR-V production ready on Windows. With that said, we consider DXC/SPIR-V as mature-ish ATM. So we started looking into Linux support. @ehsannas is driving the effort. So, stay tuned. ;-P

Collaborator

antiagainst commented May 8, 2018

Our primary goal is to get DXC/SPIR-V production ready on Windows. With that said, we consider DXC/SPIR-V as mature-ish ATM. So we started looking into Linux support. @ehsannas is driving the effort. So, stay tuned. ;-P

@ehsannas ehsannas self-assigned this May 8, 2018

@ehsannas

This comment has been minimized.

Show comment
Hide comment
@ehsannas

ehsannas May 8, 2018

Collaborator

We have started looking into porting DXC to Linux. We have reached some promising initial results, but there is a lot of work to be done to make things production quality.

Over the coming weeks/months we will be communicating with Microsoft to make sure we reach a robust and clean solution. Stay tuned :)

Collaborator

ehsannas commented May 8, 2018

We have started looking into porting DXC to Linux. We have reached some promising initial results, but there is a lot of work to be done to make things production quality.

Over the coming weeks/months we will be communicating with Microsoft to make sure we reach a robust and clean solution. Stay tuned :)

@Zingam

This comment has been minimized.

Show comment
Hide comment
@Zingam

Zingam May 8, 2018

@ehsannas Great! BTW. Would it make sense to add DXC as a package to vcpkg as the latter is supported on Linux/Mac now?

Zingam commented May 8, 2018

@ehsannas Great! BTW. Would it make sense to add DXC as a package to vcpkg as the latter is supported on Linux/Mac now?

@antiagainst

This comment has been minimized.

Show comment
Hide comment
@antiagainst

antiagainst May 8, 2018

Collaborator

@Zingam: We can discuss vkpkg support in #715 and leave this issue focusing on Linux support. ;-P

Collaborator

antiagainst commented May 8, 2018

@Zingam: We can discuss vkpkg support in #715 and leave this issue focusing on Linux support. ;-P

@Zingam

This comment has been minimized.

Show comment
Hide comment
@Zingam

Zingam May 9, 2018

Will the Linux version output SPIRV or also DXIL?

Zingam commented May 9, 2018

Will the Linux version output SPIRV or also DXIL?

@antiagainst

This comment has been minimized.

Show comment
Hide comment
@antiagainst

antiagainst May 9, 2018

Collaborator

The plan of record is to support both.

Collaborator

antiagainst commented May 9, 2018

The plan of record is to support both.

@biojppm

This comment has been minimized.

Show comment
Hide comment
@biojppm

biojppm May 10, 2018

I am also interested in this and I'd like to help. Have you made any progress so far, or do you have some suggestions where to start?

biojppm commented May 10, 2018

I am also interested in this and I'd like to help. Have you made any progress so far, or do you have some suggestions where to start?

@antiagainst antiagainst changed the title from Question: Compiling DirectXShaderCompiler on Linux to Compiling DirectXShaderCompiler on Linux May 10, 2018

@antiagainst antiagainst referenced this issue in google/DirectXShaderCompiler Jun 22, 2018

Merged

[linux-port] Add DxcOnLinux documentation file. #250

@ehsannas

This comment has been minimized.

Show comment
Hide comment
@ehsannas

ehsannas Jun 25, 2018

Collaborator

Hi all, thanks for your patience while we worked on getting DXC working on Linux!

I'm pleased to say that our fork has reached the point where you can compile and run DXC on Linux (and macOS)! You can give it a try by checking out the linux branch in our fork. For complete details on how to build and run, please see our documentation.

We have already started, and will continue to post pull-requests to the Microsoft repository in order to get the Microsoft/master branch working on Linux! At that point, we will stop development on our fork, and contribute directly to the Microsoft repository.

Collaborator

ehsannas commented Jun 25, 2018

Hi all, thanks for your patience while we worked on getting DXC working on Linux!

I'm pleased to say that our fork has reached the point where you can compile and run DXC on Linux (and macOS)! You can give it a try by checking out the linux branch in our fork. For complete details on how to build and run, please see our documentation.

We have already started, and will continue to post pull-requests to the Microsoft repository in order to get the Microsoft/master branch working on Linux! At that point, we will stop development on our fork, and contribute directly to the Microsoft repository.

@hekota

This comment has been minimized.

Show comment
Hide comment
@hekota

hekota Jun 25, 2018

Member

That is great news! And my apologies for some of the code reviews taking so long. Two people left our team so we are quite busy.

Member

hekota commented Jun 25, 2018

That is great news! And my apologies for some of the code reviews taking so long. Two people left our team so we are quite busy.

@gwihlidal

This comment has been minimized.

Show comment
Hide comment
@gwihlidal

gwihlidal Jun 25, 2018

Thank you so much! This is excellent news

Thank you so much! This is excellent news

@ehsannas

This comment has been minimized.

Show comment
Hide comment
@ehsannas

ehsannas Jun 25, 2018

Collaborator

Thanks @hekota for the code reviews :)

Collaborator

ehsannas commented Jun 25, 2018

Thanks @hekota for the code reviews :)

@hekota

This comment has been minimized.

Show comment
Hide comment
@hekota

hekota Jun 25, 2018

Member

Np :)

Member

hekota commented Jun 25, 2018

Np :)

@antiagainst

This comment has been minimized.

Show comment
Hide comment
@antiagainst

antiagainst Jun 25, 2018

Collaborator

And we must thank @pow2clk for all his awesome work, without which we definitely cannot achieve it so quickly. Kudos to @pow2clk!

Collaborator

antiagainst commented Jun 25, 2018

And we must thank @pow2clk for all his awesome work, without which we definitely cannot achieve it so quickly. Kudos to @pow2clk!

@ehsannas

This comment has been minimized.

Show comment
Hide comment
@ehsannas

ehsannas Jun 25, 2018

Collaborator

Absolutely! Thank you @pow2clk!

Collaborator

ehsannas commented Jun 25, 2018

Absolutely! Thank you @pow2clk!

@Zingam

This comment has been minimized.

Show comment
Hide comment
@Zingam

Zingam Jun 25, 2018

@ehsannas Will the Linux build be available on AppVayor?

Zingam commented Jun 25, 2018

@ehsannas Will the Linux build be available on AppVayor?

@gwihlidal

This comment has been minimized.

Show comment
Hide comment
@gwihlidal

gwihlidal Jun 25, 2018

For anyone interested, I've containerized this in Docker now and pushed an image to Docker Hub

docker run --rm gwihlidal/dxc -help
docker run --rm -v $(pwd):$(pwd) -w $(pwd) gwihlidal/dxc -T <target> -E <entry-point-name> <input-hlsl-file>

For anyone interested, I've containerized this in Docker now and pushed an image to Docker Hub

docker run --rm gwihlidal/dxc -help
docker run --rm -v $(pwd):$(pwd) -w $(pwd) gwihlidal/dxc -T <target> -E <entry-point-name> <input-hlsl-file>
@antiagainst

This comment has been minimized.

Show comment
Hide comment
@antiagainst

antiagainst Jun 25, 2018

Collaborator

@Zingam: we'll coordinate with Microsoft to see how we can proceed with that.

Collaborator

antiagainst commented Jun 25, 2018

@Zingam: we'll coordinate with Microsoft to see how we can proceed with that.

@pow2clk

This comment has been minimized.

Show comment
Hide comment
@pow2clk

pow2clk Jun 25, 2018

Contributor

Thanks to all involved as well! You made it easy and fun to contribute and I appreciate it. 😄

Contributor

pow2clk commented Jun 25, 2018

Thanks to all involved as well! You made it easy and fun to contribute and I appreciate it. 😄

@antiagainst antiagainst changed the title from Compiling DirectXShaderCompiler on Linux to Compiling DirectXShaderCompiler on Unix Jun 26, 2018

@antiagainst antiagainst changed the title from Compiling DirectXShaderCompiler on Unix to Compiling DirectXShaderCompiler on Linux/macOS Jun 26, 2018

@ehsannas

This comment has been minimized.

Show comment
Hide comment
@ehsannas

ehsannas Jun 28, 2018

Collaborator

Hi all,

The Microsoft/master branch is now in sync with our fork. I am able to successfully build and run the current Microsoft/master branch on Linux.
Thanks @marcelolr for your support of this effort. Thanks @hekota , @antiagainst, and @pow2clk for all the code reviews and contributions.

We will contribute directly to the Microsoft repository in case any improvements are needed.

Collaborator

ehsannas commented Jun 28, 2018

Hi all,

The Microsoft/master branch is now in sync with our fork. I am able to successfully build and run the current Microsoft/master branch on Linux.
Thanks @marcelolr for your support of this effort. Thanks @hekota , @antiagainst, and @pow2clk for all the code reviews and contributions.

We will contribute directly to the Microsoft repository in case any improvements are needed.

@ehsannas ehsannas closed this Jun 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment