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 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 11581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11592 case GL_GET_ERROR_QUERY_CHROMIUM: | 11592 case GL_GET_ERROR_QUERY_CHROMIUM: |
11593 break; | 11593 break; |
11594 case GL_COMMANDS_COMPLETED_CHROMIUM: | 11594 case GL_COMMANDS_COMPLETED_CHROMIUM: |
11595 if (!features().chromium_sync_query) { | 11595 if (!features().chromium_sync_query) { |
11596 LOCAL_SET_GL_ERROR( | 11596 LOCAL_SET_GL_ERROR( |
11597 GL_INVALID_OPERATION, "glBeginQueryEXT", | 11597 GL_INVALID_OPERATION, "glBeginQueryEXT", |
11598 "not enabled for commands completed queries"); | 11598 "not enabled for commands completed queries"); |
11599 return error::kNoError; | 11599 return error::kNoError; |
11600 } | 11600 } |
11601 break; | 11601 break; |
11602 default: | 11602 case GL_SAMPLES_PASSED: |
| 11603 case GL_ANY_SAMPLES_PASSED: |
| 11604 case GL_ANY_SAMPLES_PASSED_CONSERVATIVE: |
11603 if (!features().occlusion_query_boolean) { | 11605 if (!features().occlusion_query_boolean) { |
11604 LOCAL_SET_GL_ERROR( | 11606 LOCAL_SET_GL_ERROR( |
11605 GL_INVALID_OPERATION, "glBeginQueryEXT", | 11607 GL_INVALID_OPERATION, "glBeginQueryEXT", |
11606 "not enabled for occlusion queries"); | 11608 "not enabled for occlusion queries"); |
11607 return error::kNoError; | 11609 return error::kNoError; |
11608 } | 11610 } |
11609 break; | 11611 break; |
| 11612 case GL_TIME_ELAPSED: |
| 11613 if (!query_manager_->GPUTimingAvailable()) { |
| 11614 LOCAL_SET_GL_ERROR( |
| 11615 GL_INVALID_OPERATION, "glBeginQueryEXT", |
| 11616 "not enabled for timing queries"); |
| 11617 return error::kNoError; |
| 11618 } |
| 11619 break; |
| 11620 default: |
| 11621 LOCAL_SET_GL_ERROR( |
| 11622 GL_INVALID_OPERATION, "glBeginQueryEXT", |
| 11623 "unknown query target"); |
| 11624 return error::kNoError; |
11610 } | 11625 } |
11611 | 11626 |
11612 if (state_.current_queries.find(target) != state_.current_queries.end()) { | 11627 if (state_.current_queries.find(target) != state_.current_queries.end()) { |
11613 LOCAL_SET_GL_ERROR( | 11628 LOCAL_SET_GL_ERROR( |
11614 GL_INVALID_OPERATION, "glBeginQueryEXT", "query already in progress"); | 11629 GL_INVALID_OPERATION, "glBeginQueryEXT", "query already in progress"); |
11615 return error::kNoError; | 11630 return error::kNoError; |
11616 } | 11631 } |
11617 | 11632 |
11618 if (client_id == 0) { | 11633 if (client_id == 0) { |
11619 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glBeginQueryEXT", "id is 0"); | 11634 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glBeginQueryEXT", "id is 0"); |
(...skipping 2107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13727 } | 13742 } |
13728 } | 13743 } |
13729 | 13744 |
13730 // Include the auto-generated part of this file. We split this because it means | 13745 // Include the auto-generated part of this file. We split this because it means |
13731 // we can easily edit the non-auto generated parts right here in this file | 13746 // we can easily edit the non-auto generated parts right here in this file |
13732 // instead of having to edit some template or the code generator. | 13747 // instead of having to edit some template or the code generator. |
13733 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 13748 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
13734 | 13749 |
13735 } // namespace gles2 | 13750 } // namespace gles2 |
13736 } // namespace gpu | 13751 } // namespace gpu |
OLD | NEW |