OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // This is here because service side code must include the system's version of | 10 // This is here because service side code must include the system's version of |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 void* cmd, GLuint _program, uint32 _name_shm_id, uint32 _name_shm_offset, | 62 void* cmd, GLuint _program, uint32 _name_shm_id, uint32 _name_shm_offset, |
63 uint32 _location_shm_id, uint32 _location_shm_offset, | 63 uint32 _location_shm_id, uint32 _location_shm_offset, |
64 uint32 _data_size) { | 64 uint32 _data_size) { |
65 static_cast<ValueType*>( | 65 static_cast<ValueType*>( |
66 cmd)->Init( | 66 cmd)->Init( |
67 _program, _name_shm_id, _name_shm_offset, _location_shm_id, | 67 _program, _name_shm_id, _name_shm_offset, _location_shm_id, |
68 _location_shm_offset, _data_size); | 68 _location_shm_offset, _data_size); |
69 return NextCmdAddress<ValueType>(cmd); | 69 return NextCmdAddress<ValueType>(cmd); |
70 } | 70 } |
71 | 71 |
72 gpu::CommandHeader header; | 72 CommandHeader header; |
73 uint32 program; | 73 uint32 program; |
74 uint32 name_shm_id; | 74 uint32 name_shm_id; |
75 uint32 name_shm_offset; | 75 uint32 name_shm_offset; |
76 uint32 location_shm_id; | 76 uint32 location_shm_id; |
77 uint32 location_shm_offset; | 77 uint32 location_shm_offset; |
78 uint32 data_size; | 78 uint32 data_size; |
79 }; | 79 }; |
80 | 80 |
81 COMPILE_ASSERT(sizeof(GetAttribLocation) == 28, | 81 COMPILE_ASSERT(sizeof(GetAttribLocation) == 28, |
82 Sizeof_GetAttribLocation_is_not_28); | 82 Sizeof_GetAttribLocation_is_not_28); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 void* Set( | 126 void* Set( |
127 void* cmd, GLuint _program, const char* _name, | 127 void* cmd, GLuint _program, const char* _name, |
128 uint32 _location_shm_id, uint32 _location_shm_offset) { | 128 uint32 _location_shm_id, uint32 _location_shm_offset) { |
129 uint32 total_size = ComputeSize(_name); | 129 uint32 total_size = ComputeSize(_name); |
130 static_cast<ValueType*>( | 130 static_cast<ValueType*>( |
131 cmd)->Init(_program, _name, _location_shm_id, _location_shm_offset); | 131 cmd)->Init(_program, _name, _location_shm_id, _location_shm_offset); |
132 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); | 132 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); |
133 } | 133 } |
134 | 134 |
135 gpu::CommandHeader header; | 135 CommandHeader header; |
136 uint32 program; | 136 uint32 program; |
137 uint32 location_shm_id; | 137 uint32 location_shm_id; |
138 uint32 location_shm_offset; | 138 uint32 location_shm_offset; |
139 uint32 data_size; | 139 uint32 data_size; |
140 }; | 140 }; |
141 | 141 |
142 COMPILE_ASSERT(sizeof(GetAttribLocationImmediate) == 20, | 142 COMPILE_ASSERT(sizeof(GetAttribLocationImmediate) == 20, |
143 Sizeof_GetAttribLocationImmediate_is_not_20); | 143 Sizeof_GetAttribLocationImmediate_is_not_20); |
144 COMPILE_ASSERT(offsetof(GetAttribLocationImmediate, header) == 0, | 144 COMPILE_ASSERT(offsetof(GetAttribLocationImmediate, header) == 0, |
145 OffsetOf_GetAttribLocationImmediate_header_not_0); | 145 OffsetOf_GetAttribLocationImmediate_header_not_0); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 void* cmd, GLuint _program, uint32 _name_shm_id, uint32 _name_shm_offset, | 182 void* cmd, GLuint _program, uint32 _name_shm_id, uint32 _name_shm_offset, |
183 uint32 _location_shm_id, uint32 _location_shm_offset, | 183 uint32 _location_shm_id, uint32 _location_shm_offset, |
184 uint32 _data_size) { | 184 uint32 _data_size) { |
185 static_cast<ValueType*>( | 185 static_cast<ValueType*>( |
186 cmd)->Init( | 186 cmd)->Init( |
187 _program, _name_shm_id, _name_shm_offset, _location_shm_id, | 187 _program, _name_shm_id, _name_shm_offset, _location_shm_id, |
188 _location_shm_offset, _data_size); | 188 _location_shm_offset, _data_size); |
189 return NextCmdAddress<ValueType>(cmd); | 189 return NextCmdAddress<ValueType>(cmd); |
190 } | 190 } |
191 | 191 |
192 gpu::CommandHeader header; | 192 CommandHeader header; |
193 uint32 program; | 193 uint32 program; |
194 uint32 name_shm_id; | 194 uint32 name_shm_id; |
195 uint32 name_shm_offset; | 195 uint32 name_shm_offset; |
196 uint32 location_shm_id; | 196 uint32 location_shm_id; |
197 uint32 location_shm_offset; | 197 uint32 location_shm_offset; |
198 uint32 data_size; | 198 uint32 data_size; |
199 }; | 199 }; |
200 | 200 |
201 COMPILE_ASSERT(sizeof(GetUniformLocation) == 28, | 201 COMPILE_ASSERT(sizeof(GetUniformLocation) == 28, |
202 Sizeof_GetUniformLocation_is_not_28); | 202 Sizeof_GetUniformLocation_is_not_28); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 245 |
246 void* Set( | 246 void* Set( |
247 void* cmd, GLuint _program, const char* _name, | 247 void* cmd, GLuint _program, const char* _name, |
248 uint32 _location_shm_id, uint32 _location_shm_offset) { | 248 uint32 _location_shm_id, uint32 _location_shm_offset) { |
249 uint32 total_size = ComputeSize(_name); | 249 uint32 total_size = ComputeSize(_name); |
250 static_cast<ValueType*>( | 250 static_cast<ValueType*>( |
251 cmd)->Init(_program, _name, _location_shm_id, _location_shm_offset); | 251 cmd)->Init(_program, _name, _location_shm_id, _location_shm_offset); |
252 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); | 252 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); |
253 } | 253 } |
254 | 254 |
255 gpu::CommandHeader header; | 255 CommandHeader header; |
256 uint32 program; | 256 uint32 program; |
257 uint32 location_shm_id; | 257 uint32 location_shm_id; |
258 uint32 location_shm_offset; | 258 uint32 location_shm_offset; |
259 uint32 data_size; | 259 uint32 data_size; |
260 }; | 260 }; |
261 | 261 |
262 COMPILE_ASSERT(sizeof(GetUniformLocationImmediate) == 20, | 262 COMPILE_ASSERT(sizeof(GetUniformLocationImmediate) == 20, |
263 Sizeof_GetUniformLocationImmediate_is_not_20); | 263 Sizeof_GetUniformLocationImmediate_is_not_20); |
264 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, header) == 0, | 264 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, header) == 0, |
265 OffsetOf_GetUniformLocationImmediate_header_not_0); | 265 OffsetOf_GetUniformLocationImmediate_header_not_0); |
266 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, program) == 4, | 266 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, program) == 4, |
267 OffsetOf_GetUniformLocationImmediate_program_not_4); | 267 OffsetOf_GetUniformLocationImmediate_program_not_4); |
268 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, location_shm_id) == 8, | 268 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, location_shm_id) == 8, |
269 OffsetOf_GetUniformLocationImmediate_location_shm_id_not_8); | 269 OffsetOf_GetUniformLocationImmediate_location_shm_id_not_8); |
270 COMPILE_ASSERT( | 270 COMPILE_ASSERT( |
271 offsetof(GetUniformLocationImmediate, location_shm_offset) == 12, | 271 offsetof(GetUniformLocationImmediate, location_shm_offset) == 12, |
272 OffsetOf_GetUniformLocationImmediate_location_shm_offset_not_12); | 272 OffsetOf_GetUniformLocationImmediate_location_shm_offset_not_12); |
273 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, data_size) == 16, | 273 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, data_size) == 16, |
274 OffsetOf_GetUniformLocationImmediate_data_size_not_16); | 274 OffsetOf_GetUniformLocationImmediate_data_size_not_16); |
275 | 275 |
276 | 276 |
277 } // namespace gles2 | 277 } // namespace gles2 |
278 } // namespace gpu | 278 } // namespace gpu |
279 | 279 |
280 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ | 280 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ |
281 | 281 |
OLD | NEW |