// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage

shader
test_varying_index_vector (output color Cout = color(0,0,0))
{
    // Test array referencing with varying index
    vector varray[3] = { vector(.1,.2,.3), 0.2, vector(.3,.3,.3) };
    
    int varyingIndex = int(P[0]*256)%3;
    for(int i = 0; i < 50; ++i) {
        varray[varyingIndex] = vector(u,v,0);
    }
    
    Cout = varray[0] + varray[1] + varray[2];       
}
