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 is here so other GLES2 related files can have a common set of | 5 // This file is here so other GLES2 related files can have a common set of |
6 // includes where appropriate. | 6 // includes where appropriate. |
7 | 7 |
8 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 8 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
9 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 9 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
10 | 10 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 static uint32 GLErrorBitToGLError(uint32 error_bit); | 131 static uint32 GLErrorBitToGLError(uint32 error_bit); |
132 | 132 |
133 static uint32 IndexToGLFaceTarget(int index); | 133 static uint32 IndexToGLFaceTarget(int index); |
134 | 134 |
135 // Returns a bitmask for the channels the given format supports. | 135 // Returns a bitmask for the channels the given format supports. |
136 // See ChannelBits. | 136 // See ChannelBits. |
137 static uint32 GetChannelsForFormat(int format); | 137 static uint32 GetChannelsForFormat(int format); |
138 | 138 |
139 // Returns a bitmask for the channels the given attachment type needs. | 139 // Returns a bitmask for the channels the given attachment type needs. |
140 static uint32 GetChannelsNeededForAttachmentType(int type); | 140 static uint32 GetChannelsNeededForAttachmentType( |
| 141 int type, uint32 max_color_attachments); |
141 | 142 |
142 static bool IsNPOT(uint32 value) { | 143 static bool IsNPOT(uint32 value) { |
143 return value > 0 && (value & (value - 1)) != 0; | 144 return value > 0 && (value & (value - 1)) != 0; |
144 } | 145 } |
145 | 146 |
146 static std::string GetStringEnum(uint32 value); | 147 static std::string GetStringEnum(uint32 value); |
147 static std::string GetStringBool(uint32 value); | 148 static std::string GetStringBool(uint32 value); |
148 static std::string GetStringError(uint32 value); | 149 static std::string GetStringError(uint32 value); |
149 | 150 |
150 // Parses a uniform name. | 151 // Parses a uniform name. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 bool buffer_preserved_; | 191 bool buffer_preserved_; |
191 bool share_resources_; | 192 bool share_resources_; |
192 bool bind_generates_resource_; | 193 bool bind_generates_resource_; |
193 }; | 194 }; |
194 | 195 |
195 } // namespace gles2 | 196 } // namespace gles2 |
196 } // namespace gpu | 197 } // namespace gpu |
197 | 198 |
198 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 199 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
199 | 200 |
OLD | NEW |