| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 #include "gpu/command_buffer/common/gles2_cmd_format_autogen.h" | 86 #include "gpu/command_buffer/common/gles2_cmd_format_autogen.h" |
| 87 | 87 |
| 88 // These are hand written commands. | 88 // These are hand written commands. |
| 89 // TODO(gman): Attempt to make these auto-generated. | 89 // TODO(gman): Attempt to make these auto-generated. |
| 90 | 90 |
| 91 struct GetAttribLocation { | 91 struct GetAttribLocation { |
| 92 typedef GetAttribLocation ValueType; | 92 typedef GetAttribLocation ValueType; |
| 93 static const CommandId kCmdId = kGetAttribLocation; | 93 static const CommandId kCmdId = kGetAttribLocation; |
| 94 static const cmd::ArgFlags kArgFlags = cmd::kFixed; | 94 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 95 | 95 |
| 96 typedef GLint Result; | |
| 97 | |
| 98 static uint32 ComputeSize() { | 96 static uint32 ComputeSize() { |
| 99 return static_cast<uint32>(sizeof(ValueType)); // NOLINT | 97 return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| 100 } | 98 } |
| 101 | 99 |
| 102 void SetHeader() { | 100 void SetHeader() { |
| 103 header.SetCmd<ValueType>(); | 101 header.SetCmd<ValueType>(); |
| 104 } | 102 } |
| 105 | 103 |
| 106 void Init( | 104 void Init( |
| 107 GLuint _program, uint32 _name_shm_id, uint32 _name_shm_offset, | 105 GLuint _program, uint32 _name_shm_id, uint32 _name_shm_offset, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 COMPILE_ASSERT(offsetof(GetAttribLocation, location_shm_offset) == 20, | 149 COMPILE_ASSERT(offsetof(GetAttribLocation, location_shm_offset) == 20, |
| 152 OffsetOf_GetAttribLocation_location_shm_offset_not_20); | 150 OffsetOf_GetAttribLocation_location_shm_offset_not_20); |
| 153 COMPILE_ASSERT(offsetof(GetAttribLocation, data_size) == 24, | 151 COMPILE_ASSERT(offsetof(GetAttribLocation, data_size) == 24, |
| 154 OffsetOf_GetAttribLocation_data_size_not_24); | 152 OffsetOf_GetAttribLocation_data_size_not_24); |
| 155 | 153 |
| 156 struct GetAttribLocationImmediate { | 154 struct GetAttribLocationImmediate { |
| 157 typedef GetAttribLocationImmediate ValueType; | 155 typedef GetAttribLocationImmediate ValueType; |
| 158 static const CommandId kCmdId = kGetAttribLocationImmediate; | 156 static const CommandId kCmdId = kGetAttribLocationImmediate; |
| 159 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; | 157 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| 160 | 158 |
| 161 typedef GLint Result; | |
| 162 | |
| 163 static uint32 ComputeDataSize(const char* s) { | 159 static uint32 ComputeDataSize(const char* s) { |
| 164 return strlen(s); | 160 return strlen(s); |
| 165 } | 161 } |
| 166 | 162 |
| 167 static uint32 ComputeSize(const char* s) { | 163 static uint32 ComputeSize(const char* s) { |
| 168 return static_cast<uint32>(sizeof(ValueType) + ComputeDataSize(s)); | 164 return static_cast<uint32>(sizeof(ValueType) + ComputeDataSize(s)); |
| 169 } | 165 } |
| 170 | 166 |
| 171 void SetHeader(const char* s) { | 167 void SetHeader(const char* s) { |
| 172 header.SetCmdByTotalSize<ValueType>(ComputeSize(s)); | 168 header.SetCmdByTotalSize<ValueType>(ComputeSize(s)); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 COMPILE_ASSERT(offsetof(GetAttribLocationImmediate, location_shm_offset) == 12, | 206 COMPILE_ASSERT(offsetof(GetAttribLocationImmediate, location_shm_offset) == 12, |
| 211 OffsetOf_GetAttribLocationImmediate_location_shm_offset_not_12); | 207 OffsetOf_GetAttribLocationImmediate_location_shm_offset_not_12); |
| 212 COMPILE_ASSERT(offsetof(GetAttribLocationImmediate, data_size) == 16, | 208 COMPILE_ASSERT(offsetof(GetAttribLocationImmediate, data_size) == 16, |
| 213 OffsetOf_GetAttribLocationImmediate_data_size_not_16); | 209 OffsetOf_GetAttribLocationImmediate_data_size_not_16); |
| 214 | 210 |
| 215 struct GetUniformLocation { | 211 struct GetUniformLocation { |
| 216 typedef GetUniformLocation ValueType; | 212 typedef GetUniformLocation ValueType; |
| 217 static const CommandId kCmdId = kGetUniformLocation; | 213 static const CommandId kCmdId = kGetUniformLocation; |
| 218 static const cmd::ArgFlags kArgFlags = cmd::kFixed; | 214 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 219 | 215 |
| 220 typedef GLint Result; | |
| 221 | |
| 222 static uint32 ComputeSize() { | 216 static uint32 ComputeSize() { |
| 223 return static_cast<uint32>(sizeof(ValueType)); // NOLINT | 217 return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| 224 } | 218 } |
| 225 | 219 |
| 226 void SetHeader() { | 220 void SetHeader() { |
| 227 header.SetCmd<ValueType>(); | 221 header.SetCmd<ValueType>(); |
| 228 } | 222 } |
| 229 | 223 |
| 230 void Init( | 224 void Init( |
| 231 GLuint _program, uint32 _name_shm_id, uint32 _name_shm_offset, | 225 GLuint _program, uint32 _name_shm_id, uint32 _name_shm_offset, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 COMPILE_ASSERT(offsetof(GetUniformLocation, location_shm_offset) == 20, | 269 COMPILE_ASSERT(offsetof(GetUniformLocation, location_shm_offset) == 20, |
| 276 OffsetOf_GetUniformLocation_location_shm_offset_not_20); | 270 OffsetOf_GetUniformLocation_location_shm_offset_not_20); |
| 277 COMPILE_ASSERT(offsetof(GetUniformLocation, data_size) == 24, | 271 COMPILE_ASSERT(offsetof(GetUniformLocation, data_size) == 24, |
| 278 OffsetOf_GetUniformLocation_data_size_not_24); | 272 OffsetOf_GetUniformLocation_data_size_not_24); |
| 279 | 273 |
| 280 struct GetUniformLocationImmediate { | 274 struct GetUniformLocationImmediate { |
| 281 typedef GetUniformLocationImmediate ValueType; | 275 typedef GetUniformLocationImmediate ValueType; |
| 282 static const CommandId kCmdId = kGetUniformLocationImmediate; | 276 static const CommandId kCmdId = kGetUniformLocationImmediate; |
| 283 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; | 277 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| 284 | 278 |
| 285 typedef GLint Result; | |
| 286 | |
| 287 static uint32 ComputeDataSize(const char* s) { | 279 static uint32 ComputeDataSize(const char* s) { |
| 288 return strlen(s); | 280 return strlen(s); |
| 289 } | 281 } |
| 290 | 282 |
| 291 static uint32 ComputeSize(const char* s) { | 283 static uint32 ComputeSize(const char* s) { |
| 292 return static_cast<uint32>(sizeof(ValueType) + ComputeDataSize(s)); | 284 return static_cast<uint32>(sizeof(ValueType) + ComputeDataSize(s)); |
| 293 } | 285 } |
| 294 | 286 |
| 295 void SetHeader(const char* s) { | 287 void SetHeader(const char* s) { |
| 296 header.SetCmdByTotalSize<ValueType>(ComputeSize(s)); | 288 header.SetCmdByTotalSize<ValueType>(ComputeSize(s)); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, data_size) == 16, | 329 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, data_size) == 16, |
| 338 OffsetOf_GetUniformLocationImmediate_data_size_not_16); | 330 OffsetOf_GetUniformLocationImmediate_data_size_not_16); |
| 339 | 331 |
| 340 #pragma pack(pop) | 332 #pragma pack(pop) |
| 341 | 333 |
| 342 } // namespace gles2 | 334 } // namespace gles2 |
| 343 } // namespace gpu | 335 } // namespace gpu |
| 344 | 336 |
| 345 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ | 337 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ |
| 346 | 338 |
| OLD | NEW |