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

shader
test_varying_index_point (output color Cout = color(0,0,0))
{
    // Test array referencing with varying index
    point parray[3] = { point(.1,.2,.3), 0.2, point(.3,.3,.3) };
    
    int varyingIndex = int(clamp(P[0]*3, 0, 2));
    point indirectP = parray[varyingIndex];
    
    Cout = indirectP;    
}
