Code Monkey home page Code Monkey logo

Comments (12)

reduz avatar reduz commented on May 3, 2024 2

@iwubcode We extracted the relevant bits from the MESA repository and now go via NIR. Probably still not ideal,but it works a lot better than SPIRV Cross -> HLSL -> DXIL.

Still hoping this project or another would write a dedicated converter at some point, as I think it should probably be easier to go SPIRV->DXIL, given how complex DXIL is in comparison.

godotengine/godot#70315

from dxil-spirv.

K0bin avatar K0bin commented on May 3, 2024

Have you considered doing SPIR-V -> HLSL with SPIRV-Cross and then running that through dxc?

from dxil-spirv.

reduz avatar reduz commented on May 3, 2024

Yes, but for performance (and amount of failure points) reasons a more direct approach may be preferred.

from dxil-spirv.

doitsujin avatar doitsujin commented on May 3, 2024

DXIL to SPIR-V

This is exactly what this project does.

from dxil-spirv.

reduz avatar reduz commented on May 3, 2024

@doitsujin my mistake, meant the opposite way.

from dxil-spirv.

nanokatze avatar nanokatze commented on May 3, 2024

https://gitlab.freedesktop.org/mesa/mesa/-/tree/main/src/microsoft/spirv_to_dxil

from dxil-spirv.

reduz avatar reduz commented on May 3, 2024

@nanokatze I think I have seen this in the past, but it relies for the most part on the Mesa IL right? Its a huge amount of code. Maybe it could be extracted?

from dxil-spirv.

HansKristian-Work avatar HansKristian-Work commented on May 3, 2024

Emitting LLVM (has to be 3.7 version specifically) is a bit of a shitshow, but that's the main issue with emitting DXIL, although it is completely out of scope of this project. RenderDoc should have a DXIL emitter I think, although not sure how practical that is to use for SPIR-V translation.

Another issue is emitting the DXIL in the exact way that DXIL validators like. It's not documented at all, but not exactly sure how difficult it is to deal with.

Emitting subgroup operations properly is also quite awkward with control flow (or lack there of) being what it is in DXIL.

from dxil-spirv.

reduz avatar reduz commented on May 3, 2024

@HansKristian-Work

I see, its kind of a shame that no simple way to do this conversion exists. SPIRV-Cross has it out of scope, as well as this project. MESA has a converter but its entirely dependent on lots of MESA files.

This makes it very difficult to work on multi platform code that uses SPIR-V universally, as it is not possible to easily/efficiently convert to DXIL.

from dxil-spirv.

HansKristian-Work avatar HansKristian-Work commented on May 3, 2024

Do you also support DX11? You'll probably have the same problem with DXBC there.

from dxil-spirv.

reduz avatar reduz commented on May 3, 2024

No, no interest from our part in suporting DX11, only Vulkan level APIs.

from dxil-spirv.

iwubcode avatar iwubcode commented on May 3, 2024

@reduz - curious what you ended up doing? Currently we use glsang to take GLSL to SPIRV and then SPIRV-Cross to go to HLSL...then go to DXIL (DX12 backend) and DXBC (DX11 backend). It works but it's in realtime and is quite slow, cutting out a step would be very helpful (even if only for DX12).

I did open an issue on DirectXShaderCompiler but not expecting much.

from dxil-spirv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.