| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // A class to emulate GLES2 over command buffers. | 5 // A class to emulate GLES2 over command buffers. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 8 | 8 |
| 9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
| 10 #include <GLES2/gl2ext.h> | 10 #include <GLES2/gl2ext.h> |
| (...skipping 5368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5379 << sync_point << ")"); | 5379 << sync_point << ")"); |
| 5380 DCHECK(capabilities_.future_sync_points); | 5380 DCHECK(capabilities_.future_sync_points); |
| 5381 helper_->CommandBufferHelper::Flush(); | 5381 helper_->CommandBufferHelper::Flush(); |
| 5382 gpu_control_->RetireSyncPoint(sync_point); | 5382 gpu_control_->RetireSyncPoint(sync_point); |
| 5383 } | 5383 } |
| 5384 | 5384 |
| 5385 uint64_t GLES2Implementation::ShareGroupTracingGUID() const { | 5385 uint64_t GLES2Implementation::ShareGroupTracingGUID() const { |
| 5386 return share_group_->TracingGUID(); | 5386 return share_group_->TracingGUID(); |
| 5387 } | 5387 } |
| 5388 | 5388 |
| 5389 void GLES2Implementation::WaitSyncPointCHROMIUM(GLuint sync_point, |
| 5390 const GLbyte* sync_token) { |
| 5391 // Copy the data over before data access to ensure alignment. |
| 5392 SyncToken sync_token_data; |
| 5393 if (sync_token) |
| 5394 memcpy(&sync_token_data, sync_token, sizeof(SyncToken)); |
| 5395 |
| 5396 if (sync_token_data.HasData()) { |
| 5397 WaitSyncTokenCHROMIUM(sync_token); |
| 5398 } else { |
| 5399 helper_->WaitSyncPointCHROMIUM(sync_point); |
| 5400 } |
| 5401 } |
| 5402 |
| 5389 GLuint64 GLES2Implementation::InsertFenceSyncCHROMIUM() { | 5403 GLuint64 GLES2Implementation::InsertFenceSyncCHROMIUM() { |
| 5390 const uint64_t release = gpu_control_->GenerateFenceSyncRelease(); | 5404 const uint64_t release = gpu_control_->GenerateFenceSyncRelease(); |
| 5391 helper_->InsertFenceSyncCHROMIUM(release); | 5405 helper_->InsertFenceSyncCHROMIUM(release); |
| 5392 return release; | 5406 return release; |
| 5393 } | 5407 } |
| 5394 | 5408 |
| 5395 void GLES2Implementation::GenSyncTokenCHROMIUM(GLuint64 fence_sync, | 5409 void GLES2Implementation::GenSyncTokenCHROMIUM(GLuint64 fence_sync, |
| 5396 GLbyte* sync_token) { | 5410 GLbyte* sync_token) { |
| 5397 if (!sync_token) { | 5411 if (!sync_token) { |
| 5398 SetGLError(GL_INVALID_VALUE, "glGenSyncTokenCHROMIUM", "empty sync_token"); | 5412 SetGLError(GL_INVALID_VALUE, "glGenSyncTokenCHROMIUM", "empty sync_token"); |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5970 CheckGLError(); | 5984 CheckGLError(); |
| 5971 } | 5985 } |
| 5972 | 5986 |
| 5973 // Include the auto-generated part of this file. We split this because it means | 5987 // Include the auto-generated part of this file. We split this because it means |
| 5974 // we can easily edit the non-auto generated parts right here in this file | 5988 // we can easily edit the non-auto generated parts right here in this file |
| 5975 // instead of having to edit some template or the code generator. | 5989 // instead of having to edit some template or the code generator. |
| 5976 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 5990 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 5977 | 5991 |
| 5978 } // namespace gles2 | 5992 } // namespace gles2 |
| 5979 } // namespace gpu | 5993 } // namespace gpu |
| OLD | NEW |