The most similar device we have now is Optix, since that also handles acceleration structure building itself. You can search the code for “optix” and integrate in all the same places.
The implementation would have to be done in Objective-C++, using Swift to interact with other C++ code would add too much complexity, and we don’t want to require Blender/Cycles developers to learn another programming language if we can avoid it.
Thanx for the link, I didn’t find it at first. Even if I already found with Xcode and debugger the code which run when we do a rendering. But a global picture about the approach will be helpful.
Ok for ObjC++, I am an old ObjC / C++ dev
The Apple exemples for ray tracing and denoising are in ObC by the way
I am going to invest my free time on this, looking if I can do something.
This theoretic design needs to be tested. But I believe this is very likely feasible because #1 to #2 is how OpenCL works. (and #3 has been used by some dev teams from what I can see)
I don’t have time for this but this idea is just waiting for someone to make it a reality.
None of those things seem production ready, I recently tried a similar path to vulkan with clspv which uses a similar path, it may work for a simple a = b+c example but it did not have a super good time with cycles.
In all honesty, i only took an quick glance at metal but nothing looked like it would be a bad match for cycles, i don’t think stacking intermediary conversion layers are the solution here, any capable dev that can make that house of cards work can most likely do a native metal port of cycles in less time.
I’ve been investigating the LOE for implementing a Metal device for Cycles, it seems pretty doable. I’d like to play with getting it to work in my spare time. One thing I’m unsure about is how to test the accuracy of the renders. Is there a reference/test suite for Cycles?
I’ve made a little progress so far, mostly with bringing the shared kernel headers into a Metal file and fixing compilation issues. It’s a bit slow and tedious because Metal requires that pointers be annotated with which memory space they’re pointing to, so I’m having to add lots annotations. But it ultimately seems doable. I’ve had less time lately due to work and travel but now with being stuck at home I’ll hopefully be making more progress in the next few weeks.
Thank you so much! Keep is updated, if you set up a donation/patreon I’ll bet a ton of people would pay in to support your time.
I’ve tried boot camp, linux, but honestly I would love to be able to run cycles on the GPU on my favorite OS!
There are a lot of creative types that live on Mac and having Metal support will increase the Blender fan base that much more.
You’re the real MVP. Wishing you the best in this!! I’m tired of having to boot into Windows to get acceptable performance. If I knew anything about GPU stuff I’d totally pitch in… but alas, the extent of MY knowledge is CoreGraphics on iOS.
I’m guessing you decided to add this little gem to the discussion because you’ve got some strange notion that when Autodesk and Maxon port their 3d applications to MacOS, the very first thing they do is peel off a dozen or so developers to refactor their applications’ entire codebase to swift?
Hey I just found this thread while googling “Blender Metal support”… I’m not a dev so I can’t help you there, but I would definitely subscribe to your patreon as well if that helps
That’s amazing, as other people wrote, I’m really interested in Cycles Metal support and i would support donation wise or even a paying plug in as well, or Patreon for making this happen, i see there a big request for this feature around. Thanks a lot and hope you share updates regarding your project
I’d also be happy to support Cycles Metal project on some crowdfunding platform. Even instead of supporting Blender due to the abandonment of the Mac platform by Blender Institute.
@DrewFitz, do you have any git/hub branch to look at the code you’ve done so far? I’m just curious what the code might look like. I’m an experienced ObjC programmer (among various langs), but not GPU related per se. And I only have Macs for personal use, and thus have some interest in it’s development.
To give a quick update and address some comments: I’ve not had much time for progress on this recently with a large project wrapping up at work. Sorry! As for Patreon or other support, that’s very nice but I’m much more constrained for time than money working on this. I’m a Mac & iOS dev as a day job and it’s hard to do even more of that after a long day. However, since that large project is nearly wrapped up, I’ll be less busy and worn out after work so I’m excited to make more progress soon. Thanks all!