mirror of
https://github.com/galacean/engine.git
synced 2026-05-10 17:11:42 +08:00
Replace the ad-hoc `resolveGenericReturnType` switch with an explicit data-driven generic family system. Each family (GenType, GVec4, GSampler2D, ...) declares its members and the dimension it varies along (Size / Prefix); overload resolution locks an index per dimension while walking arguments and projects return families through that lock. This fixes the underlying defect that produced the texture/textureCube bugs: the previous algorithm assumed "return family == parameter family" and collapsed `GVec4 <- GSampler2D` to `SAMPLER2D`. Cross-family projection (sampler → gvec4) is now a native operation, so the textureCube/textureCubeLod/texture2D/texture2DLod overloads that the initial fix listed as concrete-only entries can be written as plain generic signatures again. Return type falls through as `TypeAny` when no argument locks the dimension (all args are TypeAny), preserving wildcard-compatible overload resolution downstream. Also exercises the Verbose semantic pass in the two new test shaders — the initial fix registered them under Release only, which skips semantic analysis and therefore could not catch the bug it was meant to prevent.