#How to share common code between custom (compute) shaders?

3 messages · Page 1 of 1 (latest)

manic kettle
#

Bevy's built-in shader functions support #import, but naga requires registering import paths ahead of time, and that seems to require special handles and macros.

Is there a version of #import or an alternative that works with regular files and normal asset loading?

manic kettle
#

So I was wondering why #import "common.wgsl" doesn't do anything. It turns out it needs an explicit list of names to import

#
#import "common.wgsl" TypeName, function_name, etc