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/gl2ext.h> | 9 #include <GLES2/gl2ext.h> |
10 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
(...skipping 4912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4923 GLuint binding) { | 4923 GLuint binding) { |
4924 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 4924 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
4925 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniformBlockBinding(" << program | 4925 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniformBlockBinding(" << program |
4926 << ", " << index << ", " << binding << ")"); | 4926 << ", " << index << ", " << binding << ")"); |
4927 share_group_->program_info_manager()->UniformBlockBinding( | 4927 share_group_->program_info_manager()->UniformBlockBinding( |
4928 this, program, index, binding); | 4928 this, program, index, binding); |
4929 helper_->UniformBlockBinding(program, index, binding); | 4929 helper_->UniformBlockBinding(program, index, binding); |
4930 CheckGLError(); | 4930 CheckGLError(); |
4931 } | 4931 } |
4932 | 4932 |
4933 GLenum GLES2Implementation::ClientWaitSync( | |
4934 GLsync sync, GLbitfield flags, GLuint64 timeout) { | |
4935 GPU_CLIENT_SINGLE_THREAD_CHECK(); | |
4936 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glClientWaitSync(" << sync | |
4937 << ", " << flags << ", " << timeout << ")"); | |
4938 typedef cmds::ClientWaitSync::Result Result; | |
4939 Result* result = GetResultAs<Result*>(); | |
4940 if (!result) { | |
4941 SetGLError(GL_OUT_OF_MEMORY, "ClientWaitSync", ""); | |
4942 return GL_WAIT_FAILED; | |
4943 } | |
4944 *result = GL_WAIT_FAILED; | |
4945 uint32_t v32_0 = 0, v32_1 = 0; | |
4946 GLES2Util::MapUint64ToTwoUint32(timeout, &v32_0, &v32_1); | |
4947 helper_->ClientWaitSync( | |
4948 ToGLuint(sync), flags, v32_0, v32_1, | |
4949 GetResultShmId(), GetResultShmOffset()); | |
4950 WaitForCmd(); | |
4951 GPU_CLIENT_LOG("returned " << *result); | |
4952 CheckGLError(); | |
4953 return *result; | |
4954 } | |
4955 | |
4956 void GLES2Implementation::WaitSync( | |
4957 GLsync sync, GLbitfield flags, GLuint64 timeout) { | |
4958 GPU_CLIENT_SINGLE_THREAD_CHECK(); | |
4959 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glWaitSync(" << sync << ", " | |
4960 << flags << ", " << timeout << ")"); | |
4961 uint32_t v32_0 = 0, v32_1 = 0; | |
4962 GLES2Util::MapUint64ToTwoUint32(timeout, &v32_0, &v32_1); | |
4963 helper_->WaitSync(ToGLuint(sync), flags, v32_0, v32_1); | |
4964 CheckGLError(); | |
4965 } | |
4966 | 4933 |
4967 // Include the auto-generated part of this file. We split this because it means | 4934 // Include the auto-generated part of this file. We split this because it means |
4968 // we can easily edit the non-auto generated parts right here in this file | 4935 // we can easily edit the non-auto generated parts right here in this file |
4969 // instead of having to edit some template or the code generator. | 4936 // instead of having to edit some template or the code generator. |
4970 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 4937 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
4971 | 4938 |
4972 } // namespace gles2 | 4939 } // namespace gles2 |
4973 } // namespace gpu | 4940 } // namespace gpu |
OLD | NEW |