Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metal Support #88

Open
pollend opened this issue Aug 27, 2024 · 11 comments
Open

Metal Support #88

pollend opened this issue Aug 27, 2024 · 11 comments
Labels
enhancement New feature or request in progress Issue is in progress

Comments

@pollend
Copy link
Contributor

pollend commented Aug 27, 2024

would there be a problem with introducing support for metal. I would like to use this for some metal applications would there be any problems if I could work on adding support.

@dzhdanNV
Copy link
Collaborator

Hi Michael! Sure! Currently NRI can be used on Apple via MoltenVK, but, of course, it's worse than native Metal. I'm happy to accept a new implementation (even with limited functionality).

Notes:

  • better wait for 2-3 days before I add "shading rate" support
  • I promise to not touch interface after this update (well, I have been doing only name changes for the goodness of the API. I'm almost satisfied now)

@pollend
Copy link
Contributor Author

pollend commented Aug 28, 2024

I need to do some research on how I would do this. there is a cpp provided interface but it seems kind of troublesome so looks like I need to use objective-C. that is the native interface so it probably the preferred way to do so. or maybe void pointers need to do some more research. I'll probably make some notes as I go and see what I'll need to do.

Screenshot 2024-08-28 at 12 12 48 PM

@vertver
Copy link
Contributor

vertver commented Aug 28, 2024

@pollend you might want to check out the dawn as the WebGPU API is very similar to the NRI specifics. The only thing that might be different is the pipeline and shader handling, but I don't see any problems here since you already have to manage your shader blobs manually.

@vertver
Copy link
Contributor

vertver commented Aug 28, 2024

By the way, if you really want to implement fully featured Metal implementation, you should also implement Metal-compatible shader header with NRICompatibility.hlsli internals.

@pollend
Copy link
Contributor Author

pollend commented Aug 28, 2024

@pollend you might want to check out the dawn as the WebGPU API is very similar to the NRI specifics. The only thing that might be different is the pipeline and shader handling, but I don't see any problems here since you already have to manage your shader binaries manually.

that's a good resource, I guess I need to spend a bit of time studying objective-c++. recently got a MacBook to work on some metal related stuff. I have a project that I was adding support for metal and I would like to add this support to nri for my own use.

@vertver
Copy link
Contributor

vertver commented Aug 28, 2024

If you have any questions about NRI or ObjC specifics or testing on macOS machine - feel free to ask me here. I'll answer as soon as possible.

@dzhdanNV
Copy link
Collaborator

I have just committed shading rate support with a minor interface change (a naming change as usual).

@pollend
Copy link
Contributor Author

pollend commented Aug 29, 2024

just started a little: #89

quite a lot of boilerplate to setup before i have something to compile might take me a couple days to get to that point.

@dzhdanNV
Copy link
Collaborator

Sorry for the inconvenience, I had to resolve the final issue in the API related to read-only depth and/or stencil. Now it's done. No more API changes planned!

@dzhdanNV dzhdanNV added the enhancement New feature or request label Aug 30, 2024
@dzhdanNV
Copy link
Collaborator

dzhdanNV commented Sep 2, 2024

Sorry, guys, for several releases today. I'm happy with the look of the interface. I really think I'm finished.

@pollend
Copy link
Contributor Author

pollend commented Sep 5, 2024

Not too bad I rebases my changes without much incident. I have a few questions in the pr I've drafted. Need to study metal examples to get a better idea.

@dzhdanNV dzhdanNV added the in progress Issue is in progress label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress Issue is in progress
Projects
None yet
Development

No branches or pull requests

3 participants