Commit 588e7ed2 by Jamie Madill

Revert "Fix support for GL_MAX_ATTRIBS attributes."

Breaks the AMD bot's OpenGL tests. VertexAttributeTest.MaxAttribs/3: shader compilation failed: Vertex shader failed to compile with the following errors: ERROR: error(#272) Implicit version number 110 not supported by GL3 forward compatible context ERROR: error(#273) 1 compilation errors. No code generated shader compilation failed: Fragment shader failed to compile with the following errors: ERROR: error(#272) Implicit version number 110 not supported by GL3 forward compatible context ERROR: error(#273) 1 compilation errors. No code generated BUG=angleproject:1045 BUG=500116 This reverts commit 3f3d75ea. Change-Id: I8cdd024fcf49f1ade553dae2cdbe8b02d8fba364 Reviewed-on: https://chromium-review.googlesource.com/277673Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 67e04be1
...@@ -1291,7 +1291,7 @@ bool Program::linkAttributes(const Data &data, ...@@ -1291,7 +1291,7 @@ bool Program::linkAttributes(const Data &data,
GLuint maxAttribs = data.caps->maxVertexAttributes; GLuint maxAttribs = data.caps->maxVertexAttributes;
// TODO(jmadill): handle aliasing robustly // TODO(jmadill): handle aliasing robustly
if (shaderAttributes.size() > maxAttribs) if (shaderAttributes.size() >= maxAttribs)
{ {
infoLog << "Too many vertex attributes."; infoLog << "Too many vertex attributes.";
return false; return false;
......
...@@ -129,51 +129,6 @@ class VertexAttributeTest : public ANGLETest ...@@ -129,51 +129,6 @@ class VertexAttributeTest : public ANGLETest
ANGLETest::TearDown(); ANGLETest::TearDown();
} }
GLuint compileMultiAttribProgram(GLint attribCount)
{
std::stringstream shaderStream;
shaderStream << "attribute highp vec4 position;" << std::endl;
for (GLint attribIndex = 0; attribIndex < attribCount; ++attribIndex)
{
shaderStream << "attribute float a" << attribIndex << ";" << std::endl;
}
shaderStream << "varying highp float color;" << std::endl
<< "void main() {" << std::endl
<< " gl_Position = position;" << std::endl
<< " color = 0.0;" << std::endl;
for (GLint attribIndex = 0; attribIndex < attribCount; ++attribIndex)
{
shaderStream << " color += a" << attribIndex << ";" << std::endl;
}
shaderStream << "}" << std::endl;
const std::string testFragmentShaderSource = SHADER_SOURCE
(
varying highp float color;
void main(void)
{
gl_FragColor = vec4(color, 0.0, 0.0, 1.0);
}
);
return CompileProgram(shaderStream.str(), testFragmentShaderSource);
}
void setupMultiAttribs(GLuint program, GLint attribCount, GLfloat value)
{
glUseProgram(program);
for (GLint attribIndex = 0; attribIndex < attribCount; ++attribIndex)
{
std::stringstream attribStream;
attribStream << "a" << attribIndex;
GLint location = glGetAttribLocation(program, attribStream.str().c_str());
ASSERT_NE(-1, location);
glVertexAttrib1f(location, value);
glDisableVertexAttribArray(location);
}
}
static const size_t mVertexCount = 24; static const size_t mVertexCount = 24;
GLuint mProgram; GLuint mProgram;
...@@ -285,40 +240,6 @@ TEST_P(VertexAttributeTest, ShortNormalized) ...@@ -285,40 +240,6 @@ TEST_P(VertexAttributeTest, ShortNormalized)
runTest(data); runTest(data);
} }
// Validate that we can support GL_MAX_ATTRIBS attribs
TEST_P(VertexAttributeTest, MaxAttribs)
{
GLint maxAttribs;
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxAttribs);
ASSERT_GL_NO_ERROR();
// Reserve one attrib for position
GLint drawAttribs = maxAttribs - 1;
GLuint program = compileMultiAttribProgram(drawAttribs);
ASSERT_NE(0u, program);
setupMultiAttribs(program, drawAttribs, 0.5f / static_cast<float>(drawAttribs));
drawQuad(program, "position", 0.5f);
EXPECT_GL_NO_ERROR();
EXPECT_PIXEL_NEAR(0, 0, 128, 0, 0, 255, 1);
}
// Validate that we cannot support GL_MAX_ATTRIBS+1 attribs
TEST_P(VertexAttributeTest, MaxAttribsPlusOne)
{
GLint maxAttribs;
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxAttribs);
ASSERT_GL_NO_ERROR();
// Exceed attrib count by one (counting position)
GLint drawAttribs = maxAttribs;
GLuint program = compileMultiAttribProgram(drawAttribs);
ASSERT_EQ(0u, program);
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. // Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
// D3D11 Feature Level 9_3 uses different D3D formats for vertex attribs compared to Feature Levels 10_0+, so we should test them separately. // D3D11 Feature Level 9_3 uses different D3D formats for vertex attribs compared to Feature Levels 10_0+, so we should test them separately.
ANGLE_INSTANTIATE_TEST(VertexAttributeTest, ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3(), ES2_OPENGL(), ES3_OPENGL()); ANGLE_INSTANTIATE_TEST(VertexAttributeTest, ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3(), ES2_OPENGL(), ES3_OPENGL());
......
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