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

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

Issue 2181193002: Revert of current program can be null in ES2/ES3 contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « gpu/command_buffer/service/program_manager.cc ('k') | gpu/command_buffer/service/vertex_attrib_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/vertex_attrib_manager.h
diff --git a/gpu/command_buffer/service/vertex_attrib_manager.h b/gpu/command_buffer/service/vertex_attrib_manager.h
index 363e5c94bfaaf0faa70fc39e8e44585147b0c7fd..40c67948ac8d43ea7b1ff568d0f16ca7ab94a84c 100644
--- a/gpu/command_buffer/service/vertex_attrib_manager.h
+++ b/gpu/command_buffer/service/vertex_attrib_manager.h
@@ -201,18 +201,25 @@
}
void UpdateAttribBaseTypeAndMask(GLuint loc, GLenum base_type) {
- DCHECK(loc < vertex_attribs_.size());
+ DCHECK(loc < max_vertex_attribs_);
int shift_bits = (loc % 16) * 2;
attrib_enabled_mask_[loc / 16] |= (0x3 << shift_bits);
attrib_base_type_mask_[loc / 16] &= ~(0x3 << shift_bits);
attrib_base_type_mask_[loc / 16] |= base_type << shift_bits;
}
- const std::vector<uint32_t>& attrib_base_type_mask() const {
- return attrib_base_type_mask_;
- }
- const std::vector<uint32_t>& attrib_enabled_mask() const {
- return attrib_enabled_mask_;
+ // Return 16 attributes' base types, in which the attribute
+ // specified by argument 'loc' located.
+ uint32_t attrib_base_type_mask(GLuint loc) const {
+ DCHECK(loc < max_vertex_attribs_);
+ return attrib_base_type_mask_[loc / 16];
+ }
+
+ // Return 16 attributes' type written masks, in which the
+ // attribute specified by argument 'loc' located.
+ uint32_t attrib_enabled_mask(GLuint loc) const {
+ DCHECK(loc < max_vertex_attribs_);
+ return attrib_enabled_mask_[loc / 16];
}
void SetAttribInfo(
@@ -299,9 +306,10 @@
// if it is safe to draw.
std::vector<VertexAttrib> vertex_attribs_;
+ uint32_t max_vertex_attribs_;
// Vertex attrib base types: FLOAT, INT, or UINT.
// Each base type is encoded into 2 bits, the lowest 2 bits for location 0,
- // the highest 2 bits for location (max_vertex_attribs - 1).
+ // the highest 2 bits for location (max_vertex_attribs_ - 1).
std::vector<uint32_t> attrib_base_type_mask_;
// Same layout as above, 2 bits per location, 0x03 if a location for an
// vertex attrib is enabled by enabbleVertexAttribArray, 0x00 if it is
« no previous file with comments | « gpu/command_buffer/service/program_manager.cc ('k') | gpu/command_buffer/service/vertex_attrib_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698