Chromium Code Reviews| Index: gpu/command_buffer/service/context_state.h |
| diff --git a/gpu/command_buffer/service/context_state.h b/gpu/command_buffer/service/context_state.h |
| index d026df9a06fd38c22f76e0d508d994063614921c..f2016359c2cc69743f155671d51a7924dc127598 100644 |
| --- a/gpu/command_buffer/service/context_state.h |
| +++ b/gpu/command_buffer/service/context_state.h |
| @@ -243,6 +243,22 @@ struct GPU_EXPORT ContextState { |
| void SetBoundBuffer(GLenum target, Buffer* buffer); |
| void RemoveBoundBuffer(Buffer* buffer); |
| + void SetGenericVertexAttribBaseType(GLuint index, GLenum base_type) { |
| + DCHECK(index >=0 && index < 16); |
| + int shift_bits = index * 2; |
| + generic_attrib_type_written_mask_ |= ~(0x3 << shift_bits); |
|
Zhenyao Mo
2016/07/20 17:54:56
You don't need this written mask.
Every vertex at
yunchao
2016/07/22 13:43:53
Done.
|
| + generic_attrib_base_type_ &= ~(0x3 << shift_bits); |
| + generic_attrib_base_type_ |= base_type << shift_bits; |
| + } |
| + |
| + uint32_t GetGenericVertexAttribBaseType() { |
| + return generic_attrib_base_type_; |
| + } |
| + |
| + uint32_t GetGenericVertexAttribTypeMask() { |
| + return generic_attrib_type_written_mask_; |
| + } |
| + |
| void UnbindTexture(TextureRef* texture); |
| void UnbindSampler(Sampler* sampler); |
| @@ -320,6 +336,14 @@ struct GPU_EXPORT ContextState { |
| bool framebuffer_srgb_; |
| + // Generic vertex attrib base types: FLOAT, INT, or UINT. |
| + // We have up to 16 attribs, each is encoded into 2 bits, total 32 bits |
|
Zhenyao Mo
2016/07/20 17:54:56
You can't really limit it to 16. Instead, it shou
yunchao
2016/07/22 13:43:53
Done.
|
| + // the lowest 2 bits for location 0, the highest 2 bits for location 15. |
| + uint32_t generic_attrib_base_type_; |
|
Zhenyao Mo
2016/07/20 17:54:56
I really think we should keep the type_mask_ inste
yunchao
2016/07/22 13:43:53
Acknowledged.
|
| + // Same layout as above, 2 bits per location, 0x03 if a location is set |
| + // by vertexAttrib API, 0x00 if not. |
| + uint32_t generic_attrib_type_written_mask_; |
| + |
| FeatureInfo* feature_info_; |
| std::unique_ptr<ErrorState> error_state_; |
| }; |