Fix rendering corruption from nested clipIDs

In an effort to reduce varying counts, we were stuffing the outerClipID into a float (v_paint.r), and then using this value to compare with a half (v_clipID). On ANGLE at least, this was leading to corruption because even if v_clipID == v_outerClipID in the vertex shader, they were no longer equal by the time they reached the fragment shader.

Adding one more varying and passing v_outerClipID through as a half instead of a float fixes this problem for now. In the future we may want to consider making them "flat short" to be even safer, but the performance cost will be relatively high on some platforms.

The current solution comes at a slight perf cost when not using nested clipping, but appears to conversely improve things when nested clipping is used.

marty (no nested clipping): 132.9 fps -> 132.5
popsicle_loader_bite_4 (heavy nested clipping): 131.9 fps -> 132.9

Diffs=
373238831d Fix rendering corruption from nested clipIDs (#9383)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
diff --git a/.rive_head b/.rive_head
index 84c64ea..d2b352f 100644
--- a/.rive_head
+++ b/.rive_head
@@ -1 +1 @@
-038bd34aee08546d1395c93c9696d273488ff586
+373238831d0e05b08a816684e2d94686c495c22e
diff --git a/renderer/src/shaders/draw_path.glsl b/renderer/src/shaders/draw_path.glsl
index 4d9f06d..046c4aa 100644
--- a/renderer/src/shaders/draw_path.glsl
+++ b/renderer/src/shaders/draw_path.glsl
@@ -43,7 +43,7 @@
 #endif // !@RENDER_MODE_MSAA
 
 #ifdef @ENABLE_CLIPPING
-@OPTIONALLY_FLAT VARYING(4, half, v_clipID);
+@OPTIONALLY_FLAT VARYING(4, half2, v_clipIDs); // [clipID, outerClipID]
 #endif
 #ifdef @ENABLE_CLIP_RECT
 NO_PERSPECTIVE VARYING(5, float4, v_clipRect);
@@ -79,7 +79,7 @@
 #endif // !@RENDER_MODE_MSAA
 
 #ifdef @ENABLE_CLIPPING
-    VARYING_INIT(v_clipID, half);
+    VARYING_INIT(v_clipIDs, half2);
 #endif
 #ifdef @ENABLE_CLIP_RECT
     VARYING_INIT(v_clipRect, float4);
@@ -158,11 +158,12 @@
         uint clipIDBits =
             (paintType == CLIP_UPDATE_PAINT_TYPE ? paintData.y : paintData.x) >>
             16;
-        v_clipID = id_bits_to_f16(clipIDBits, uniforms.pathIDGranularity);
+        half clipID = id_bits_to_f16(clipIDBits, uniforms.pathIDGranularity);
         // Negative clipID means to update the clip buffer instead of the color
         // buffer.
         if (paintType == CLIP_UPDATE_PAINT_TYPE)
-            v_clipID = -v_clipID;
+            clipID = -clipID;
+        v_clipIDs.x = clipID;
     }
 #endif
 #ifdef @ENABLE_ADVANCED_BLEND
@@ -214,7 +215,7 @@
     {
         half outerClipID =
             id_bits_to_f16(paintData.x >> 16, uniforms.pathIDGranularity);
-        v_paint = float4(outerClipID, 0, 0, 0);
+        v_clipIDs.y = outerClipID;
     }
 #endif
     else
@@ -311,7 +312,7 @@
 #endif // !@RENDER_MODE_MSAA
 
 #ifdef @ENABLE_CLIPPING
-    VARYING_PACK(v_clipID);
+    VARYING_PACK(v_clipIDs);
 #endif
 #ifdef @ENABLE_CLIP_RECT
     VARYING_PACK(v_clipRect);
@@ -404,7 +405,7 @@
 #endif // !@RENDER_MODE_MSAA
 
 #ifdef @ENABLE_CLIPPING
-    VARYING_UNPACK(v_clipID, half);
+    VARYING_UNPACK(v_clipIDs, half2);
 #endif
 #ifdef @ENABLE_CLIP_RECT
     VARYING_UNPACK(v_clipRect, float4);
@@ -508,13 +509,13 @@
 #endif // !@ATLAS_BLIT
 
 #ifdef @ENABLE_CLIPPING
-    if (@ENABLE_CLIPPING && v_clipID < .0) // Update the clip buffer.
+    if (@ENABLE_CLIPPING && v_clipIDs.x < .0) // Update the clip buffer.
     {
-        half clipID = -v_clipID;
+        half clipID = -v_clipIDs.x;
 #ifdef @ENABLE_NESTED_CLIPPING
         if (@ENABLE_NESTED_CLIPPING)
         {
-            half outerClipID = v_paint.r;
+            half outerClipID = v_clipIDs.y;
             if (outerClipID != .0)
             {
                 // This is a nested clip. Intersect coverage with the enclosing
@@ -563,16 +564,16 @@
         if (@ENABLE_CLIPPING)
         {
             // Apply the clip.
-            if (v_clipID != .0)
+            half clipID = v_clipIDs.x;
+            if (clipID != .0)
             {
                 // Clip IDs are not necessarily drawn in monotonically
                 // increasing order, so always check exact equality of the
                 // clipID.
                 half2 clipData = unpackHalf2x16(PLS_LOADUI(clipBuffer));
                 half clipContentID = clipData.g;
-                coverage = (clipContentID == v_clipID)
-                               ? min(clipData.r, coverage)
-                               : make_half(.0);
+                coverage = (clipContentID == clipID) ? min(clipData.r, coverage)
+                                                     : make_half(.0);
             }
         }
 #endif