Apply compilation fixes for Metal compatibility.
This includes explicit type casts, packed data types
where vec3 alignment is inconsistent, constructor replacement
with factory function.
The Metal shader generator also needs knowledge of when bound
resources are fundamental data types, so
SHADOWS_TILE_DATA_PACKED must be described as uint in
ShaderCreateInfo.
Authored by Apple: Michael Parkin-White