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 <list> | 10 #include <list> |
(...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1866 base::TimeDelta total_processing_commands_time_; | 1866 base::TimeDelta total_processing_commands_time_; |
1867 | 1867 |
1868 // States related to each manager. | 1868 // States related to each manager. |
1869 DecoderTextureState texture_state_; | 1869 DecoderTextureState texture_state_; |
1870 DecoderFramebufferState framebuffer_state_; | 1870 DecoderFramebufferState framebuffer_state_; |
1871 | 1871 |
1872 scoped_ptr<GPUTracer> gpu_tracer_; | 1872 scoped_ptr<GPUTracer> gpu_tracer_; |
1873 scoped_ptr<GPUStateTracer> gpu_state_tracer_; | 1873 scoped_ptr<GPUStateTracer> gpu_state_tracer_; |
1874 const unsigned char* cb_command_trace_category_; | 1874 const unsigned char* cb_command_trace_category_; |
1875 const unsigned char* gpu_decoder_category_; | 1875 const unsigned char* gpu_decoder_category_; |
1876 const unsigned char* gpu_group_marker_category_; | |
1877 int gpu_trace_level_; | 1876 int gpu_trace_level_; |
1878 bool gpu_trace_commands_; | 1877 bool gpu_trace_commands_; |
1879 bool gpu_debug_commands_; | 1878 bool gpu_debug_commands_; |
1880 | 1879 |
1881 std::queue<linked_ptr<FenceCallback> > pending_readpixel_fences_; | 1880 std::queue<linked_ptr<FenceCallback> > pending_readpixel_fences_; |
1882 | 1881 |
1883 // Used to validate multisample renderbuffers if needed | 1882 // Used to validate multisample renderbuffers if needed |
1884 GLuint validation_texture_; | 1883 GLuint validation_texture_; |
1885 GLuint validation_fbo_multisample_; | 1884 GLuint validation_fbo_multisample_; |
1886 GLuint validation_fbo_; | 1885 GLuint validation_fbo_; |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2384 switches::kEnableGPUServiceLoggingGPU)), | 2383 switches::kEnableGPUServiceLoggingGPU)), |
2385 viewport_max_width_(0), | 2384 viewport_max_width_(0), |
2386 viewport_max_height_(0), | 2385 viewport_max_height_(0), |
2387 texture_state_(group_->feature_info() | 2386 texture_state_(group_->feature_info() |
2388 ->workarounds() | 2387 ->workarounds() |
2389 .texsubimage2d_faster_than_teximage2d), | 2388 .texsubimage2d_faster_than_teximage2d), |
2390 cb_command_trace_category_(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( | 2389 cb_command_trace_category_(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( |
2391 TRACE_DISABLED_BY_DEFAULT("cb_command"))), | 2390 TRACE_DISABLED_BY_DEFAULT("cb_command"))), |
2392 gpu_decoder_category_(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( | 2391 gpu_decoder_category_(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( |
2393 TRACE_DISABLED_BY_DEFAULT("gpu_decoder"))), | 2392 TRACE_DISABLED_BY_DEFAULT("gpu_decoder"))), |
2394 gpu_group_marker_category_(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( | |
2395 TRACE_DISABLED_BY_DEFAULT("gpu_group_marker"))), | |
2396 gpu_trace_level_(2), | 2393 gpu_trace_level_(2), |
2397 gpu_trace_commands_(false), | 2394 gpu_trace_commands_(false), |
2398 gpu_debug_commands_(false), | 2395 gpu_debug_commands_(false), |
2399 validation_texture_(0), | 2396 validation_texture_(0), |
2400 validation_fbo_multisample_(0), | 2397 validation_fbo_multisample_(0), |
2401 validation_fbo_(0) { | 2398 validation_fbo_(0) { |
2402 DCHECK(group); | 2399 DCHECK(group); |
2403 | 2400 |
2404 attrib_0_value_.v[0] = 0.0f; | 2401 attrib_0_value_.v[0] = 0.0f; |
2405 attrib_0_value_.v[1] = 0.0f; | 2402 attrib_0_value_.v[1] = 0.0f; |
(...skipping 8563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10969 length ? std::string(marker, length) : std::string(marker)); | 10966 length ? std::string(marker, length) : std::string(marker)); |
10970 } | 10967 } |
10971 | 10968 |
10972 void GLES2DecoderImpl::DoPushGroupMarkerEXT( | 10969 void GLES2DecoderImpl::DoPushGroupMarkerEXT( |
10973 GLsizei length, const GLchar* marker) { | 10970 GLsizei length, const GLchar* marker) { |
10974 if (!marker) { | 10971 if (!marker) { |
10975 marker = ""; | 10972 marker = ""; |
10976 } | 10973 } |
10977 std::string name = length ? std::string(marker, length) : std::string(marker); | 10974 std::string name = length ? std::string(marker, length) : std::string(marker); |
10978 debug_marker_manager_.PushGroup(name); | 10975 debug_marker_manager_.PushGroup(name); |
10979 if (*gpu_group_marker_category_) { | 10976 gpu_tracer_->Begin(TRACE_DISABLED_BY_DEFAULT("gpu_group_marker"), name, |
10980 gpu_tracer_->Begin(TRACE_DISABLED_BY_DEFAULT("gpu_group_marker"), name, | 10977 kTraceGroupMarker); |
10981 kTraceGroupMarker); | |
10982 } | |
10983 } | 10978 } |
10984 | 10979 |
10985 void GLES2DecoderImpl::DoPopGroupMarkerEXT(void) { | 10980 void GLES2DecoderImpl::DoPopGroupMarkerEXT(void) { |
10986 debug_marker_manager_.PopGroup(); | 10981 debug_marker_manager_.PopGroup(); |
10987 if (*gpu_group_marker_category_) { | 10982 gpu_tracer_->End(kTraceGroupMarker); |
10988 gpu_tracer_->End(kTraceGroupMarker); | |
10989 } | |
10990 } | 10983 } |
10991 | 10984 |
10992 void GLES2DecoderImpl::DoBindTexImage2DCHROMIUM( | 10985 void GLES2DecoderImpl::DoBindTexImage2DCHROMIUM( |
10993 GLenum target, GLint image_id) { | 10986 GLenum target, GLint image_id) { |
10994 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoBindTexImage2DCHROMIUM"); | 10987 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoBindTexImage2DCHROMIUM"); |
10995 | 10988 |
10996 if (target == GL_TEXTURE_CUBE_MAP) { | 10989 if (target == GL_TEXTURE_CUBE_MAP) { |
10997 LOCAL_SET_GL_ERROR( | 10990 LOCAL_SET_GL_ERROR( |
10998 GL_INVALID_ENUM, | 10991 GL_INVALID_ENUM, |
10999 "glBindTexImage2DCHROMIUM", "invalid target"); | 10992 "glBindTexImage2DCHROMIUM", "invalid target"); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11099 if (!gpu_tracer_->Begin(category_name, trace_name, kTraceCHROMIUM)) { | 11092 if (!gpu_tracer_->Begin(category_name, trace_name, kTraceCHROMIUM)) { |
11100 LOCAL_SET_GL_ERROR( | 11093 LOCAL_SET_GL_ERROR( |
11101 GL_INVALID_OPERATION, | 11094 GL_INVALID_OPERATION, |
11102 "glTraceBeginCHROMIUM", "unable to create begin trace"); | 11095 "glTraceBeginCHROMIUM", "unable to create begin trace"); |
11103 return error::kNoError; | 11096 return error::kNoError; |
11104 } | 11097 } |
11105 return error::kNoError; | 11098 return error::kNoError; |
11106 } | 11099 } |
11107 | 11100 |
11108 void GLES2DecoderImpl::DoTraceEndCHROMIUM() { | 11101 void GLES2DecoderImpl::DoTraceEndCHROMIUM() { |
11109 if (gpu_tracer_->CurrentCategory().empty() || | 11102 const std::string& category = gpu_tracer_->CurrentCategory(kTraceCHROMIUM); |
11110 gpu_tracer_->CurrentName().empty()) { | 11103 const std::string& name = gpu_tracer_->CurrentName(kTraceCHROMIUM); |
11111 LOCAL_SET_GL_ERROR( | 11104 if (category.empty() || name.empty()) { |
11112 GL_INVALID_OPERATION, | 11105 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, |
11113 "glTraceEndCHROMIUM", "no trace begin found"); | 11106 "glTraceEndCHROMIUM", "no trace begin found"); |
11114 return; | 11107 return; |
11115 } | 11108 } |
11116 TRACE_EVENT_COPY_ASYNC_END0(gpu_tracer_->CurrentCategory().c_str(), | 11109 TRACE_EVENT_COPY_ASYNC_END0(category.c_str(), name.c_str(), this); |
vmiura
2014/12/16 23:40:11
This seems like it might have the same problem, wh
David Yen
2014/12/17 18:29:35
Done.
| |
11117 gpu_tracer_->CurrentName().c_str(), this); | |
11118 gpu_tracer_->End(kTraceCHROMIUM); | 11110 gpu_tracer_->End(kTraceCHROMIUM); |
11119 } | 11111 } |
11120 | 11112 |
11121 void GLES2DecoderImpl::DoDrawBuffersEXT( | 11113 void GLES2DecoderImpl::DoDrawBuffersEXT( |
11122 GLsizei count, const GLenum* bufs) { | 11114 GLsizei count, const GLenum* bufs) { |
11123 if (count > static_cast<GLsizei>(group_->max_draw_buffers())) { | 11115 if (count > static_cast<GLsizei>(group_->max_draw_buffers())) { |
11124 LOCAL_SET_GL_ERROR( | 11116 LOCAL_SET_GL_ERROR( |
11125 GL_INVALID_VALUE, | 11117 GL_INVALID_VALUE, |
11126 "glDrawBuffersEXT", "greater than GL_MAX_DRAW_BUFFERS_EXT"); | 11118 "glDrawBuffersEXT", "greater than GL_MAX_DRAW_BUFFERS_EXT"); |
11127 return; | 11119 return; |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11532 } | 11524 } |
11533 } | 11525 } |
11534 | 11526 |
11535 // Include the auto-generated part of this file. We split this because it means | 11527 // Include the auto-generated part of this file. We split this because it means |
11536 // we can easily edit the non-auto generated parts right here in this file | 11528 // we can easily edit the non-auto generated parts right here in this file |
11537 // instead of having to edit some template or the code generator. | 11529 // instead of having to edit some template or the code generator. |
11538 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 11530 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
11539 | 11531 |
11540 } // namespace gles2 | 11532 } // namespace gles2 |
11541 } // namespace gpu | 11533 } // namespace gpu |
OLD | NEW |