Commit 06f76552 by Jamie Madill Committed by Commit Bot

UniformsPerf: Define a vertex attribute.

This seems to fix a crash on D3D9/Win7/Intel. BUG=chromium:704211 Change-Id: If600a6b8409774503f28ca122d87ef723e4ea2e5 Reviewed-on: https://chromium-review.googlesource.com/497649Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent ee769dd2
...@@ -181,6 +181,10 @@ void UniformsBenchmark::initializeBenchmark() ...@@ -181,6 +181,10 @@ void UniformsBenchmark::initializeBenchmark()
} }
} }
GLint attribLocation = glGetAttribLocation(mProgram, "pos");
ASSERT_NE(-1, attribLocation);
glVertexAttrib4f(attribLocation, 1.0f, 0.0f, 0.0f, 1.0f);
ASSERT_GL_NO_ERROR(); ASSERT_GL_NO_ERROR();
} }
...@@ -201,6 +205,8 @@ void UniformsBenchmark::initShaders() ...@@ -201,6 +205,8 @@ void UniformsBenchmark::initShaders()
std::string typeString = isMatrix ? "mat4" : "vec4"; std::string typeString = isMatrix ? "mat4" : "vec4";
std::string constVector = "const vec4 one = vec4(1, 1, 1, 1);\n"; std::string constVector = "const vec4 one = vec4(1, 1, 1, 1);\n";
vstrstr << "attribute vec4 pos;\n";
if (isMatrix) if (isMatrix)
{ {
vstrstr << constVector; vstrstr << constVector;
...@@ -213,7 +219,7 @@ void UniformsBenchmark::initShaders() ...@@ -213,7 +219,7 @@ void UniformsBenchmark::initShaders()
vstrstr << "void main()\n" vstrstr << "void main()\n"
"{\n" "{\n"
" gl_Position = vec4(0, 0, 0, 0);\n"; " gl_Position = pos;\n";
for (size_t i = 0; i < params.numVertexUniforms; i++) for (size_t i = 0; i < params.numVertexUniforms; i++)
{ {
vstrstr << " gl_Position += " << GetUniformLocationName(i, true); vstrstr << " gl_Position += " << GetUniformLocationName(i, true);
......
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