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 5465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5476 } | 5476 } |
5477 | 5477 |
5478 void GLES2Implementation::GetQueryivEXT( | 5478 void GLES2Implementation::GetQueryivEXT( |
5479 GLenum target, GLenum pname, GLint* params) { | 5479 GLenum target, GLenum pname, GLint* params) { |
5480 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 5480 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
5481 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] GetQueryivEXT(" | 5481 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] GetQueryivEXT(" |
5482 << GLES2Util::GetStringQueryTarget(target) << ", " | 5482 << GLES2Util::GetStringQueryTarget(target) << ", " |
5483 << GLES2Util::GetStringQueryParameter(pname) << ", " | 5483 << GLES2Util::GetStringQueryParameter(pname) << ", " |
5484 << static_cast<const void*>(params) << ")"); | 5484 << static_cast<const void*>(params) << ")"); |
5485 if (pname == GL_QUERY_COUNTER_BITS_EXT) { | 5485 if (pname == GL_QUERY_COUNTER_BITS_EXT) { |
5486 // We convert all queries to CPU time so we support 64 bits. | 5486 switch (target) { |
5487 *params = 64; | 5487 case GL_TIMESTAMP_EXT: |
| 5488 // Overall reliable driver support for timestamps is limited, so we |
| 5489 // disable the timestamp portion of this extension to encourage use of |
| 5490 // the better supported time elapsed queries. |
| 5491 *params = 0; |
| 5492 break; |
| 5493 case GL_TIME_ELAPSED_EXT: |
| 5494 // We convert all queries to CPU time so we support 64 bits. |
| 5495 *params = 64; |
| 5496 break; |
| 5497 default: |
| 5498 SetGLErrorInvalidEnum("glGetQueryivEXT", target, "target"); |
| 5499 break; |
| 5500 } |
5488 return; | 5501 return; |
5489 } else if (pname != GL_CURRENT_QUERY_EXT) { | 5502 } else if (pname != GL_CURRENT_QUERY_EXT) { |
5490 SetGLErrorInvalidEnum("glGetQueryivEXT", pname, "pname"); | 5503 SetGLErrorInvalidEnum("glGetQueryivEXT", pname, "pname"); |
5491 return; | 5504 return; |
5492 } | 5505 } |
5493 QueryTracker::Query* query = query_tracker_->GetCurrentQuery(target); | 5506 QueryTracker::Query* query = query_tracker_->GetCurrentQuery(target); |
5494 *params = query ? query->id() : 0; | 5507 *params = query ? query->id() : 0; |
5495 GPU_CLIENT_LOG(" " << *params); | 5508 GPU_CLIENT_LOG(" " << *params); |
5496 CheckGLError(); | 5509 CheckGLError(); |
5497 } | 5510 } |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6823 cached_extensions_.clear(); | 6836 cached_extensions_.clear(); |
6824 } | 6837 } |
6825 | 6838 |
6826 // Include the auto-generated part of this file. We split this because it means | 6839 // Include the auto-generated part of this file. We split this because it means |
6827 // we can easily edit the non-auto generated parts right here in this file | 6840 // we can easily edit the non-auto generated parts right here in this file |
6828 // instead of having to edit some template or the code generator. | 6841 // instead of having to edit some template or the code generator. |
6829 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 6842 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
6830 | 6843 |
6831 } // namespace gles2 | 6844 } // namespace gles2 |
6832 } // namespace gpu | 6845 } // namespace gpu |
OLD | NEW |