src/third_party/angle/src/tests/gl_tests/UniformBufferTest.cpp
// Test array operators to operate on uniform block large array member.
Test array operators to operate on uniform block large array member.
Test array operators to operate on uniform block large array member .
TEST_P(UniformBlockWithOneLargeArrayMemberTest, MemberArrayOperations)
{
    ANGLE_SKIP_TEST_IF(IsOpenGL() || IsOpenGLES());
    constexpr char kVS[] = R"(#version 300 es
layout(location=0) in vec3 a_position;
uniform UBO1{
    mat4x4 buf1[90];
};
uniform UBO2{
    mat4x4 buf2[90];
};
uniform UBO3{
    mat4x4 buf[90];
} instance;
vec4 test1( mat4x4[90] para, vec3 pos ){
    return para[ 0 ] * vec4( pos, 1.0 );
}
mat4x4[90] test2()
{
    return instance.buf;
}
void main(void){
    if (buf1 == buf2)
    {
        mat4x4 temp1[90] = buf1;
        gl_Position = test1(temp1, a_position);
    }
    else
    {
        mat4x4 temp2[90] = test2();
        gl_Position = test1(temp2, a_position);
    }
})";
    constexpr char kFS[] = R"(#version 300 es
precision mediump float;
uniform vec3 u_color;
out vec4 oFragColor;
void main(void){
    oFragColor = vec4( u_color, 1.0);
})";
    ANGLE_GL_PROGRAM(program, kVS, kFS);
    EXPECT_GL_NO_ERROR();
}
TEST_P ( UniformBlockWithOneLargeArrayMemberTest , MemberArrayOperations ) { ANGLE_SKIP_TEST_IF ( IsOpenGL ( ) || IsOpenGLES ( ) ) ; constexpr char kVS [ ] = R" ( #version 300 es
layout(location=0) in vec3 a_position;

uniform UBO1{
    mat4x4 buf1[90];
};

uniform UBO2{
    mat4x4 buf2[90];
};

uniform UBO3{
    mat4x4 buf[90];
} instance;

vec4 test1( mat4x4[90] para, vec3 pos ){
    return para[ 0 ] * vec4( pos, 1.0 );
}

mat4x4[90] test2()
{
    return instance.buf;
}

void main(void){
    if (buf1 == buf2)
    {
        mat4x4 temp1[90] = buf1;
        gl_Position = test1(temp1, a_position);
    }
    else
    {
        mat4x4 temp2[90] = test2();
        gl_Position = test1(temp2, a_position);
    }
} ) " ; constexpr char kFS [ ] = R" ( #version 300 es
precision mediump float;

uniform vec3 u_color;
out vec4 oFragColor;

void main(void){
    oFragColor = vec4( u_color, 1.0);
} ) " ; ANGLE_GL_PROGRAM ( program , kVS , kFS ) ; EXPECT_GL_NO_ERROR ( ) ; }
Test array operators to operate on uniform block large array member.
Test array operators to operate on uniform block large array member .