Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 contains the GLES2DecoderPassthroughImpl class. | 5 // This file contains the GLES2DecoderPassthroughImpl class. |
| 6 | 6 |
| 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_H_ | 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_H_ |
| 8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_H_ | 8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_H_ |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 void MarkContextLost(error::ContextLostReason reason) override; | 234 void MarkContextLost(error::ContextLostReason reason) override; |
| 235 | 235 |
| 236 Logger* GetLogger() override; | 236 Logger* GetLogger() override; |
| 237 | 237 |
| 238 const ContextState* GetContextState() override; | 238 const ContextState* GetContextState() override; |
| 239 scoped_refptr<ShaderTranslatorInterface> GetTranslator(GLenum type) override; | 239 scoped_refptr<ShaderTranslatorInterface> GetTranslator(GLenum type) override; |
| 240 | 240 |
| 241 private: | 241 private: |
| 242 void BuildExtensionsString(); | 242 void BuildExtensionsString(); |
| 243 | 243 |
| 244 void InsertError(GLenum error, const std::string& message); | |
| 245 GLenum PopError(); | |
| 246 bool FlushErrors(); | |
| 247 | |
| 248 bool IsEmulatedQueryTarget(GLenum target) const; | |
| 249 error::Error ProcessQueries(bool did_finish); | |
| 250 | |
| 244 int commands_to_process_; | 251 int commands_to_process_; |
| 245 | 252 |
| 246 DebugMarkerManager debug_marker_manager_; | 253 DebugMarkerManager debug_marker_manager_; |
| 247 Logger logger_; | 254 Logger logger_; |
| 248 | 255 |
| 249 #define GLES2_CMD_OP(name) \ | 256 #define GLES2_CMD_OP(name) \ |
| 250 Error Handle##name(uint32_t immediate_data_size, const volatile void* data); | 257 Error Handle##name(uint32_t immediate_data_size, const volatile void* data); |
| 251 | 258 |
| 252 GLES2_COMMAND_LIST(GLES2_CMD_OP) | 259 GLES2_COMMAND_LIST(GLES2_CMD_OP) |
| 253 #undef GLES2_CMD_OP | 260 #undef GLES2_CMD_OP |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 296 ClientServiceMap<GLuint, GLuint> query_id_map_; | 303 ClientServiceMap<GLuint, GLuint> query_id_map_; |
| 297 ClientServiceMap<GLuint, GLuint> vertex_array_id_map_; | 304 ClientServiceMap<GLuint, GLuint> vertex_array_id_map_; |
| 298 | 305 |
| 299 // Mailboxes | 306 // Mailboxes |
| 300 scoped_refptr<MailboxManager> mailbox_manager_; | 307 scoped_refptr<MailboxManager> mailbox_manager_; |
| 301 | 308 |
| 302 // State tracking of currently bound 2D textures (client IDs) | 309 // State tracking of currently bound 2D textures (client IDs) |
| 303 size_t active_texture_unit_; | 310 size_t active_texture_unit_; |
| 304 std::vector<GLuint> bound_textures_; | 311 std::vector<GLuint> bound_textures_; |
| 305 | 312 |
| 313 // Track the service-id to type of all queries for validation | |
| 314 struct QueryInfo { | |
| 315 GLenum type = GL_NONE; | |
| 316 }; | |
| 317 std::unordered_map<GLuint, QueryInfo> query_info_map_; | |
|
piman
2016/11/18 19:32:09
nit: any reason to use the service id to index her
Geoff Lang
2016/11/21 18:12:16
I found it needed the same number of lookups becau
| |
| 318 | |
| 319 // All queries that are waiting for their results to be ready | |
| 320 struct PendingQuery { | |
| 321 GLenum target = GL_NONE; | |
| 322 GLuint service_id = 0; | |
| 323 | |
| 324 int32_t shm_id = 0; | |
| 325 uint32_t shm_offset = 0; | |
| 326 base::subtle::Atomic32 submit_count = 0; | |
| 327 }; | |
| 328 std::deque<PendingQuery> pending_queries_; | |
| 329 | |
| 330 // Currently active queries | |
| 331 struct ActiveQuery { | |
| 332 GLuint service_id = 0; | |
| 333 int32_t shm_id = 0; | |
| 334 uint32_t shm_offset = 0; | |
| 335 }; | |
| 336 std::unordered_map<GLenum, ActiveQuery> active_queries_; | |
| 337 | |
| 338 std::set<GLenum> errors_; | |
| 339 | |
| 306 std::vector<std::string> emulated_extensions_; | 340 std::vector<std::string> emulated_extensions_; |
| 307 std::string extension_string_; | 341 std::string extension_string_; |
| 308 | 342 |
| 309 // Include the prototypes of all the doer functions from a separate header to | 343 // Include the prototypes of all the doer functions from a separate header to |
| 310 // keep this file clean. | 344 // keep this file clean. |
| 311 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototyp es.h" | 345 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototyp es.h" |
| 312 }; | 346 }; |
| 313 | 347 |
| 314 } // namespace gles2 | 348 } // namespace gles2 |
| 315 } // namespace gpu | 349 } // namespace gpu |
| 316 | 350 |
| 317 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_H_ | 351 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_H_ |
| OLD | NEW |