Add helper uniforms to Runtime Effect tests.

This lets us use descriptive names like `colorRed` and `colorGreen`
instead of `half4(1,0,0,1)` and `half4(0,1,0,1)`. It also lets us use
actual unknown values instead of synthesizing sorta-kinda-unknowns by
calling sqrt.

Change-Id: I61481c33b7ff42182955777b05cfa5fcc13e0efc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359567
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
diff --git a/tests/sksl/shared/ForLoopControlFlow.asm.frag b/tests/sksl/shared/ForLoopControlFlow.asm.frag
index 02c5348..31e45e3 100644
--- a/tests/sksl/shared/ForLoopControlFlow.asm.frag
+++ b/tests/sksl/shared/ForLoopControlFlow.asm.frag
@@ -9,107 +9,113 @@
 OpEntryPoint Fragment %main "main" %sk_Clockwise
 OpExecutionMode %main OriginUpperLeft
 OpName %sk_Clockwise "sk_Clockwise"
+OpName %colorWhite "colorWhite"
 OpName %main "main"
 OpName %x "x"
 OpName %r "r"
 OpName %b "b"
 OpDecorate %sk_Clockwise RelaxedPrecision
 OpDecorate %sk_Clockwise BuiltIn FrontFacing
-OpDecorate %22 RelaxedPrecision
-OpDecorate %26 RelaxedPrecision
-OpDecorate %30 RelaxedPrecision
-OpDecorate %36 RelaxedPrecision
+OpDecorate %colorWhite RelaxedPrecision
+OpDecorate %colorWhite DescriptorSet 0
+OpDecorate %14 RelaxedPrecision
+OpDecorate %23 RelaxedPrecision
+OpDecorate %27 RelaxedPrecision
+OpDecorate %31 RelaxedPrecision
 OpDecorate %37 RelaxedPrecision
-OpDecorate %44 RelaxedPrecision
+OpDecorate %39 RelaxedPrecision
 OpDecorate %46 RelaxedPrecision
-OpDecorate %49 RelaxedPrecision
-OpDecorate %56 RelaxedPrecision
-OpDecorate %57 RelaxedPrecision
+OpDecorate %48 RelaxedPrecision
+OpDecorate %51 RelaxedPrecision
 OpDecorate %58 RelaxedPrecision
+OpDecorate %59 RelaxedPrecision
+OpDecorate %60 RelaxedPrecision
 %bool = OpTypeBool
 %_ptr_Input_bool = OpTypePointer Input %bool
 %sk_Clockwise = OpVariable %_ptr_Input_bool Input
 %float = OpTypeFloat 32
 %v4float = OpTypeVector %float 4
-%8 = OpTypeFunction %v4float
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%colorWhite = OpVariable %_ptr_Uniform_v4float Uniform
+%10 = OpTypeFunction %v4float
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-%float_1 = OpConstant %float 1
-%13 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_float = OpTypePointer Function %float
 %float_n5 = OpConstant %float -5
 %float_5 = OpConstant %float 5
 %int = OpTypeInt 32 1
 %int_0 = OpConstant %int 0
 %float_0 = OpConstant %float 0
+%float_1 = OpConstant %float 1
 %int_2 = OpConstant %int 2
 %int_1 = OpConstant %int 1
-%main = OpFunction %v4float None %8
-%9 = OpLabel
+%main = OpFunction %v4float None %10
+%11 = OpLabel
 %x = OpVariable %_ptr_Function_v4float Function
 %r = OpVariable %_ptr_Function_float Function
 %b = OpVariable %_ptr_Function_float Function
-OpStore %x %13
+%14 = OpLoad %v4float %colorWhite
+OpStore %x %14
 OpStore %r %float_n5
-OpBranch %17
-%17 = OpLabel
-OpLoopMerge %21 %20 None
 OpBranch %18
 %18 = OpLabel
-%22 = OpLoad %float %r
-%24 = OpFOrdLessThan %bool %22 %float_5
-OpBranchConditional %24 %19 %21
+OpLoopMerge %22 %21 None
+OpBranch %19
 %19 = OpLabel
