summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoramarinichev@chromium.org <amarinichev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-13 20:54:42 +0000
committeramarinichev@chromium.org <amarinichev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-13 20:54:42 +0000
commit51fd0f1cdf914ad58a621467b7725b9e0900747a (patch)
tree5b554aaabcbff5c6d11542816945440d02b0c587
parent7cd5a84779c47d799c443445065e03b1faecb904 (diff)
downloadchromium_src-51fd0f1cdf914ad58a621467b7725b9e0900747a.zip
chromium_src-51fd0f1cdf914ad58a621467b7725b9e0900747a.tar.gz
chromium_src-51fd0f1cdf914ad58a621467b7725b9e0900747a.tar.bz2
Fixed stream-attribute matching. Autoconverted teapot shader works correctly now.
Review URL: http://codereview.chromium.org/1599025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44391 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--o3d/core/cross/gles2/param_cache_gles2.cc2
-rw-r--r--o3d/core/cross/gles2/stream_bank_gles2.cc14
2 files changed, 8 insertions, 8 deletions
diff --git a/o3d/core/cross/gles2/param_cache_gles2.cc b/o3d/core/cross/gles2/param_cache_gles2.cc
index 921813f..5a6fc85 100644
--- a/o3d/core/cross/gles2/param_cache_gles2.cc
+++ b/o3d/core/cross/gles2/param_cache_gles2.cc
@@ -601,7 +601,7 @@ static void ScanVaryingParameters(GLuint gl_program,
gl_program, ii, max_len + 1, &length, &size, &type, name_buffer.get());
// TODO(gman): Should we check for error?
GLint location = glGetAttribLocation(gl_program, name_buffer.get());
- param_cache_gl->varying_map().insert(std::make_pair(ii, location));
+ param_cache_gl->varying_map().insert(std::make_pair(location, ii));
}
}
diff --git a/o3d/core/cross/gles2/stream_bank_gles2.cc b/o3d/core/cross/gles2/stream_bank_gles2.cc
index 1657a0a..d8d36be 100644
--- a/o3d/core/cross/gles2/stream_bank_gles2.cc
+++ b/o3d/core/cross/gles2/stream_bank_gles2.cc
@@ -66,13 +66,13 @@ GLenum GLDataType(const Field& field) {
return GL_INVALID_ENUM;
}
-String GetAttribName(GLuint gl_program, GLES2Parameter gl_param) {
+String GetAttribName(GLuint gl_program, GLuint attrib_index) {
char buffer[1024];
GLsizei name_len;
GLint size;
GLenum type;
glGetActiveAttrib(gl_program,
- gl_param,
+ attrib_index,
sizeof(buffer),
&name_len,
&size,
@@ -84,9 +84,9 @@ String GetAttribName(GLuint gl_program, GLES2Parameter gl_param) {
return String(&buffer[0], name_len);
}
-String GetAttribSemantic(GLuint gl_program, GLES2Parameter gl_param) {
+String GetAttribSemantic(GLuint gl_program, GLuint attrib_index) {
// GLES doesn't have semantics so for now we just return the names.
- return GetAttribName(gl_program, gl_param);
+ return GetAttribName(gl_program, attrib_index);
}
} // anonymous namespace
@@ -114,8 +114,8 @@ bool StreamBankGLES2::CheckForMissingVertexStreams(
// Match VARYING parameters to Buffers with the matching semantics.
ParamCacheGLES2::VaryingParameterMap::iterator i;
for (i = varying_map.begin(); i != varying_map.end(); ++i) {
- GLES2Parameter gl_param = i->first;
- String semantic_string(GetAttribSemantic(gl_program, gl_param));
+ GLuint attribute_index = i->second;
+ String semantic_string(GetAttribSemantic(gl_program, attribute_index));
Stream::Semantic semantic;
int semantic_index;
if (!SemanticNameToSemantic(semantic_string, &semantic, &semantic_index)) {
@@ -128,7 +128,7 @@ bool StreamBankGLES2::CheckForMissingVertexStreams(
i->second = stream_index;
DLOG(INFO)
<< "StreamBankGLES2 Matched PARAMETER \""
- << GetAttribName(gl_program, gl_param) << " : "
+ << GetAttribName(gl_program, attribute_index) << " : "
<< semantic_string << "\" to stream "
<< stream_index << " \""
<< vertex_stream_params_.at(