microsoft / OpenCLOn12

The OpenCL-on-D3D12 mapping layer
MIT License
104 stars 13 forks source link

Cl/GL interop extension #41

Closed jenatali closed 1 year ago

jenatali commented 1 year ago

This passes the CL CTS for GL sharing.

This exposes cl_khr_gl_sharing and cl_khr_gl_event. These extensions will only actually work when paired with GLOn12 from Mesa, either through WGL or EGL, and only when Mesa is built with the still-in-review https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242.

As far as implementation details, nothing too crazy. Mesa exports raw D3D12 device, queue, and resources which we then import into CL. Some annoying pieces to note:

This also fixes the problem with cl_khr_il_program that it wasn't exposed through clGetExtensionFunctionAddress[forPlatform] while exposing the new GL functions.

jenatali commented 1 year ago

This is a step towards #15.