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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h

Issue 2502423003: Implement basic query functionality in the passthrough command buffer. (Closed)
Patch Set: rebase Created 4 years 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 template <typename T> 273 template <typename T>
274 error::Error PatchGetNumericResults(GLenum pname, GLsizei length, T* params); 274 error::Error PatchGetNumericResults(GLenum pname, GLsizei length, T* params);
275 error::Error PatchGetFramebufferAttachmentParameter(GLenum target, 275 error::Error PatchGetFramebufferAttachmentParameter(GLenum target,
276 GLenum attachment, 276 GLenum attachment,
277 GLenum pname, 277 GLenum pname,
278 GLsizei length, 278 GLsizei length,
279 GLint* params); 279 GLint* params);
280 280
281 void BuildExtensionsString(); 281 void BuildExtensionsString();
282 282
283 void InsertError(GLenum error, const std::string& message);
284 GLenum PopError();
285 bool FlushErrors();
286
287 bool IsEmulatedQueryTarget(GLenum target) const;
288 error::Error ProcessQueries(bool did_finish);
289
283 int commands_to_process_; 290 int commands_to_process_;
284 291
285 DebugMarkerManager debug_marker_manager_; 292 DebugMarkerManager debug_marker_manager_;
286 Logger logger_; 293 Logger logger_;
287 294
288 #define GLES2_CMD_OP(name) \ 295 #define GLES2_CMD_OP(name) \
289 Error Handle##name(uint32_t immediate_data_size, const volatile void* data); 296 Error Handle##name(uint32_t immediate_data_size, const volatile void* data);
290 297
291 GLES2_COMMAND_LIST(GLES2_CMD_OP) 298 GLES2_COMMAND_LIST(GLES2_CMD_OP)
292 #undef GLES2_CMD_OP 299 #undef GLES2_CMD_OP
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 ClientServiceMap<GLuint, GLuint> query_id_map_; 342 ClientServiceMap<GLuint, GLuint> query_id_map_;
336 ClientServiceMap<GLuint, GLuint> vertex_array_id_map_; 343 ClientServiceMap<GLuint, GLuint> vertex_array_id_map_;
337 344
338 // Mailboxes 345 // Mailboxes
339 scoped_refptr<MailboxManager> mailbox_manager_; 346 scoped_refptr<MailboxManager> mailbox_manager_;
340 347
341 // State tracking of currently bound 2D textures (client IDs) 348 // State tracking of currently bound 2D textures (client IDs)
342 size_t active_texture_unit_; 349 size_t active_texture_unit_;
343 std::vector<GLuint> bound_textures_; 350 std::vector<GLuint> bound_textures_;
344 351
352 // Track the service-id to type of all queries for validation
353 struct QueryInfo {
354 GLenum type = GL_NONE;
355 };
356 std::unordered_map<GLuint, QueryInfo> query_info_map_;
357
358 // All queries that are waiting for their results to be ready
359 struct PendingQuery {
360 GLenum target = GL_NONE;
361 GLuint service_id = 0;
362
363 int32_t shm_id = 0;
364 uint32_t shm_offset = 0;
365 base::subtle::Atomic32 submit_count = 0;
366 };
367 std::deque<PendingQuery> pending_queries_;
368
369 // Currently active queries
370 struct ActiveQuery {
371 GLuint service_id = 0;
372 int32_t shm_id = 0;
373 uint32_t shm_offset = 0;
374 };
375 std::unordered_map<GLenum, ActiveQuery> active_queries_;
376
377 std::set<GLenum> errors_;
378
345 std::vector<std::string> emulated_extensions_; 379 std::vector<std::string> emulated_extensions_;
346 std::string extension_string_; 380 std::string extension_string_;
347 381
348 // Cache of scratch memory 382 // Cache of scratch memory
349 std::vector<uint8_t> scratch_memory_; 383 std::vector<uint8_t> scratch_memory_;
350 384
351 // Include the prototypes of all the doer functions from a separate header to 385 // Include the prototypes of all the doer functions from a separate header to
352 // keep this file clean. 386 // keep this file clean.
353 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototyp es.h" 387 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototyp es.h"
354 }; 388 };
355 389
356 } // namespace gles2 390 } // namespace gles2
357 } // namespace gpu 391 } // namespace gpu
358 392
359 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_H_ 393 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_H_
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698