Concisely describe the proposed feature
I would like to add a DirectX (I'm thinking of D3D11 for now) backend to the compiler so that I can have one more way to utilize the integrated GPU in my laptop.
Describe the solution you'd like (if any)
I feel inclined to follow the OpenGL backend's approach (emitting GLSL source) since HLSL (the shader language used by D3D11 and D3D12) is similar to GLSL in many ways.
Additional comments
I had been working on a little game with both D3D11 and OpenGL rendering paths, and it appears to me that in Windows, the overhead for creating buffers and issuing draw calls with D3D11 is much lower than with OpenGL (by profiling with GPUView and RenderDoc), so I'm curious if DX can bring a slightly better user experience for Taichi in Windows.
I will start by studying the existing backends (standing on the shoulders of the giants) (:
Welcome on board! Adding a DirectX backend would be great for Windows users.
I think following the OpenGL backend's implementation shoulds reasonable. I'm not familiar with DirectX, but HLSL sounds like the only mature way to create DX shaders. There are other projects like https://github.com/microsoft/DirectXShaderCompiler - not sure if they provide a more useable alternative approach for shader code generation (e.g. compiling LLVM IR to DX shaders, if there's any chance...)
I will start by studying the existing backends (standing on the shoulders of the giants) (:
Experts on this are @archibate and @k-ye. If you speak Chinese, welcome to our 0-th TaichiCon event: https://zhuanlan.zhihu.com/p/139627994 We will share some development experience there and uploaded the slides after the event :-)
Thanks! Yes I actually attended the 0th TaichiCon evnet (:
I remember a participant noted SPIR-V, and potential paths to support multiple backends such as from Vulkan to D3D12 & OpenGL & WebGL, and I feel that might be great for a long-term plan (b/c I'm not familiar with Vulkan) ..
I guess my priority now might be to have something woring first so I'll try to come up with something with D3D11 and HLSL. Archibate and K-ye's presentation gave me a lot of inspirations & I will read into the Taichi language and try to get started. (:
Nice! FYI, all the backends are in this directory: https://github.com/taichi-dev/taichi/tree/master/taichi/backends (you probably already know)..
Most helpful comment
Welcome on board! Adding a DirectX backend would be great for Windows users.
I think following the OpenGL backend's implementation shoulds reasonable. I'm not familiar with DirectX, but HLSL sounds like the only mature way to create DX shaders. There are other projects like https://github.com/microsoft/DirectXShaderCompiler - not sure if they provide a more useable alternative approach for shader code generation (e.g. compiling LLVM IR to DX shaders, if there's any chance...)
Experts on this are @archibate and @k-ye. If you speak Chinese, welcome to our 0-th TaichiCon event: https://zhuanlan.zhihu.com/p/139627994 We will share some development experience there and uploaded the slides after the event :-)