galacean / engine

A typescript interactive engine, support 2D, 3D, animation, physics, built on WebGL and glTF.
https://galacean.antgroup.com/engine
MIT License
4.2k stars 299 forks source link

Improve the ShaderLab Language Type Inference System #2148

Open Sway007 opened 3 months ago

Sway007 commented 3 months ago

Is your feature request related to a problem? Please describe.

The type system in the current version is not well developed, leading to ambiguity in type inference for certain expressions in ShaderLab. This results in an inability to match the correct overload function signatures, hindering the implementation of code section trimming for unreferenced functions.

Describe the solution you'd like

Improve the ShaderLab Language Type Inference System for Accurate Function Overload Resolution.

Describe alternatives you've considered

Retain all overloaded functions (a non-ideal solution).