shady-gang / shady

Research shading language IR
MIT License
221 stars 12 forks source link

Resource binding roadmap? #30

Open ib00 opened 7 months ago

ib00 commented 7 months ago

The example language is using GLSL/HLSL-like resource binding.

I find this resource binding horrible and complex. On the other hand, Metal 3.0 resource binding API is the simplest and most powerful at the same time. You don't need the complexity of DX12 and Vulkan.

Are there any plans for moving to essentially what CUDA/OpenCL/Metal do?

You simply declare a standard C/C++ struct with data, GPU pointers and sampler/texture handles and pass them as a regular function parameters.

Hugobros3 commented 7 months ago

Shady's main goal is to be an useful IR and my approach to binding models is to basically support the interfaces APIs want. You can actually find some code supporting passing arguments to kernel directly but that code is reliant on runtime support which is a component you might not want to use in your own application.

Overall the binding model stuff is kind of out of scope / up to you as an user. Shady gives you the tools required to implement transformations to support any binding model you want.

I hope this helps!

ib00 commented 7 months ago

I should have said 'vcc' (the front end for Shady) in my question above.

It's understood that Shady is agnostic (as it should be).

Hugobros3 commented 5 months ago

I really don't have time at the moment for this but I would gladly support anyone who takes up this for themselves.