News for hackers. Stuff that matters.
Re:Krita, OpenGL and Qt by formerly_proven on Saturday July 18, 2020 @07:54AM (#23880762)
If you want to implement an OpenFX [1] effect properly you have to write its core four times:

- A CUDA implementation, if the host uses CUDA

- A Metal implementation, for Apple

- An OpenCL implementation

- A fallback CPU-based implementation

- You don't need a DirectCompute implementation, because thankfully no one is idiotic enough to use it.

- You don't need a Vulkan implementation, because no one is doing compute on Vulkan (afaik).

The state of graphics and compute APIs is utter insanity. Especially Apple can go fuck off and die with their extremely moronic move of introducing OpenCL as an open standard in '09 and then presenting Metal as their closed API in '14, moving against OpenCL, OpenGL and Vulkan. nVidia at least has the excuse they were first to market with CUDA (and it's easier to program), and they stuck to it.

[1] THE standard for video effects, think "VST, but better and for video".

Re:Krita, OpenGL and Qt by dagmx on Saturday July 18, 2020 @11:28AM (#23882013)
OpenCL was also killed off by fractured support among vendors, especially nVidia who wanted to push CUDA. Now arguably CUDA is the better API/platform but so too is Metal versus OpenCL

WebGPU has compute I believe (or hopefully will) so could theoretically act as a good common API that isn’t controlled by a single vendors whims

Re:Krita, OpenGL and Qt by pjmlp on Sunday July 19, 2020 @04:16AM (#23887861)
AMD and Intel also don't have much love for it, as they rather push their own stacks that build on top of it, or complement it in some way.
Re:Krita, OpenGL and Qt by zozbot234 on Saturday July 18, 2020 @08:13AM (#23880856)
> The state of graphics and compute APIs is utter insanity.

It looks like Vulkan is going to be the best-supported common platform for compute, at least for modern hardware. They need compute in the standard to support the core graphics use case anyway, so we might as well use that same support for general-purpose tasks. On Apple platforms, MoltenVk can implement Vulkan support on top of Metal

Re:Krita, OpenGL and Qt by quikoa on Saturday July 18, 2020 @08:39AM (#23881014)
Yes, a common GPU compute platform would be great! Even if Apple isn't going to support it being able to handle all of it in Vulkan would be nice. Maybe OpenCL can be implemented on top of that.
Re:Krita, OpenGL and Qt by pjmlp on Sunday July 19, 2020 @05:33AM (#23888140)
That would be SYSCL with pluggable backends, as they also decided to move beyond OpenCL.
Re:Krita, OpenGL and Qt by pjmlp on Saturday July 18, 2020 @08:37AM (#23881008)
Because Khronos did not want to move OpenCL beyond an anemic C API, it was only the beating taken from CUDA that made them come up with SPIR, and for what OpenCL 3.0 is the admission of defeat.

By the way, Google also completely ignored OpenCL and came up with its own Renderscript dialect instead.

Re:Krita, OpenGL and Qt by Const-me on Saturday July 18, 2020 @09:08AM (#23881168)
Have you seen this? http://diligentgraphics.com/diligent-engine/

I have not tested on Apple, but I did on ARM Linux. Their HLSL to GLES GLSL translation worked OK for my purposes. In the documentation they say they support most of them for both graphics and compute, VK and Metal included.