Chromium Code Reviews| Index: content/common/gpu/client/command_buffer_proxy_impl.cc |
| diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc |
| index 47e20d149ee54a844113bcb7e88b61ea754ac15b..1d171615b420802b1c51bdb1eed0b6633986f463 100644 |
| --- a/content/common/gpu/client/command_buffer_proxy_impl.cc |
| +++ b/content/common/gpu/client/command_buffer_proxy_impl.cc |
| @@ -449,7 +449,7 @@ int32_t CommandBufferProxyImpl::CreateImage(ClientBuffer buffer, |
| if (image_fence_sync) { |
| gpu::SyncToken sync_token(GetNamespaceID(), GetCommandBufferID(), |
| - image_fence_sync); |
| + GetExtraCommandBufferData(), image_fence_sync); |
| // Force a synchronous IPC to validate sync token. |
| channel_->ValidateFlushIDReachedServer(stream_id_, true); |
| @@ -519,6 +519,10 @@ uint64_t CommandBufferProxyImpl::GetCommandBufferID() const { |
| return command_buffer_id_; |
| } |
| +int32_t CommandBufferProxyImpl::GetExtraCommandBufferData() const { |
| + return stream_id_; |
| +} |
| + |
| uint64_t CommandBufferProxyImpl::GenerateFenceSyncRelease() { |
| return next_fence_sync_release_++; |
| } |
| @@ -577,8 +581,17 @@ bool CommandBufferProxyImpl::CanWaitUnverifiedSyncToken( |
| // Can only wait on an unverified sync token if it is from the same channel. |
| const uint64_t token_channel = sync_token->command_buffer_id() >> 32; |
| const uint64_t channel = command_buffer_id_ >> 32; |
| - return (sync_token->namespace_id() == gpu::CommandBufferNamespace::GPU_IO && |
| - token_channel == channel); |
| + if (sync_token->namespace_id() != gpu::CommandBufferNamespace::GPU_IO || |
| + token_channel != channel) { |
| + return false; |
| + } |
| + |
| + // If waiting on a different stream, flush pending commands on that stream. |
| + const int32_t release_stream_id = sync_token->extra_data_field(); |
|
piman
2015/12/04 00:02:01
nit:
if (release_stream_id == 0)
return false;
David Yen
2015/12/04 00:12:28
Done.
|
| + if (release_stream_id != stream_id_) |
| + channel_->FlushPendingStream(release_stream_id); |
| + |
| + return true; |
| } |
| uint32 CommandBufferProxyImpl::InsertSyncPoint() { |