private static SpvInstruction ApplyScaling2DArray(CodeGenContext context, SpvInstruction vector, int index) { // The array index is not scaled, just x and y. var vectorXY = context.VectorShuffle(context.TypeVector(context.TypeS32(), 2), vector, vector, 0, 1); var vectorZ = context.CompositeExtract(context.TypeS32(), vector, 2); var vectorXYScaled = ApplyScaling2D(context, vectorXY, index); var vectorScaled = context.CompositeConstruct(context.TypeVector(context.TypeS32(), 3), vectorXYScaled, vectorZ); return(vectorScaled); }