Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file defines the GLES2 command buffer commands. | 5 // This file defines the GLES2 command buffer commands. |
| 6 | 6 |
| 7 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ | 7 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ |
| 8 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ | 8 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ |
| 9 | 9 |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 | 53 |
| 54 // Command buffer is GPU_COMMAND_BUFFER_ENTRY_ALIGNMENT byte aligned. | 54 // Command buffer is GPU_COMMAND_BUFFER_ENTRY_ALIGNMENT byte aligned. |
| 55 #pragma pack(push, 4) | 55 #pragma pack(push, 4) |
| 56 static_assert(GPU_COMMAND_BUFFER_ENTRY_ALIGNMENT == 4, | 56 static_assert(GPU_COMMAND_BUFFER_ENTRY_ALIGNMENT == 4, |
| 57 "pragma pack alignment must be equal to " | 57 "pragma pack alignment must be equal to " |
| 58 "GPU_COMMAND_BUFFER_ENTRY_ALIGNMENT"); | 58 "GPU_COMMAND_BUFFER_ENTRY_ALIGNMENT"); |
| 59 | 59 |
| 60 namespace id_namespaces { | 60 namespace id_namespaces { |
| 61 | 61 |
| 62 // These are used when contexts share resources. | 62 // These are used when contexts share resources. |
| 63 enum IdNamespaces { | 63 enum SharedIdNamespaces { |
| 64 kBuffers, | 64 kBuffers, |
| 65 kFramebuffers, | |
| 66 kProgramsAndShaders, | 65 kProgramsAndShaders, |
| 67 kRenderbuffers, | 66 kRenderbuffers, |
| 68 kTextures, | 67 kTextures, |
| 69 kQueries, | |
| 70 kVertexArrays, | |
| 71 kSamplers, | 68 kSamplers, |
| 72 kTransformFeedbacks, | 69 kTransformFeedbacks, |
|
Zhenyao Mo
2017/04/19 20:24:28
Transform feedback objects are also not shared.
Chandan
2017/04/20 10:56:07
Sure. I will add necessary changes for this too.
| |
| 73 kSyncs, | 70 kSyncs, |
| 74 kNumIdNamespaces | 71 kNumSharedIdNamespaces |
| 75 }; | 72 }; |
| 76 | 73 |
| 74 enum IdNamespaces { kFramebuffers, kQueries, kVertexArrays, kNumIdNamespaces }; | |
|
Zhenyao Mo
2017/04/19 20:24:28
Although in general I agree with the spirit of thi
Chandan
2017/04/20 10:56:07
I had to split this to create IdAllocators only fo
Zhenyao Mo
2017/05/09 22:21:54
Per offline discussion with piman, we can use enum
Chandan
2017/05/10 14:47:37
By mapping, you mean converting enums to int using
| |
| 75 | |
| 77 enum RangeIdNamespaces { kPaths, kNumRangeIdNamespaces }; | 76 enum RangeIdNamespaces { kPaths, kNumRangeIdNamespaces }; |
| 78 | 77 |
| 79 // These numbers must not change | 78 // These numbers must not change |
| 80 static_assert(kBuffers == 0, "kBuffers should equal 0"); | 79 static_assert(kBuffers == 0, "kBuffers should equal 0"); |
| 81 static_assert(kFramebuffers == 1, "kFramebuffers should equal 1"); | 80 static_assert(kProgramsAndShaders == 1, "kProgramsAndShaders should equal 1"); |
| 82 static_assert(kProgramsAndShaders == 2, "kProgramsAndShaders should equal 2"); | 81 static_assert(kRenderbuffers == 2, "kRenderbuffers should equal 2"); |
| 83 static_assert(kRenderbuffers == 3, "kRenderbuffers should equal 3"); | 82 static_assert(kTextures == 3, "kTextures should equal 4"); |
|
Zhenyao Mo
2017/05/09 22:21:54
These need to be updated.
Chandan
2017/05/10 14:47:37
Need to add static_assert for other enum values as
| |
| 84 static_assert(kTextures == 4, "kTextures should equal 4"); | |
| 85 static_assert(kPaths == 0, "kPaths should equal 0"); | 83 static_assert(kPaths == 0, "kPaths should equal 0"); |
| 86 | 84 |
| 87 } // namespace id_namespaces | 85 } // namespace id_namespaces |
| 88 | 86 |
| 89 // Used for some glGetXXX commands that return a result through a pointer. We | 87 // Used for some glGetXXX commands that return a result through a pointer. We |
| 90 // need to know if the command succeeded or not and the size of the result. If | 88 // need to know if the command succeeded or not and the size of the result. If |
| 91 // the command failed its result size will 0. | 89 // the command failed its result size will 0. |
| 92 template <typename T> | 90 template <typename T> |
| 93 struct SizedResult { | 91 struct SizedResult { |
| 94 typedef T Type; | 92 typedef T Type; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 | 289 |
| 292 #include "../common/gles2_cmd_format_autogen.h" | 290 #include "../common/gles2_cmd_format_autogen.h" |
| 293 | 291 |
| 294 #pragma pack(pop) | 292 #pragma pack(pop) |
| 295 | 293 |
| 296 } // namespace cmd | 294 } // namespace cmd |
| 297 } // namespace gles2 | 295 } // namespace gles2 |
| 298 } // namespace gpu | 296 } // namespace gpu |
| 299 | 297 |
| 300 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ | 298 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ |
| OLD | NEW |