Giter Site home page Giter Site logo

MetalKit support about metal-rs HOT 6 CLOSED

gfx-rs avatar gfx-rs commented on July 2, 2024
MetalKit support

from metal-rs.

Comments (6)

kvark avatar kvark commented on July 2, 2024

@adamnemecek my feeling is that MetalKit is a higher level framework built on top of Metal itself, and thus on Rust side it should be a different wrapper crate that depends on metal-rs.

from metal-rs.

adamnemecek avatar adamnemecek commented on July 2, 2024

Its the same level of abstraction. It just wraps some idioms into corresponding API.

Eg these unsafe lines of code are not needed https://github.com/gfx-rs/metal-rs/blob/master/examples/window/main.rs#L72

MTKView and MTKViewDelegate make using the framework a lot more pleasant.

from metal-rs.

kvark avatar kvark commented on July 2, 2024

I don't think this is correct, still.

Metal is the API that Apple platform implements by a combination of runtime + driver. Metal Kit is a wrapper library for working with Metal "quicker and easier, using far less code", it's a classical higher level abstraction thing. It's a library built on top of Metal: implementing new interfaces via the low-level ones, providing read-to-use shaders, etc.

The bindings to MetalKit should live in some metal-toolkit-rs library that doesn't exist yet.
@grovesNL please let us know if you feel differently.

from metal-rs.

adamnemecek avatar adamnemecek commented on July 2, 2024

read-to-use shaders

You might be thinking about MetalPerformanceShaders, MetalKit doesn't provide ready-to-use shaders.

The main thing it provides is MTKView which frees you from the need to setup the layer and such yourself. It's the recommended way of writing metal.

Also, MTKViewDelegate is a much better way of rendering than alternatives.

from metal-rs.

adamnemecek avatar adamnemecek commented on July 2, 2024

Ok, I create a crate, it's still WIP.

https://github.com/adamnemecek/metalkit

Do you happen to know how to wrap the MTKViewDelegate?

from metal-rs.

kvark avatar kvark commented on July 2, 2024

You might be thinking about MetalPerformanceShaders, MetalKit doesn't provide ready-to-use shaders.

Indeed, thanks for correction!

Also, MTKViewDelegate is a much better way of rendering than alternatives.

I don't question it's usefulness. What I'm saying is that it's built on top of Metal, it doesn't offer anything that you can't build manually on Metal.

Ok, I create a crate, it's still WIP.

Great stuff! We'll happily follow, and this issue can now be closed.

from metal-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.