5 ms·
Blender decided to support just the platforms which have a C++ target device language. This encompasses CUDA, Metal[1] (one of the reasons why it’s much more u
by my123 5y ago
Blender decided to support just the platforms which have a C++ target device language.
This encompasses CUDA, Metal[1] (one of the reasons why it’s much more usable than Vulkan), ROCm HIP, and oneAPI[2].
[1] Metal’s Shading Language is C++14 with a handful of limitations, the biggest one is no lambdas
[2] Vulkan uses a restricted SPIR-V dialect without pointers notably. OpenCL and oneAPI use a separate one which _does_ support them. However, AMD[3] and NVIDIA do not implement SPIR-V in their OpenCL drivers.
[3] it’s a trainwreck, they supported the original SPIR but then https://community.amd.com/t5/opencl/spir-support-in-new-drivers-lost/td-p/170165 https://community.amd.com/t5/opencl/spir-support-in-new-driv... happened. It never came back since then.
Migrating back down to GLSL/HLSL from that makes absolutely no sense. The options above, using C++ as a device language, allow much more code sharing with a CPU backend.
Portability is also a good story, the adaptation is mostly in the glue layer, if your GPU vendor is _not_ AMD and has a proper software stack.
- pjmlp 5y agoIndeed, and a reason why Khronos only adopted SPIR-V and is now slowly embracing C++. They took a hard beating from proprietary APIs that have long moved away from "C is the best" approach, and now they are playing catch-up with the rest of the world cozy in their mature C++ tooling for the GPGPU.
- my123 5y agoNote that Microsoft had C++ AMP on that front, https://docs.microsoft.com/en-us/cpp/parallel/amp/cpp-amp-overview?view=msvc-170 https://docs.microsoft.com/en-us/cpp/parallel/amp/cpp-amp-ov.... That worked on DirectX devices as a whole. However, MS failed to capitalise on it and bailed out (too early). Has been limping along dead since years, finally acknowledged as deprecated in VS2022.
- pjmlp 5y agoI think that they rather decided to capitalize in HLSL, DirectX Compute, and mesh shaders instead, given the lack of love for C++AMP at ISO.