Commit 6b4ccf33 authored by Jonathan Backer's avatar Jonathan Backer Committed by Commit Bot

Fix viz memory dumping

When there are multiple windows open with viz, each window has it's own
InProcCmdBuffer. If we do a memory dump with multiple windows, we will
fail DCHECKs on calls from VizProcessContextProvider::OnMemoryDump
because we will have multiple CommandBufferHelpers in the same process
with the same ring_buffer_id_.

https://cs.chromium.org/chromium/src/gpu/command_buffer/client/cmd_buffer_helper.cc?rcl=9c52bb1d0f58d02879f4373f5db09aa625c590a7&l=365

This CL makes the transfer buffer IDs generated by InProcCmdBuffer
unique within a process and avoids the failing check.

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I204098af24c6148c1abe71724dbc5b176ee1a29f
Reviewed-on: https://chromium-review.googlesource.com/1243672Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Jonathan Backer <backer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594084}
parent 7490c3bf
......@@ -89,6 +89,7 @@ namespace {
base::AtomicSequenceNumber g_next_route_id;
base::AtomicSequenceNumber g_next_image_id;
base::AtomicSequenceNumber g_next_transfer_buffer_id;
CommandBufferId NextCommandBufferId() {
return CommandBufferIdFromChannelAndRoute(kInProcessCommandBufferClientId,
......@@ -934,7 +935,7 @@ scoped_refptr<Buffer> InProcessCommandBuffer::CreateTransferBuffer(
size_t size,
int32_t* id) {
scoped_refptr<Buffer> buffer = MakeMemoryBuffer(size);
*id = ++next_transfer_buffer_id_;
*id = g_next_transfer_buffer_id.GetNext() + 1;
ScheduleGpuTask(
base::BindOnce(&InProcessCommandBuffer::RegisterTransferBufferOnGpuThread,
gpu_thread_weak_ptr_factory_.GetWeakPtr(), *id, buffer));
......
......@@ -330,7 +330,6 @@ class GL_IN_PROCESS_CONTEXT_EXPORT InProcessCommandBuffer
int32_t last_put_offset_ = -1;
Capabilities capabilities_;
GpuMemoryBufferManager* gpu_memory_buffer_manager_ = nullptr;
int32_t next_transfer_buffer_id_ = 1;
uint64_t next_fence_sync_release_ = 1;
uint64_t flushed_fence_sync_release_ = 0;
std::vector<SyncToken> next_flush_sync_token_fences_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment