Chromium Code Reviews| Index: gpu/command_buffer/common/gles2_cmd_format.h |
| diff --git a/gpu/command_buffer/common/gles2_cmd_format.h b/gpu/command_buffer/common/gles2_cmd_format.h |
| index 944edfd5d0c639a497b95107e9a8ff4f197da49a..7ddff933e45ce4c6079e0a58d40c7e0b2c299704 100644 |
| --- a/gpu/command_buffer/common/gles2_cmd_format.h |
| +++ b/gpu/command_buffer/common/gles2_cmd_format.h |
| @@ -43,6 +43,7 @@ typedef void GLvoid; |
| typedef khronos_intptr_t GLintptr; |
| typedef khronos_ssize_t GLsizeiptr; |
| typedef struct __GLsync *GLsync; |
| +typedef uint64_t GLuint64; |
| namespace gpu { |
| namespace gles2 { |
| @@ -77,6 +78,31 @@ static_assert(kTextures == 4, "kTextures should equal 4"); |
| } // namespace id_namespaces |
| +union GLuint64Union { |
|
piman
2015/02/18 18:38:00
Oh, actually, I missed the fact that this was a un
Zhenyao Mo
2015/02/18 19:10:37
Thanks for catching this. My understanding of uni
|
| + GLuint64Union(GLuint64 v64) |
| + : param64(v64) { |
| + } |
| + |
| + GLuint64Union(uint32_t v32_0, uint32_t v32_1) { |
| + param32.v0 = v32_0; |
| + param32.v1 = v32_1; |
| + } |
| + |
| + GLuint64 param64; |
| + struct { |
| + uint32_t v0; |
| + uint32_t v1; |
| + } param32; |
| +}; |
| + |
| +static_assert(sizeof(GLuint64Union) == 8, "size of GLuint64Union should be 8"); |
| +static_assert(offsetof(GLuint64Union, param64) == 0, |
| + "offset of GLuint64Union.param64 should be 0"); |
| +static_assert(offsetof(GLuint64Union, param32.v0) == 0, |
| + "offset of GLuint64Union.param32.v0 should be 0"); |
| +static_assert(offsetof(GLuint64Union, param32.v1) == 4, |
| + "offset of GLuint64Union.param32.v1 should be 4"); |
| + |
| // Used for some glGetXXX commands that return a result through a pointer. We |
| // need to know if the command succeeded or not and the size of the result. If |
| // the command failed its result size will 0. |