bkaradzic / bgfx.cmake

CMake build scripts for bgfx. Released under public domain.
Creative Commons Zero v1.0 Universal
209 stars 110 forks source link

Add direct3d shaderc support on linux #218

Closed MRNIU closed 9 months ago

MRNIU commented 11 months ago

To adapt to the changes in https://github.com/bkaradzic/bgfx/commit/4c0baf5603626b328e25c26b23b1e0ceda029178 and https://github.com/bkaradzic/bgfx/commit/f14c14a48554de4e66a4b2334f623d988c06f36d

bwrsandman commented 11 months ago

Looks like you left some dx9 references.

MRNIU commented 11 months ago

@bwrsandman cleared, thank you

bwrsandman commented 11 months ago

Seems to be failing because the commited submodules are from before https://github.com/bkaradzic/bgfx/commit/f14c14a48554de4e66a4b2334f623d988c06f36d. Normally, at the start of every month, I update the submodules with dependabot.

The PR by dependabot should open tomorrow, so I will test and merge these two tomorrow.

bwrsandman commented 11 months ago

This command on linux does not work. Do you know why?

$ build/cmake/bgfx/shaderc -f bgfx/examples/01-cubes/vs_cubes.sc -i bgfx/src -o bgfx/examples/runtime/shaders/dx11/vs_cubes.bin --platform windows --type vertex --profile s_5_0 -O 3
HLSL compiler is not supported on this platform.
Failed to build shader.
MRNIU commented 11 months ago

It seems that shaderc where not support d3d on linux yet(SHADERC_CONFIG_HLSL is false, shaderc.h#L15). Maybe we should take up this issue?

bwrsandman commented 11 months ago

Does it make sense then to add s_4_0 and s_5_0 to the linux platform given that fail?

bwrsandman commented 11 months ago

Doing some testing, it seems like it tries to load d3d11.so and when it can't find it, it loads another renderer. I believe this only happens on WSL but I could be wrong.

bwrsandman commented 9 months ago

After a month of inactivity, I'm closing this PR. Feel free to re-open it if you have updates!