Chromium Code Reviews| 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 f3fae6d2d8f2e98ab144da10dad5f1ba210cfe1a..7491a56113a7a9732abb6c61cff5ca359d6d8e5e 100644 |
| --- a/gpu/command_buffer/service/vertex_attrib_manager.h |
| +++ b/gpu/command_buffer/service/vertex_attrib_manager.h |
| @@ -200,6 +200,28 @@ class GPU_EXPORT VertexAttribManager : |
| return NULL; |
| } |
| + void UpdateAttribBaseTypeAndMask(GLuint loc, GLenum base_type) { |
| + DCHECK(loc < max_vertex_attribs_); |
| + int shift_bits = (loc % 16) * 2; |
| + attrib_type_written_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; |
| + } |
| + |
| + // 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_type_written_mask(GLuint loc) const { |
| + DCHECK(loc < max_vertex_attribs_); |
| + return attrib_type_written_mask_[loc / 16]; |
| + } |
| + |
| void SetAttribInfo( |
| GLuint index, |
| Buffer* buffer, |
| @@ -284,6 +306,15 @@ class GPU_EXPORT VertexAttribManager : |
| // 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). |
| + std::vector<uint32_t> attrib_base_type_mask_; |
| + // Same layout as above, 2 bits per location, 0x03 if a location is set |
| + // by vertexAttrib API, 0x00 if not. |
| + std::vector<uint32_t> attrib_type_written_mask_; |
|
Zhenyao Mo
2016/07/22 14:36:47
You don't need this written mask. If it's not wri
|
| + |
| // The currently bound element array buffer. If this is 0 it is illegal |
| // to call glDrawElements. |
| scoped_refptr<Buffer> element_array_buffer_; |