Chromium Code Reviews| 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 5348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5359 return true; | 5359 return true; |
| 5360 } | 5360 } |
| 5361 | 5361 |
| 5362 GLuint GLES2Implementation::InsertSyncPointCHROMIUM() { | 5362 GLuint GLES2Implementation::InsertSyncPointCHROMIUM() { |
| 5363 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 5363 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| 5364 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glInsertSyncPointCHROMIUM"); | 5364 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glInsertSyncPointCHROMIUM"); |
| 5365 helper_->CommandBufferHelper::Flush(); | 5365 helper_->CommandBufferHelper::Flush(); |
| 5366 return gpu_control_->InsertSyncPoint(); | 5366 return gpu_control_->InsertSyncPoint(); |
| 5367 } | 5367 } |
| 5368 | 5368 |
| 5369 void GLES2Implementation::WaitSyncPointCHROMIUM(GLuint sync_point) { | |
| 5370 // This should no longer be called. | |
| 5371 CHECK(false); | |
|
piman
2015/10/29 00:08:20
nit: NOTREACHED()
David Yen
2015/10/29 17:08:08
Done.
| |
| 5372 } | |
| 5373 | |
| 5369 GLuint GLES2Implementation::InsertFutureSyncPointCHROMIUM() { | 5374 GLuint GLES2Implementation::InsertFutureSyncPointCHROMIUM() { |
| 5370 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 5375 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| 5371 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glInsertFutureSyncPointCHROMIUM"); | 5376 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glInsertFutureSyncPointCHROMIUM"); |
| 5372 DCHECK(capabilities_.future_sync_points); | 5377 DCHECK(capabilities_.future_sync_points); |
| 5373 return gpu_control_->InsertFutureSyncPoint(); | 5378 return gpu_control_->InsertFutureSyncPoint(); |
| 5374 } | 5379 } |
| 5375 | 5380 |
| 5376 void GLES2Implementation::RetireSyncPointCHROMIUM(GLuint sync_point) { | 5381 void GLES2Implementation::RetireSyncPointCHROMIUM(GLuint sync_point) { |
| 5377 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 5382 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| 5378 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glRetireSyncPointCHROMIUM(" | 5383 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glRetireSyncPointCHROMIUM(" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5446 SyncToken sync_token_data; | 5451 SyncToken sync_token_data; |
| 5447 memcpy(&sync_token_data, sync_token, sizeof(SyncToken)); | 5452 memcpy(&sync_token_data, sync_token, sizeof(SyncToken)); |
| 5448 | 5453 |
| 5449 if (!sync_token_data.verified_flush() && | 5454 if (!sync_token_data.verified_flush() && |
| 5450 !gpu_control_->CanWaitUnverifiedSyncToken(&sync_token_data)) { | 5455 !gpu_control_->CanWaitUnverifiedSyncToken(&sync_token_data)) { |
| 5451 SetGLError(GL_INVALID_VALUE, "glWaitSyncTokenCHROMIUM", | 5456 SetGLError(GL_INVALID_VALUE, "glWaitSyncTokenCHROMIUM", |
| 5452 "Cannot wait on sync_token which has not been verified"); | 5457 "Cannot wait on sync_token which has not been verified"); |
| 5453 return; | 5458 return; |
| 5454 } | 5459 } |
| 5455 | 5460 |
| 5456 helper_->WaitSyncTokenCHROMIUM(sync_token_data.namespace_id(), | 5461 // TODO(dyen): Temporarily support old sync points, remove once all old sync |
| 5457 sync_token_data.command_buffer_id(), | 5462 // points have been removed. |
| 5458 sync_token_data.release_count()); | 5463 const gpu::CommandBufferNamespace namespace_id = |
| 5464 sync_token_data.namespace_id(); | |
| 5465 if (namespace_id == gpu::CommandBufferNamespace::OLD_SYNC_POINTS) { | |
| 5466 const uint32_t sync_point = | |
| 5467 static_cast<uint32_t>(sync_token_data.release_count()); | |
| 5468 helper_->WaitSyncPointCHROMIUM(sync_point); | |
| 5469 return; | |
| 5470 } | |
| 5471 | |
| 5472 helper_->WaitSyncTokenCHROMIUM( | |
| 5473 static_cast<GLuint>(sync_token_data.namespace_id()), | |
| 5474 sync_token_data.command_buffer_id(), sync_token_data.release_count()); | |
| 5459 } | 5475 } |
| 5460 | 5476 |
| 5461 namespace { | 5477 namespace { |
| 5462 | 5478 |
| 5463 bool ValidImageFormat(GLenum internalformat, | 5479 bool ValidImageFormat(GLenum internalformat, |
| 5464 const Capabilities& capabilities) { | 5480 const Capabilities& capabilities) { |
| 5465 switch (internalformat) { | 5481 switch (internalformat) { |
| 5466 case GL_ATC_RGB_AMD: | 5482 case GL_ATC_RGB_AMD: |
| 5467 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD: | 5483 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD: |
| 5468 return capabilities.texture_format_atc; | 5484 return capabilities.texture_format_atc; |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5970 CheckGLError(); | 5986 CheckGLError(); |
| 5971 } | 5987 } |
| 5972 | 5988 |
| 5973 // Include the auto-generated part of this file. We split this because it means | 5989 // 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 | 5990 // 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. | 5991 // instead of having to edit some template or the code generator. |
| 5976 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 5992 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 5977 | 5993 |
| 5978 } // namespace gles2 | 5994 } // namespace gles2 |
| 5979 } // namespace gpu | 5995 } // namespace gpu |
| OLD | NEW |