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

Side by Side Diff: gpu/command_buffer/service/context_state.cc

Issue 1625573003: On ES or Core profile, we should be able to disable vertex attrib 0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/context_state.h" 5 #include "gpu/command_buffer/service/context_state.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 attrib->type(), 366 attrib->type(),
367 attrib->normalized(), 367 attrib->normalized(),
368 attrib->gl_stride(), 368 attrib->gl_stride(),
369 ptr); 369 ptr);
370 370
371 // Restore attrib divisor if supported. 371 // Restore attrib divisor if supported.
372 if (feature_info_->feature_flags().angle_instanced_arrays) 372 if (feature_info_->feature_flags().angle_instanced_arrays)
373 glVertexAttribDivisorANGLE(attrib_index, attrib->divisor()); 373 glVertexAttribDivisorANGLE(attrib_index, attrib->divisor());
374 374
375 // Never touch vertex attribute 0's state (in particular, never 375 // Never touch vertex attribute 0's state (in particular, never
376 // disable it) when running on desktop GL because it will never be 376 // disable it) when running on desktop GL with compatibility profile
377 // re-enabled. 377 // because it will never be re-enabled.
378 if (attrib_index != 0 || 378 if (attrib_index != 0 ||
379 gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) { 379 feature_info_->gl_version_info().BehavesLikeGLES()) {
380 if (attrib->enabled()) { 380 if (attrib->enabled()) {
381 glEnableVertexAttribArray(attrib_index); 381 glEnableVertexAttribArray(attrib_index);
382 } else { 382 } else {
383 glDisableVertexAttribArray(attrib_index); 383 glDisableVertexAttribArray(attrib_index);
384 } 384 }
385 } 385 }
386 } 386 }
387 } 387 }
388 388
389 void ContextState::RestoreVertexAttribs() const { 389 void ContextState::RestoreVertexAttribs() const {
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 UpdateUnpackParameters(); 626 UpdateUnpackParameters();
627 } 627 }
628 628
629 // Include the auto-generated part of this file. We split this because it means 629 // Include the auto-generated part of this file. We split this because it means
630 // we can easily edit the non-auto generated parts right here in this file 630 // we can easily edit the non-auto generated parts right here in this file
631 // instead of having to edit some template or the code generator. 631 // instead of having to edit some template or the code generator.
632 #include "gpu/command_buffer/service/context_state_impl_autogen.h" 632 #include "gpu/command_buffer/service/context_state_impl_autogen.h"
633 633
634 } // namespace gles2 634 } // namespace gles2
635 } // namespace gpu 635 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698