You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What problem does this solve or what need does it fill?
if we have 3 shader files common.wgsl, util1.wgsl, util2.wgsl, and if both util1.wgsl and util2.wgsl includes common.wgsl, then if the main shader file include both util1.wgsl and util2.wgsl, it will cause a problem, because function re-definition (i.e. common.wgsl imported twice).
What solution would you like?
one solution would be to support #define in the shader preprocess (i.e. define a label used for #ifdef#ifndef). Then we can write an include guard similar to the include file in C.
What alternative(s) have you considered?
there could be several other method,
have #import once declarative indicate this file should only be imported once.
bevy preprocessor automatically remove the duplicate function (however, how to define duplicate function is questionable)
do nothing, and let user keep track of import and make sure no duplicate imports happen.
Additional context
The text was updated successfully, but these errors were encountered:
What problem does this solve or what need does it fill?
if we have 3 shader files
common.wgsl
,util1.wgsl
,util2.wgsl
, and if bothutil1.wgsl
andutil2.wgsl
includescommon.wgsl
, then if the main shader file include bothutil1.wgsl
andutil2.wgsl
, it will cause a problem, because function re-definition (i.e.common.wgsl
imported twice).What solution would you like?
one solution would be to support
#define
in the shader preprocess (i.e. define a label used for#ifdef
#ifndef
). Then we can write an include guard similar to the include file in C.What alternative(s) have you considered?
there could be several other method,
#import once
declarative indicate this file should only be imported once.Additional context
The text was updated successfully, but these errors were encountered: