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 11545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11556 case GL_GET_ERROR_QUERY_CHROMIUM: | 11556 case GL_GET_ERROR_QUERY_CHROMIUM: |
11557 break; | 11557 break; |
11558 case GL_COMMANDS_COMPLETED_CHROMIUM: | 11558 case GL_COMMANDS_COMPLETED_CHROMIUM: |
11559 if (!features().chromium_sync_query) { | 11559 if (!features().chromium_sync_query) { |
11560 LOCAL_SET_GL_ERROR( | 11560 LOCAL_SET_GL_ERROR( |
11561 GL_INVALID_OPERATION, "glBeginQueryEXT", | 11561 GL_INVALID_OPERATION, "glBeginQueryEXT", |
11562 "not enabled for commands completed queries"); | 11562 "not enabled for commands completed queries"); |
11563 return error::kNoError; | 11563 return error::kNoError; |
11564 } | 11564 } |
11565 break; | 11565 break; |
11566 default: | 11566 case GL_SAMPLES_PASSED: |
| 11567 case GL_ANY_SAMPLES_PASSED: |
| 11568 case GL_ANY_SAMPLES_PASSED_CONSERVATIVE: |
11567 if (!features().occlusion_query_boolean) { | 11569 if (!features().occlusion_query_boolean) { |
11568 LOCAL_SET_GL_ERROR( | 11570 LOCAL_SET_GL_ERROR( |
11569 GL_INVALID_OPERATION, "glBeginQueryEXT", | 11571 GL_INVALID_OPERATION, "glBeginQueryEXT", |
11570 "not enabled for occlusion queries"); | 11572 "not enabled for occlusion queries"); |
11571 return error::kNoError; | 11573 return error::kNoError; |
11572 } | 11574 } |
11573 break; | 11575 break; |
| 11576 case GL_TIME_ELAPSED: |
| 11577 if (!query_manager_->GPUTimingAvailable()) { |
| 11578 LOCAL_SET_GL_ERROR( |
| 11579 GL_INVALID_OPERATION, "glBeginQueryEXT", |
| 11580 "not enabled for timing queries"); |
| 11581 return error::kNoError; |
| 11582 } |
| 11583 break; |
| 11584 default: |
| 11585 LOCAL_SET_GL_ERROR( |
| 11586 GL_INVALID_OPERATION, "glBeginQueryEXT", |
| 11587 "unknown query target"); |
| 11588 return error::kNoError; |
11574 } | 11589 } |
11575 | 11590 |
11576 if (state_.current_queries.find(target) != state_.current_queries.end()) { | 11591 if (state_.current_queries.find(target) != state_.current_queries.end()) { |
11577 LOCAL_SET_GL_ERROR( | 11592 LOCAL_SET_GL_ERROR( |
11578 GL_INVALID_OPERATION, "glBeginQueryEXT", "query already in progress"); | 11593 GL_INVALID_OPERATION, "glBeginQueryEXT", "query already in progress"); |
11579 return error::kNoError; | 11594 return error::kNoError; |
11580 } | 11595 } |
11581 | 11596 |
11582 if (client_id == 0) { | 11597 if (client_id == 0) { |
11583 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glBeginQueryEXT", "id is 0"); | 11598 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glBeginQueryEXT", "id is 0"); |
(...skipping 2095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13679 } | 13694 } |
13680 } | 13695 } |
13681 | 13696 |
13682 // Include the auto-generated part of this file. We split this because it means | 13697 // Include the auto-generated part of this file. We split this because it means |
13683 // we can easily edit the non-auto generated parts right here in this file | 13698 // we can easily edit the non-auto generated parts right here in this file |
13684 // instead of having to edit some template or the code generator. | 13699 // instead of having to edit some template or the code generator. |
13685 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 13700 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
13686 | 13701 |
13687 } // namespace gles2 | 13702 } // namespace gles2 |
13688 } // namespace gpu | 13703 } // namespace gpu |
OLD | NEW |