Cauldron icon indicating copy to clipboard operation
Cauldron copied to clipboard

Linux and GCC support

Open Zakhrov opened this issue 5 years ago • 10 comments

I have cleaned up the Vulkan backend to get it to compile on Linux with GCC 9.1 and replaced the DirectXMath library with GLM. The code compiles successfully and creates the static libraries but I haven't been able to run the glTFSample project

Zakhrov avatar Jul 24 '19 09:07 Zakhrov

I don't have time to try it on Windows again, did you try it ?

I just had a quick look at the changes and at the code quality of this repo in general. Has this sdk been reviewed by someone before ? Lots of random spaces, lack of name consistency, src contains a different license file and other "basic" workflow stuff that shouldn't be commit like that.

I would suggest that a cleanup occur before this PR is applied, so the change is a bit clearer, and maybe travis is also added so we can ensure Cross platform compatibility at least at build time. Maybe lets get some info about other gpuopen repos like: https://github.com/GPUOpen-LibrariesAndSDKs/Anvil https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator

YvanDaSilva avatar Jul 24 '19 10:07 YvanDaSilva

please, add build $ cmake .. -DGFX_API=VK/DX12 to build instructions in readme.md

luntik2012 avatar Jul 24 '19 14:07 luntik2012

please, add build $ cmake .. -DGFX_API=VK/DX12 to build instructions in readme.md,

Done in the latest commit on my fork

Zakhrov avatar Jul 24 '19 15:07 Zakhrov

@Zakhrov I've updated a bit your branch with further fixes. Now Cauldron compiles on Windows and Linux, but there is a big amount of work to get it into the working state.

https://github.com/Mixaill/Cauldron/tree/linux-fixes

Mixaill avatar Jul 28 '19 20:07 Mixaill

@Zakhrov I've updated a bit your branch with further fixes. Now Cauldron compiles on Windows and Linux, but there is a big amount of work to get it into the working state.

https://github.com/Mixaill/Cauldron/tree/linux-fixes

I still had problems resolving <DirectXMath.h> It seems to be working now that I passed in a relative include path. I still have to see if the glTFSample compiles

Zakhrov avatar Jul 30 '19 08:07 Zakhrov

Maintainer here, just to set some expectations, the plan is to not support linux officially (maybe for now) but I still pay attention to all your comments and suggestions, so from now on I will try to be more GCC friendly :)

aguaviva avatar Jul 30 '19 12:07 aguaviva

Maintainer here, just to set some expectations, the plan is to not support linux officially (maybe for now) but I still pay attention to all your comments and suggestions, so from now on I will try to be more GCC friendly :)

OK thanks for letting us know. Will close the PR for now

Zakhrov avatar Jul 30 '19 12:07 Zakhrov

For the sake of cross-references: this fixes https://github.com/GPUOpen-LibrariesAndSDKs/Cauldron/issues/1

Hi-Angel avatar Jul 15 '21 18:07 Hi-Angel

I've updated the code to Cauldron V1.4.1 and fixed the build errors with GCC. There is still a lot of work to be done before its actually usable though.

TODO

  • Create Linux specific Vulkan surfaces using VkXlibSurfaceCreateInfoKHR and VkWaylandSurfaceCreateInfoKHR
  • Port sample glTF projects to Linux

Some doubts

  • Can we move the Vulkan components from DirectXMath to GLM? I'm right now using a patched fork of DirectXMath that compiles without the sal.h headers that are Windows specific. I don't think that would be feasible in the long run.
  • It looks like it uses the DirectX shader compiler for compiling shaders on both DX12 and Vulkan. Can we use the default SPV shader compiler along with GLSL vertex and fragment shaders on Vulkan?

Zakhrov avatar Jul 16 '21 10:07 Zakhrov

Can we move the Vulkan components from DirectXMath to GLM? I'm right now using a patched fork of DirectXMath that compiles without the sal.h headers that are Windows specific. I don't think that would be feasible in the long run.

  • You should just use the vanilla DirectXMath and MIT-licensed SAL from https://github.com/dotnet/corert/blob/master/src/Native/inc/unix/sal.h
  • At the first look there are only few usages of DirectXMath (Vec3/Vec4 and several constants), the other math was converted to the Sony vectormath library. I think it should be easy to eliminate DirectXMath usage for non-D3D code at least.
  • GLM is not needed at all.

It looks like it uses the DirectX shader compiler for compiling shaders on both DX12 and Vulkan. Can we use the default SPV shader compiler along with GLSL vertex and fragment shaders on Vulkan?

  • We can switch from the prebuilt binaries to the github version https://github.com/Microsoft/DirectXShaderCompiler

TODO

Mouse/Keyboard handling for the ImGui should be implemented too. Looks like it is worth to outsource Mouse/Keyboard and Window handling to something like SDL2.

Mixaill avatar Jul 16 '21 11:07 Mixaill