Fix variable shadowing causing LayersSize to be reported as 0 Upstream-commit: 84144a8c66c1bb2af8fa997288f51ef2719971b4 Component: engine