Ahr0n wrote: Mon Jun 29, 2020 4:03 pm
Dade - the first step is done. What's next?
Ok, first an introduction to the hardware abstraction layer in LuxCoreRender than a couple of questions.
LuxCoreRender internal hardware abstraction layer: HardwareDevice
LuxCore has the generic concept of "HardwareDevice" (
https://github.com/LuxCoreRender/LuxCor ... ice.h#L113) and it will able to work with anything implementing this interface. It includes few basic operations like:
- allocating/freeing memory on a device;
- transferring memory from/to a device;
- compiling a kernel;
- executing a kernel.
LuxCore use an "HardwareDevice" to run the image pipeline.
While it is not going to be particularly fancy to run image pipeline on Metal, it is the first step and milestone we can reach (like I did with CUDA). Once this works, 90% of work is likely to be done.
You can find some additional detail here:
viewtopic.php?f=5&t=1974
LuxCoreRender internal hardware abstraction layer: HardwareIntersectionDevice
HardwareIntersectionDevice (
https://github.com/LuxCoreRender/LuxCor ... ondevice.h) is an extended version of the HardwareDevice and has only one additional feature:
- tracing an array of rays in a scene.
LuxCore uses an "HardwareIntersectionDevice" to run all GPU render engines. An implementation of HardwareIntersectionDevice will allow to run all GPU rendering engines on Metal.
Some question
To have an idea of the amount of work required, I have a couple of questions:
- OpenCL C was trivial to compile with CUDA (i.e. at the end of the day is just C with a couple of additional functions). What kind of kernel language does Metal use ?
- OpenCL is able to compile kernels at runtime. CUDA is able too by using the NVRTC library (
https://docs.nvidia.com/cuda/nvrtc/index.html). How does Metal work ? Does it compile GPU kernels at runtime or only statically ?