Commit 77fba58c by Jamie Madill Committed by Commit Bot

Fix improper vertex array assignment in ANGLE test.

Test: StateChangeTestES3.VertexArrayObjectAndDisabledAttributes Bug: angleproject:4049 Change-Id: Ibda86585e9117686283081a76df213b2b2db0b6e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879582Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 4db96149
...@@ -902,14 +902,30 @@ TEST_P(StateChangeTestES3, VertexArrayObjectAndDisabledAttributes) ...@@ -902,14 +902,30 @@ TEST_P(StateChangeTestES3, VertexArrayObjectAndDisabledAttributes)
"{\n" "{\n"
" colorOut = varyColor;\n" " colorOut = varyColor;\n"
"}"; "}";
ANGLE_GL_PROGRAM(dualProgram, kDualVS, kDualFS); ANGLE_GL_PROGRAM(dualProgram, kDualVS, kDualFS);
GLint positionLocation = glGetAttribLocation(dualProgram, "position");
ASSERT_NE(-1, positionLocation);
GLint colorLocation = glGetAttribLocation(dualProgram, "color");
ASSERT_NE(-1, colorLocation);
GLint singlePositionLocation = glGetAttribLocation(singleProgram, "position"); // Force consistent attribute locations
ASSERT_NE(-1, singlePositionLocation); constexpr GLint positionLocation = 0;
constexpr GLint colorLocation = 1;
glBindAttribLocation(singleProgram, positionLocation, "position");
glBindAttribLocation(dualProgram, positionLocation, "position");
glBindAttribLocation(dualProgram, colorLocation, "color");
{
glLinkProgram(singleProgram);
GLint linkStatus;
glGetProgramiv(singleProgram, GL_LINK_STATUS, &linkStatus);
ASSERT_NE(linkStatus, 0);
}
{
glLinkProgram(dualProgram);
GLint linkStatus;
glGetProgramiv(dualProgram, GL_LINK_STATUS, &linkStatus);
ASSERT_NE(linkStatus, 0);
}
glUseProgram(singleProgram); glUseProgram(singleProgram);
...@@ -924,8 +940,8 @@ TEST_P(StateChangeTestES3, VertexArrayObjectAndDisabledAttributes) ...@@ -924,8 +940,8 @@ TEST_P(StateChangeTestES3, VertexArrayObjectAndDisabledAttributes)
GLVertexArray vertexArray; GLVertexArray vertexArray;
glBindVertexArray(vertexArray); glBindVertexArray(vertexArray);
glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
glVertexAttribPointer(singlePositionLocation, 3, GL_FLOAT, GL_FALSE, 0, nullptr); glVertexAttribPointer(positionLocation, 3, GL_FLOAT, GL_FALSE, 0, nullptr);
glEnableVertexAttribArray(singlePositionLocation); glEnableVertexAttribArray(positionLocation);
// Should draw red. // Should draw red.
glDrawArrays(GL_TRIANGLES, 0, 6); glDrawArrays(GL_TRIANGLES, 0, 6);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment