mikialex / rendiation

Rendiation Rendering Framework
57 stars 5 forks source link

Support dep query hook in shadergraph builder #119

Closed mikialex closed 1 year ago

mikialex commented 2 years ago

Background

For example, one implementation wants query camera position in fragment stage, which should be provided by camera uniform before. However, the camera uniform register site doesn't know if any implementation would use the camera position in the fragment stage. If we register it blindly, we maybe use an extra fragment uniform slot.

Proposed solution

implement some kind of query hook mechanism to allow register side register hooks instead of baked dependencies, and defer the dependency creation time to when the query side is queried.

mikialex commented 1 year ago

As we not using the shader macro approach like wgsl_fn, this issue will be closed