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

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

Issue 2148723004: WebGL 2: make sure VertexAttrib type match the corresponding attrib type in shader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix the bug in Windows gpu bot Created 4 years, 5 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/vertex_attrib_manager.cc
diff --git a/gpu/command_buffer/service/vertex_attrib_manager.cc b/gpu/command_buffer/service/vertex_attrib_manager.cc
index 76883dc0f3fe2e956e9017ea82970d0b407e3fb1..327f178f11ee391d57b06e08f229146cd9b8bdab 100644
--- a/gpu/command_buffer/service/vertex_attrib_manager.cc
+++ b/gpu/command_buffer/service/vertex_attrib_manager.cc
@@ -127,6 +127,8 @@ VertexAttribManager::~VertexAttribManager() {
void VertexAttribManager::Initialize(uint32_t max_vertex_attribs,
bool init_attribs) {
vertex_attribs_.resize(max_vertex_attribs);
+ attrib_base_type_mask_ = 0u;
+ attrib_written_mask_ = 0u;
for (uint32_t vv = 0; vv < vertex_attribs_.size(); ++vv) {
vertex_attribs_[vv].set_index(vv);
@@ -146,6 +148,11 @@ bool VertexAttribManager::Enable(GLuint index, bool enable) {
if (index >= vertex_attribs_.size()) {
return false;
}
+
+ if (!enable) {
+ attrib_written_mask_ &= ~(0x3 << (index * 2));
+ }
+
VertexAttrib& info = vertex_attribs_[index];
if (info.enabled() != enable) {
info.set_enabled(enable);

Powered by Google App Engine
This is Rietveld 408576698