Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: gpu/command_buffer/service/context_state.cc

Issue 1136713003: Add ES3 commands GetVertexAttribI{u}iv to GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/context_state.cc
diff --git a/gpu/command_buffer/service/context_state.cc b/gpu/command_buffer/service/context_state.cc
index 5c5da8275053b1abfc106abf9dea885472572854..d4bb31ec50de5f13d7ba0268a00892cafeded692 100644
--- a/gpu/command_buffer/service/context_state.cc
+++ b/gpu/command_buffer/service/context_state.cc
@@ -185,7 +185,35 @@ void ContextState::RestoreActiveTextureUnitBinding(unsigned int target) const {
void ContextState::RestoreVertexAttribValues() const {
for (size_t attrib = 0; attrib < vertex_attrib_manager->num_attribs();
++attrib) {
- glVertexAttrib4fv(attrib, attrib_values[attrib].v);
+ switch (attrib_values[attrib].type) {
+ case Vec4::kFloat:
+ {
+ GLfloat v[4];
+ for (size_t ii = 0; ii < 4; ++ii) {
+ v[ii] = static_cast<GLfloat>(attrib_values[attrib].v[ii]);
+ }
+ glVertexAttrib4fv(attrib, v);
+ }
+ break;
+ case Vec4::kInt:
+ {
+ GLint v[4];
+ for (size_t ii = 0; ii < 4; ++ii) {
+ v[ii] = static_cast<GLint>(attrib_values[attrib].v[ii]);
+ }
+ glVertexAttribI4iv(attrib, v);
+ }
+ break;
+ case Vec4::kUInt:
+ {
+ GLuint v[4];
+ for (size_t ii = 0; ii < 4; ++ii) {
+ v[ii] = static_cast<GLuint>(attrib_values[attrib].v[ii]);
+ }
+ glVertexAttribI4uiv(attrib, v);
+ }
+ break;
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698