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
Extracting all "mattered" macros from the shader source code helps avoid unnecessary compilation of shader variants.
The definition for "mattered" macro in version 1.3 is simple: macros defined after #if, #ifdef, #ifndef, and defined operator.
The macros defined by the above standards are not actually "mattered" macros. For example, the following conditional macro expansion is a variable declaration, but it may not be referenced by the entry main function, so it should not be defined as a "mattered" macro.
Why
Extracting all "mattered" macros from the shader source code helps avoid unnecessary compilation of shader variants.
The definition for "mattered" macro in version 1.3 is simple: macros defined after
#if
,#ifdef
,#ifndef
, anddefined
operator.The macros defined by the above standards are not actually "mattered" macros. For example, the following conditional macro expansion is a variable declaration, but it may not be referenced by the entry main function, so it should not be defined as a "mattered" macro.
\#ifdef SOME_DEFINED_MACRO float useless_variable; \#endif
Future optimization
TODO: Use a seperate compiler to analyze and extract the real list of all "mattered" macros after
Shader.create
but before shader variant compilation.The text was updated successfully, but these errors were encountered: