cogciprocate / ocl

OpenCL for Rust
Other
721 stars 75 forks source link

DirectX D3D11 interop #212

Closed AdrianEddy closed 1 year ago

AdrianEddy commented 1 year ago
  1. Added functions:
    • Image::from_d3d11_texture2d
    • Image::from_d3d11_texture3d
    • Image::d3d11_acquire
    • Image::d3d11_release
    • Buffer::from_d3d11_buffer
    • Buffer::d3d11_acquire
    • Buffer::d3d11_release
  2. Supports both cl_khr_d3d11_sharing and cl_nv_d3d11_sharing extension
  3. Fixed get_gl_context_info_khr
    • I noticed the debugging note, I had the same crashes with D3D11 extension functions, so I figured out the cause, fixed the method call and verified this function now works so I removed the [INOPERATIVE] comment. This closes #87
  4. Implemented ImageCmd::CopyToBuffer and BufferCmd::CopyToImage
  5. Tested OpenGL and DirectX interop on Windows, as well as OpenGL interop on macOS, everything worked for me

Also as a drive by, I included changes from #197 (which closes #196) as they were clear typos in the function signature

Also while going through issues in the repo, I noticed #200, #140, can be already closed.

BTW, great job on this crate really, it makes OpenCL usage so easy and the code is very well structured and covers a lot of APIs and cases, I really appreciate your work here

c0gent commented 1 year ago

Looks great! I'll have to create an example or something to test it but I see no reason not to merge this.

Would you mind doing a rustfmt pass?

Appreciate your time and effort :)

AdrianEddy commented 1 year ago

I just did a cargo fmt today in order to bring this PR up to date with master, so it should be formatted correctly. For reference, I'm using it here and it works very well for me.