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

Side by Side Diff: gpu/command_buffer/common/gles2_cmd_format.h

Issue 2826043002: Do not share FBOs/VAOs/Transform feedback objects across contexts (Closed)
Patch Set: added DeleteFramebuffers() expectation Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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
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 class SharedIdNamespaces {
64 kBuffers, 64 kBuffers,
65 kFramebuffers,
66 kProgramsAndShaders, 65 kProgramsAndShaders,
67 kRenderbuffers, 66 kRenderbuffers,
68 kTextures, 67 kTextures,
68 kSamplers,
69 kSyncs,
70 kNumSharedIdNamespaces
71 };
72
73 enum class IdNamespaces {
74 kFramebuffers,
69 kQueries, 75 kQueries,
70 kVertexArrays, 76 kVertexArrays,
71 kSamplers,
72 kTransformFeedbacks, 77 kTransformFeedbacks,
73 kSyncs,
74 kNumIdNamespaces 78 kNumIdNamespaces
75 }; 79 };
76 80
77 enum RangeIdNamespaces { kPaths, kNumRangeIdNamespaces }; 81 enum RangeIdNamespaces { kPaths, kNumRangeIdNamespaces };
78 82
79 // These numbers must not change 83 // These numbers must not change
80 static_assert(kBuffers == 0, "kBuffers should equal 0"); 84 static_assert(static_cast<int>(SharedIdNamespaces::kBuffers) == 0,
81 static_assert(kFramebuffers == 1, "kFramebuffers should equal 1"); 85 "kBuffers should equal 0");
82 static_assert(kProgramsAndShaders == 2, "kProgramsAndShaders should equal 2"); 86 static_assert(static_cast<int>(SharedIdNamespaces::kProgramsAndShaders) == 1,
83 static_assert(kRenderbuffers == 3, "kRenderbuffers should equal 3"); 87 "kProgramsAndShaders should equal 1");
84 static_assert(kTextures == 4, "kTextures should equal 4"); 88 static_assert(static_cast<int>(SharedIdNamespaces::kRenderbuffers) == 2,
89 "kRenderbuffers should equal 2");
90 static_assert(static_cast<int>(SharedIdNamespaces::kTextures) == 3,
91 "kTextures should equal 3");
92 static_assert(static_cast<int>(SharedIdNamespaces::kSamplers) == 4,
93 "kSamplers should equal 4");
94 static_assert(static_cast<int>(SharedIdNamespaces::kSyncs) == 5,
95 "kProgramsAndShaders should equal 5");
96 static_assert(static_cast<int>(IdNamespaces::kFramebuffers) == 0,
97 "kFramebuffers should equal 0");
98 static_assert(static_cast<int>(IdNamespaces::kQueries) == 1,
99 "kQueries should equal 1");
100 static_assert(static_cast<int>(IdNamespaces::kVertexArrays) == 2,
101 "kVertexArrays should equal 2");
102 static_assert(static_cast<int>(IdNamespaces::kTransformFeedbacks) == 3,
103 "kTransformFeedbacks should equal 3");
85 static_assert(kPaths == 0, "kPaths should equal 0"); 104 static_assert(kPaths == 0, "kPaths should equal 0");
86 105
87 } // namespace id_namespaces 106 } // namespace id_namespaces
88 107
89 // Used for some glGetXXX commands that return a result through a pointer. We 108 // 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 109 // 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. 110 // the command failed its result size will 0.
92 template <typename T> 111 template <typename T>
93 struct SizedResult { 112 struct SizedResult {
94 typedef T Type; 113 typedef T Type;
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 310
292 #include "../common/gles2_cmd_format_autogen.h" 311 #include "../common/gles2_cmd_format_autogen.h"
293 312
294 #pragma pack(pop) 313 #pragma pack(pop)
295 314
296 } // namespace cmd 315 } // namespace cmd
297 } // namespace gles2 316 } // namespace gles2
298 } // namespace gpu 317 } // namespace gpu
299 318
300 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ 319 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698