Fix Metal codegen for Globals struct.

The code which sets up the Globals struct is separate from the code
which populates the struct. Occasionally, these two blocks of code do
not emit the same items in the same order. (e.g., global variables
without associated values do not get added to fInitNonConstGlobalVars,
so they are missing entirely from the globalStruct setup.)

Previously, globalStruct was initialized via this syntax:

    Globals globalStruct{&a, b, c, d};

Which meant that any mismatch between the above two sections of code
would initialize the globals incorrectly.

Initialization now uses the following form, which should be forgiving
of any gaps or reordering, but will hopefully generate the same code
for a tightly-packed structure:

    Globals globalStruct;
    globalStruct.a = &a;
    globalStruct.b = b;
    globalStruct.c = c;
    globalStruct.d = d;

This fixes the DM 'vertices_data_lerp' in Metal.

Change-Id: I793e3893a1a0f7db20de1006f7a9cb2ecca22d6b
Bug: skia:10287
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292729
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
1 file changed