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

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

Issue 157033009: Explicitly disable all attribs before drawing in CopyTextureCHROMIUM (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clearing divisors as well Created 6 years, 10 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index bc87b967863c8ab49f0b9fae775a623c33ce7d41..a8a7c1c7c929be65c9115b2d3af2eff5773937cf 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -566,6 +566,9 @@ class GLES2DecoderImpl : public GLES2Decoder,
virtual void RestoreFramebufferBindings() const OVERRIDE;
virtual void RestoreTextureState(unsigned service_id) const OVERRIDE;
+ virtual void ClearAllAttributes() const OVERRIDE;
+ virtual void RestoreAllAttributes() const OVERRIDE;
+
virtual QueryManager* GetQueryManager() OVERRIDE {
return query_manager_.get();
}
@@ -3784,6 +3787,20 @@ void GLES2DecoderImpl::RestoreTextureState(unsigned service_id) const {
}
}
+void GLES2DecoderImpl::ClearAllAttributes() const {
+ for (uint32 i = 0; i < group_->max_vertex_attribs(); ++i) {
+ if (i != 0) // Never disable attribute 0
+ glDisableVertexAttribArray(i);
+ if(features().angle_instanced_arrays)
+ glVertexAttribDivisorANGLE(i, 0);
+ }
+}
+
+void GLES2DecoderImpl::RestoreAllAttributes() const {
+ for (uint32 i = 0; i < group_->max_vertex_attribs(); ++i)
+ RestoreAttribute(i);
+}
+
void GLES2DecoderImpl::OnFboChanged() const {
if (workarounds().restore_scissor_on_fbo_change)
state_.fbo_binding_for_scissor_workaround_dirty_ = true;
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698