1*c8dee2aaSAndroid Build Coastguard Workeruniform half4 colorGreen, colorRed; 2*c8dee2aaSAndroid Build Coastguard Worker 3*c8dee2aaSAndroid Build Coastguard Workerhalf4 main(float2) { 4*c8dee2aaSAndroid Build Coastguard Worker float4 scalar; 5*c8dee2aaSAndroid Build Coastguard Worker float4 array[1]; 6*c8dee2aaSAndroid Build Coastguard Worker 7*c8dee2aaSAndroid Build Coastguard Worker // Test swizzled-lvalue assignment on a scalar. 8*c8dee2aaSAndroid Build Coastguard Worker scalar = float4(colorGreen) * 0.5; // 0, 0.5, 0, 0.5 9*c8dee2aaSAndroid Build Coastguard Worker scalar.a = 2.0; // 0, 0.5, 0, 2 10*c8dee2aaSAndroid Build Coastguard Worker scalar.g /= 0.25; // 0, 2, 0, 2 11*c8dee2aaSAndroid Build Coastguard Worker scalar.gba *= float3x3(0.5); // 0, 1, 0, 1 12*c8dee2aaSAndroid Build Coastguard Worker scalar.bgar += float4(0.25, 0.0, 0.0, 0.75); // 0.75, 1, 0.25, 1 13*c8dee2aaSAndroid Build Coastguard Worker scalar.r += scalar.a <= 1.0 ? scalar.b : 0.0; // 1, 1, 0.25, 1 14*c8dee2aaSAndroid Build Coastguard Worker 15*c8dee2aaSAndroid Build Coastguard Worker // Test swizzled-lvalue assignment on an array element. 16*c8dee2aaSAndroid Build Coastguard Worker array[0] = float4(colorGreen) * 0.5; // 0, 0.5, 0, 0.5 17*c8dee2aaSAndroid Build Coastguard Worker array[0].a = 2.0; // 0, 0.5, 0, 2 18*c8dee2aaSAndroid Build Coastguard Worker array[0].g /= 0.25; // 0, 2, 0, 2 19*c8dee2aaSAndroid Build Coastguard Worker array[0].gba *= float3x3(0.5); // 0, 1, 0, 1 20*c8dee2aaSAndroid Build Coastguard Worker array[0].bgar += float4(0.25, 0.0, 0.0, 0.75); // 0.75, 1, 0.25, 1 21*c8dee2aaSAndroid Build Coastguard Worker array[0].r += array[0].a <= 1.0 ? array[0].b : 0.0; // 1, 1, 0.25, 1 22*c8dee2aaSAndroid Build Coastguard Worker 23*c8dee2aaSAndroid Build Coastguard Worker return (scalar == float4(1, 1, 0.25, 1) && array[0] == float4(1, 1, 0.25, 1)) ? colorGreen 24*c8dee2aaSAndroid Build Coastguard Worker : colorRed; 25*c8dee2aaSAndroid Build Coastguard Worker} 26