-%26 = OpLoad %float %r
-%25 = OpExtInst %float %1 FAbs %26
-%27 = OpAccessChain %_ptr_Function_float %x %int_0
-OpStore %27 %25
-%30 = OpLoad %v4float %x
-%31 = OpCompositeExtract %float %30 0
-%33 = OpFOrdEqual %bool %31 %float_0
-OpSelectionMerge %35 None
-OpBranchConditional %33 %34 %35
-%34 = OpLabel
-OpBranch %21
-%35 = OpLabel
-OpBranch %20
+%23 = OpLoad %float %r
+%25 = OpFOrdLessThan %bool %23 %float_5
+OpBranchConditional %25 %20 %22
 %20 = OpLabel
-%36 = OpLoad %float %r
-%37 = OpFAdd %float %36 %float_1
-OpStore %r %37
-OpBranch %17
+%27 = OpLoad %float %r
+%26 = OpExtInst %float %1 FAbs %27
+%28 = OpAccessChain %_ptr_Function_float %x %int_0
+OpStore %28 %26
+%31 = OpLoad %v4float %x
+%32 = OpCompositeExtract %float %31 0
+%34 = OpFOrdEqual %bool %32 %float_0
+OpSelectionMerge %36 None
+OpBranchConditional %34 %35 %36
+%35 = OpLabel
+OpBranch %22
+%36 = OpLabel
+OpBranch %21
 %21 = OpLabel
+%37 = OpLoad %float %r
+%39 = OpFAdd %float %37 %float_1
+OpStore %r %39
+OpBranch %18
+%22 = OpLabel
 OpStore %b %float_5
-OpBranch %39
-%39 = OpLabel
-OpLoopMerge %43 %42 None
-OpBranch %40
-%40 = OpLabel
-%44 = OpLoad %float %b
-%45 = OpFOrdGreaterThanEqual %bool %44 %float_0
-OpBranchConditional %45 %41 %43
+OpBranch %41
 %41 = OpLabel
-%46 = OpLoad %float %b
-%47 = OpAccessChain %_ptr_Function_float %x %int_2
-OpStore %47 %46
-%49 = OpLoad %v4float %x
-%50 = OpCompositeExtract %float %49 3
-%51 = OpFOrdEqual %bool %50 %float_1
-OpSelectionMerge %53 None
-OpBranchConditional %51 %52 %53
-%52 = OpLabel
-OpBranch %42
-%53 = OpLabel
-%54 = OpAccessChain %_ptr_Function_float %x %int_1
-OpStore %54 %float_0
+OpLoopMerge %45 %44 None
 OpBranch %42
 %42 = OpLabel
-%56 = OpLoad %float %b
-%57 = OpFSub %float %56 %float_1
-OpStore %b %57
-OpBranch %39
+%46 = OpLoad %float %b
+%47 = OpFOrdGreaterThanEqual %bool %46 %float_0
+OpBranchConditional %47 %43 %45
 %43 = OpLabel
-%58 = OpLoad %v4float %x
-OpReturnValue %58
+%48 = OpLoad %float %b
+%49 = OpAccessChain %_ptr_Function_float %x %int_2
+OpStore %49 %48
+%51 = OpLoad %v4float %x
+%52 = OpCompositeExtract %float %51 3
+%53 = OpFOrdEqual %bool %52 %float_1
+OpSelectionMerge %55 None
+OpBranchConditional %53 %54 %55
+%54 = OpLabel
+OpBranch %44
+%55 = OpLabel
+%56 = OpAccessChain %_ptr_Function_float %x %int_1
+OpStore %56 %float_0
+OpBranch %44
+%44 = OpLabel
+%58 = OpLoad %float %b
+%59 = OpFSub %float %58 %float_1
+OpStore %b %59
+OpBranch %41
+%45 = OpLabel
+%60 = OpLoad %v4float %x
+OpReturnValue %60
 OpFunctionEnd
 
 1 error