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 5534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5545 "invalid fence sync"); | 5545 "invalid fence sync"); |
5546 return; | 5546 return; |
5547 } else if (!gpu_control_->IsFenceSyncFlushReceived(fence_sync)) { | 5547 } else if (!gpu_control_->IsFenceSyncFlushReceived(fence_sync)) { |
5548 SetGLError(GL_INVALID_OPERATION, "glGenSyncTokenCHROMIUM", | 5548 SetGLError(GL_INVALID_OPERATION, "glGenSyncTokenCHROMIUM", |
5549 "fence sync must be flushed before generating sync token"); | 5549 "fence sync must be flushed before generating sync token"); |
5550 return; | 5550 return; |
5551 } | 5551 } |
5552 | 5552 |
5553 // Copy the data over after setting the data to ensure alignment. | 5553 // Copy the data over after setting the data to ensure alignment. |
5554 SyncToken sync_token_data(gpu_control_->GetNamespaceID(), | 5554 SyncToken sync_token_data(gpu_control_->GetNamespaceID(), |
| 5555 gpu_control_->GetExtraCommandBufferData(), |
5555 gpu_control_->GetCommandBufferID(), fence_sync); | 5556 gpu_control_->GetCommandBufferID(), fence_sync); |
5556 sync_token_data.SetVerifyFlush(); | 5557 sync_token_data.SetVerifyFlush(); |
5557 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); | 5558 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); |
5558 } | 5559 } |
5559 | 5560 |
5560 void GLES2Implementation::GenUnverifiedSyncTokenCHROMIUM(GLuint64 fence_sync, | 5561 void GLES2Implementation::GenUnverifiedSyncTokenCHROMIUM(GLuint64 fence_sync, |
5561 GLbyte* sync_token) { | 5562 GLbyte* sync_token) { |
5562 if (!sync_token) { | 5563 if (!sync_token) { |
5563 SetGLError(GL_INVALID_VALUE, "glGenNonFlushedSyncTokenCHROMIUM", | 5564 SetGLError(GL_INVALID_VALUE, "glGenNonFlushedSyncTokenCHROMIUM", |
5564 "empty sync_token"); | 5565 "empty sync_token"); |
5565 return; | 5566 return; |
5566 } else if (!gpu_control_->IsFenceSyncRelease(fence_sync)) { | 5567 } else if (!gpu_control_->IsFenceSyncRelease(fence_sync)) { |
5567 SetGLError(GL_INVALID_VALUE, "glGenNonFlushedSyncTokenCHROMIUM", | 5568 SetGLError(GL_INVALID_VALUE, "glGenNonFlushedSyncTokenCHROMIUM", |
5568 "invalid fence sync"); | 5569 "invalid fence sync"); |
5569 return; | 5570 return; |
5570 } else if (!gpu_control_->IsFenceSyncFlushed(fence_sync)) { | 5571 } else if (!gpu_control_->IsFenceSyncFlushed(fence_sync)) { |
5571 SetGLError(GL_INVALID_OPERATION, "glGenSyncTokenCHROMIUM", | 5572 SetGLError(GL_INVALID_OPERATION, "glGenSyncTokenCHROMIUM", |
5572 "fence sync must be flushed before generating sync token"); | 5573 "fence sync must be flushed before generating sync token"); |
5573 return; | 5574 return; |
5574 } | 5575 } |
5575 | 5576 |
5576 // Copy the data over after setting the data to ensure alignment. | 5577 // Copy the data over after setting the data to ensure alignment. |
5577 SyncToken sync_token_data(gpu_control_->GetNamespaceID(), | 5578 SyncToken sync_token_data(gpu_control_->GetNamespaceID(), |
| 5579 gpu_control_->GetExtraCommandBufferData(), |
5578 gpu_control_->GetCommandBufferID(), fence_sync); | 5580 gpu_control_->GetCommandBufferID(), fence_sync); |
5579 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); | 5581 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); |
5580 } | 5582 } |
5581 | 5583 |
5582 void GLES2Implementation::WaitSyncTokenCHROMIUM(const GLbyte* sync_token) { | 5584 void GLES2Implementation::WaitSyncTokenCHROMIUM(const GLbyte* sync_token) { |
5583 if (sync_token) { | 5585 if (sync_token) { |
5584 // Copy the data over before data access to ensure alignment. | 5586 // Copy the data over before data access to ensure alignment. |
5585 SyncToken sync_token_data; | 5587 SyncToken sync_token_data; |
5586 memcpy(&sync_token_data, sync_token, sizeof(SyncToken)); | 5588 memcpy(&sync_token_data, sync_token, sizeof(SyncToken)); |
5587 if (sync_token_data.HasData()) { | 5589 if (sync_token_data.HasData()) { |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6504 CheckGLError(); | 6506 CheckGLError(); |
6505 } | 6507 } |
6506 | 6508 |
6507 // Include the auto-generated part of this file. We split this because it means | 6509 // Include the auto-generated part of this file. We split this because it means |
6508 // we can easily edit the non-auto generated parts right here in this file | 6510 // we can easily edit the non-auto generated parts right here in this file |
6509 // instead of having to edit some template or the code generator. | 6511 // instead of having to edit some template or the code generator. |
6510 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 6512 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
6511 | 6513 |
6512 } // namespace gles2 | 6514 } // namespace gles2 |
6513 } // namespace gpu | 6515 } // namespace gpu |
OLD | NEW |