| 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 <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 } | 472 } |
| 473 | 473 |
| 474 uint32_t GLES2Decoder::GetAndClearBackbufferClearBitsForTest() { | 474 uint32_t GLES2Decoder::GetAndClearBackbufferClearBitsForTest() { |
| 475 return 0; | 475 return 0; |
| 476 } | 476 } |
| 477 | 477 |
| 478 GLES2Decoder::GLES2Decoder() | 478 GLES2Decoder::GLES2Decoder() |
| 479 : initialized_(false), | 479 : initialized_(false), |
| 480 debug_(false), | 480 debug_(false), |
| 481 log_commands_(false), | 481 log_commands_(false), |
| 482 unsafe_es3_apis_enabled_(false) { | 482 es3_apis_enabled_(false) { |
| 483 } | 483 } |
| 484 | 484 |
| 485 GLES2Decoder::~GLES2Decoder() { | 485 GLES2Decoder::~GLES2Decoder() { |
| 486 } | 486 } |
| 487 | 487 |
| 488 void GLES2Decoder::BeginDecoding() {} | 488 void GLES2Decoder::BeginDecoding() {} |
| 489 | 489 |
| 490 void GLES2Decoder::EndDecoding() {} | 490 void GLES2Decoder::EndDecoding() {} |
| 491 | 491 |
| 492 error::Error GLES2Decoder::DoCommand(unsigned int command, | 492 error::Error GLES2Decoder::DoCommand(unsigned int command, |
| (...skipping 2596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3089 transform_feedback_manager_.reset(new TransformFeedbackManager( | 3089 transform_feedback_manager_.reset(new TransformFeedbackManager( |
| 3090 group_->max_transform_feedback_separate_attribs(), needs_emulation)); | 3090 group_->max_transform_feedback_separate_attribs(), needs_emulation)); |
| 3091 | 3091 |
| 3092 if (feature_info_->IsWebGL2OrES3Context()) { | 3092 if (feature_info_->IsWebGL2OrES3Context()) { |
| 3093 if (!feature_info_->IsES3Capable()) { | 3093 if (!feature_info_->IsES3Capable()) { |
| 3094 LOG(ERROR) << "Underlying driver does not support ES3."; | 3094 LOG(ERROR) << "Underlying driver does not support ES3."; |
| 3095 Destroy(true); | 3095 Destroy(true); |
| 3096 return false; | 3096 return false; |
| 3097 } | 3097 } |
| 3098 feature_info_->EnableES3Validators(); | 3098 feature_info_->EnableES3Validators(); |
| 3099 set_unsafe_es3_apis_enabled(true); | 3099 set_es3_apis_enabled(true); |
| 3100 | 3100 |
| 3101 frag_depth_explicitly_enabled_ = true; | 3101 frag_depth_explicitly_enabled_ = true; |
| 3102 draw_buffers_explicitly_enabled_ = true; | 3102 draw_buffers_explicitly_enabled_ = true; |
| 3103 // TODO(zmo): Look into shader_texture_lod_explicitly_enabled_ situation. | 3103 // TODO(zmo): Look into shader_texture_lod_explicitly_enabled_ situation. |
| 3104 | 3104 |
| 3105 // Create a fake default transform feedback and bind to it. | 3105 // Create a fake default transform feedback and bind to it. |
| 3106 GLuint default_transform_feedback = 0; | 3106 GLuint default_transform_feedback = 0; |
| 3107 glGenTransformFeedbacks(1, &default_transform_feedback); | 3107 glGenTransformFeedbacks(1, &default_transform_feedback); |
| 3108 state_.default_transform_feedback = | 3108 state_.default_transform_feedback = |
| 3109 transform_feedback_manager_->CreateTransformFeedback( | 3109 transform_feedback_manager_->CreateTransformFeedback( |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3528 DoGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, | 3528 DoGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, |
| 3529 &caps.max_vertex_texture_image_units, 1); | 3529 &caps.max_vertex_texture_image_units, 1); |
| 3530 DoGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &caps.max_vertex_uniform_vectors, | 3530 DoGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &caps.max_vertex_uniform_vectors, |
| 3531 1); | 3531 1); |
| 3532 DoGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, | 3532 DoGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, |
| 3533 &caps.num_compressed_texture_formats, 1); | 3533 &caps.num_compressed_texture_formats, 1); |
| 3534 DoGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &caps.num_shader_binary_formats, | 3534 DoGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &caps.num_shader_binary_formats, |
| 3535 1); | 3535 1); |
| 3536 DoGetIntegerv(GL_BIND_GENERATES_RESOURCE_CHROMIUM, | 3536 DoGetIntegerv(GL_BIND_GENERATES_RESOURCE_CHROMIUM, |
| 3537 &caps.bind_generates_resource_chromium, 1); | 3537 &caps.bind_generates_resource_chromium, 1); |
| 3538 if (unsafe_es3_apis_enabled()) { | 3538 if (es3_apis_enabled()) { |
| 3539 // TODO(zmo): Note that some parameter values could be more than 32-bit, | 3539 // TODO(zmo): Note that some parameter values could be more than 32-bit, |
| 3540 // but for now we clamp them to 32-bit max. | 3540 // but for now we clamp them to 32-bit max. |
| 3541 DoGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &caps.max_3d_texture_size, 1); | 3541 DoGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &caps.max_3d_texture_size, 1); |
| 3542 DoGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &caps.max_array_texture_layers, | 3542 DoGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &caps.max_array_texture_layers, |
| 3543 1); | 3543 1); |
| 3544 DoGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &caps.max_color_attachments, 1); | 3544 DoGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &caps.max_color_attachments, 1); |
| 3545 DoGetInteger64v(GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS, | 3545 DoGetInteger64v(GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS, |
| 3546 &caps.max_combined_fragment_uniform_components, 1); | 3546 &caps.max_combined_fragment_uniform_components, 1); |
| 3547 DoGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, | 3547 DoGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, |
| 3548 &caps.max_combined_uniform_blocks, 1); | 3548 &caps.max_combined_uniform_blocks, 1); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3590 DoGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, | 3590 DoGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, |
| 3591 &caps.num_program_binary_formats, 1); | 3591 &caps.num_program_binary_formats, 1); |
| 3592 DoGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, | 3592 DoGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, |
| 3593 &caps.uniform_buffer_offset_alignment, 1); | 3593 &caps.uniform_buffer_offset_alignment, 1); |
| 3594 // TODO(zmo): once we switch to MANGLE, we should query version numbers. | 3594 // TODO(zmo): once we switch to MANGLE, we should query version numbers. |
| 3595 caps.major_version = 3; | 3595 caps.major_version = 3; |
| 3596 caps.minor_version = 0; | 3596 caps.minor_version = 0; |
| 3597 } | 3597 } |
| 3598 if (feature_info_->feature_flags().multisampled_render_to_texture || | 3598 if (feature_info_->feature_flags().multisampled_render_to_texture || |
| 3599 feature_info_->feature_flags().chromium_framebuffer_multisample || | 3599 feature_info_->feature_flags().chromium_framebuffer_multisample || |
| 3600 unsafe_es3_apis_enabled()) { | 3600 es3_apis_enabled()) { |
| 3601 DoGetIntegerv(GL_MAX_SAMPLES, &caps.max_samples, 1); | 3601 DoGetIntegerv(GL_MAX_SAMPLES, &caps.max_samples, 1); |
| 3602 } | 3602 } |
| 3603 | 3603 |
| 3604 caps.egl_image_external = | 3604 caps.egl_image_external = |
| 3605 feature_info_->feature_flags().oes_egl_image_external; | 3605 feature_info_->feature_flags().oes_egl_image_external; |
| 3606 caps.texture_format_astc = | 3606 caps.texture_format_astc = |
| 3607 feature_info_->feature_flags().ext_texture_format_astc; | 3607 feature_info_->feature_flags().ext_texture_format_astc; |
| 3608 caps.texture_format_atc = | 3608 caps.texture_format_atc = |
| 3609 feature_info_->feature_flags().ext_texture_format_atc; | 3609 feature_info_->feature_flags().ext_texture_format_atc; |
| 3610 caps.texture_format_bgra8888 = | 3610 caps.texture_format_bgra8888 = |
| (...skipping 2605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6216 } | 6216 } |
| 6217 return true; | 6217 return true; |
| 6218 case GL_MAX_VERTEX_UNIFORM_VECTORS: | 6218 case GL_MAX_VERTEX_UNIFORM_VECTORS: |
| 6219 *num_written = 1; | 6219 *num_written = 1; |
| 6220 if (params) { | 6220 if (params) { |
| 6221 *params = group_->max_vertex_uniform_vectors(); | 6221 *params = group_->max_vertex_uniform_vectors(); |
| 6222 } | 6222 } |
| 6223 return true; | 6223 return true; |
| 6224 } | 6224 } |
| 6225 } | 6225 } |
| 6226 if (unsafe_es3_apis_enabled()) { | 6226 if (es3_apis_enabled()) { |
| 6227 switch (pname) { | 6227 switch (pname) { |
| 6228 case GL_MAX_VARYING_COMPONENTS: { | 6228 case GL_MAX_VARYING_COMPONENTS: { |
| 6229 if (gl_version_info().is_es) { | 6229 if (gl_version_info().is_es) { |
| 6230 // We can just delegate this query to the driver. | 6230 // We can just delegate this query to the driver. |
| 6231 *num_written = 1; | 6231 *num_written = 1; |
| 6232 break; | 6232 break; |
| 6233 } | 6233 } |
| 6234 | 6234 |
| 6235 // GL_MAX_VARYING_COMPONENTS is deprecated in the desktop | 6235 // GL_MAX_VARYING_COMPONENTS is deprecated in the desktop |
| 6236 // OpenGL core profile, so for simplicity, just compute it | 6236 // OpenGL core profile, so for simplicity, just compute it |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6808 DoGetIntegerv(pname, values.get(), params_size); | 6808 DoGetIntegerv(pname, values.get(), params_size); |
| 6809 for (GLsizei ii = 0; ii < params_size; ++ii) { | 6809 for (GLsizei ii = 0; ii < params_size; ++ii) { |
| 6810 params[ii] = static_cast<GLfloat>(values[ii]); | 6810 params[ii] = static_cast<GLfloat>(values[ii]); |
| 6811 } | 6811 } |
| 6812 } | 6812 } |
| 6813 | 6813 |
| 6814 void GLES2DecoderImpl::DoGetInteger64v(GLenum pname, | 6814 void GLES2DecoderImpl::DoGetInteger64v(GLenum pname, |
| 6815 GLint64* params, | 6815 GLint64* params, |
| 6816 GLsizei params_size) { | 6816 GLsizei params_size) { |
| 6817 DCHECK(params); | 6817 DCHECK(params); |
| 6818 if (unsafe_es3_apis_enabled()) { | 6818 if (es3_apis_enabled()) { |
| 6819 switch (pname) { | 6819 switch (pname) { |
| 6820 case GL_MAX_ELEMENT_INDEX: { | 6820 case GL_MAX_ELEMENT_INDEX: { |
| 6821 DCHECK_EQ(params_size, 1); | 6821 DCHECK_EQ(params_size, 1); |
| 6822 if (gl_version_info().IsAtLeastGLES(3, 0) || | 6822 if (gl_version_info().IsAtLeastGLES(3, 0) || |
| 6823 gl_version_info().IsAtLeastGL(4, 3)) { | 6823 gl_version_info().IsAtLeastGL(4, 3)) { |
| 6824 glGetInteger64v(GL_MAX_ELEMENT_INDEX, params); | 6824 glGetInteger64v(GL_MAX_ELEMENT_INDEX, params); |
| 6825 } else { | 6825 } else { |
| 6826 // Assume that desktop GL implementations can generally support | 6826 // Assume that desktop GL implementations can generally support |
| 6827 // 32-bit indices. | 6827 // 32-bit indices. |
| 6828 if (params) { | 6828 if (params) { |
| (...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7690 | 7690 |
| 7691 void GLES2DecoderImpl::DoGetFramebufferAttachmentParameteriv( | 7691 void GLES2DecoderImpl::DoGetFramebufferAttachmentParameteriv( |
| 7692 GLenum target, | 7692 GLenum target, |
| 7693 GLenum attachment, | 7693 GLenum attachment, |
| 7694 GLenum pname, | 7694 GLenum pname, |
| 7695 GLint* params, | 7695 GLint* params, |
| 7696 GLsizei params_size) { | 7696 GLsizei params_size) { |
| 7697 const char kFunctionName[] = "glGetFramebufferAttachmentParameteriv"; | 7697 const char kFunctionName[] = "glGetFramebufferAttachmentParameteriv"; |
| 7698 Framebuffer* framebuffer = GetFramebufferInfoForTarget(target); | 7698 Framebuffer* framebuffer = GetFramebufferInfoForTarget(target); |
| 7699 if (!framebuffer) { | 7699 if (!framebuffer) { |
| 7700 if (!unsafe_es3_apis_enabled()) { | 7700 if (!es3_apis_enabled()) { |
| 7701 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName, | 7701 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName, |
| 7702 "no framebuffer bound"); | 7702 "no framebuffer bound"); |
| 7703 return; | 7703 return; |
| 7704 } | 7704 } |
| 7705 if (!validators_->backbuffer_attachment.IsValid(attachment)) { | 7705 if (!validators_->backbuffer_attachment.IsValid(attachment)) { |
| 7706 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName, | 7706 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName, |
| 7707 "invalid attachment for backbuffer"); | 7707 "invalid attachment for backbuffer"); |
| 7708 return; | 7708 return; |
| 7709 } | 7709 } |
| 7710 switch (pname) { | 7710 switch (pname) { |
| (...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9030 } | 9030 } |
| 9031 glUniform4uiv(real_location, count, const_cast<const GLuint*>(value)); | 9031 glUniform4uiv(real_location, count, const_cast<const GLuint*>(value)); |
| 9032 } | 9032 } |
| 9033 | 9033 |
| 9034 void GLES2DecoderImpl::DoUniformMatrix2fv(GLint fake_location, | 9034 void GLES2DecoderImpl::DoUniformMatrix2fv(GLint fake_location, |
| 9035 GLsizei count, | 9035 GLsizei count, |
| 9036 GLboolean transpose, | 9036 GLboolean transpose, |
| 9037 const volatile GLfloat* value) { | 9037 const volatile GLfloat* value) { |
| 9038 GLenum type = 0; | 9038 GLenum type = 0; |
| 9039 GLint real_location = -1; | 9039 GLint real_location = -1; |
| 9040 if (transpose && !unsafe_es3_apis_enabled()) { | 9040 if (transpose && !es3_apis_enabled()) { |
| 9041 LOCAL_SET_GL_ERROR( | 9041 LOCAL_SET_GL_ERROR( |
| 9042 GL_INVALID_VALUE, "glUniformMatrix2fv", "transpose not FALSE"); | 9042 GL_INVALID_VALUE, "glUniformMatrix2fv", "transpose not FALSE"); |
| 9043 return; | 9043 return; |
| 9044 } | 9044 } |
| 9045 if (!PrepForSetUniformByLocation(fake_location, | 9045 if (!PrepForSetUniformByLocation(fake_location, |
| 9046 "glUniformMatrix2fv", | 9046 "glUniformMatrix2fv", |
| 9047 Program::kUniformMatrix2f, | 9047 Program::kUniformMatrix2f, |
| 9048 &real_location, | 9048 &real_location, |
| 9049 &type, | 9049 &type, |
| 9050 &count)) { | 9050 &count)) { |
| 9051 return; | 9051 return; |
| 9052 } | 9052 } |
| 9053 glUniformMatrix2fv(real_location, count, transpose, | 9053 glUniformMatrix2fv(real_location, count, transpose, |
| 9054 const_cast<const GLfloat*>(value)); | 9054 const_cast<const GLfloat*>(value)); |
| 9055 } | 9055 } |
| 9056 | 9056 |
| 9057 void GLES2DecoderImpl::DoUniformMatrix3fv(GLint fake_location, | 9057 void GLES2DecoderImpl::DoUniformMatrix3fv(GLint fake_location, |
| 9058 GLsizei count, | 9058 GLsizei count, |
| 9059 GLboolean transpose, | 9059 GLboolean transpose, |
| 9060 const volatile GLfloat* value) { | 9060 const volatile GLfloat* value) { |
| 9061 GLenum type = 0; | 9061 GLenum type = 0; |
| 9062 GLint real_location = -1; | 9062 GLint real_location = -1; |
| 9063 if (transpose && !unsafe_es3_apis_enabled()) { | 9063 if (transpose && !es3_apis_enabled()) { |
| 9064 LOCAL_SET_GL_ERROR( | 9064 LOCAL_SET_GL_ERROR( |
| 9065 GL_INVALID_VALUE, "glUniformMatrix3fv", "transpose not FALSE"); | 9065 GL_INVALID_VALUE, "glUniformMatrix3fv", "transpose not FALSE"); |
| 9066 return; | 9066 return; |
| 9067 } | 9067 } |
| 9068 if (!PrepForSetUniformByLocation(fake_location, | 9068 if (!PrepForSetUniformByLocation(fake_location, |
| 9069 "glUniformMatrix3fv", | 9069 "glUniformMatrix3fv", |
| 9070 Program::kUniformMatrix3f, | 9070 Program::kUniformMatrix3f, |
| 9071 &real_location, | 9071 &real_location, |
| 9072 &type, | 9072 &type, |
| 9073 &count)) { | 9073 &count)) { |
| 9074 return; | 9074 return; |
| 9075 } | 9075 } |
| 9076 glUniformMatrix3fv(real_location, count, transpose, | 9076 glUniformMatrix3fv(real_location, count, transpose, |
| 9077 const_cast<const GLfloat*>(value)); | 9077 const_cast<const GLfloat*>(value)); |
| 9078 } | 9078 } |
| 9079 | 9079 |
| 9080 void GLES2DecoderImpl::DoUniformMatrix4fv(GLint fake_location, | 9080 void GLES2DecoderImpl::DoUniformMatrix4fv(GLint fake_location, |
| 9081 GLsizei count, | 9081 GLsizei count, |
| 9082 GLboolean transpose, | 9082 GLboolean transpose, |
| 9083 const volatile GLfloat* value) { | 9083 const volatile GLfloat* value) { |
| 9084 GLenum type = 0; | 9084 GLenum type = 0; |
| 9085 GLint real_location = -1; | 9085 GLint real_location = -1; |
| 9086 if (transpose && !unsafe_es3_apis_enabled()) { | 9086 if (transpose && !es3_apis_enabled()) { |
| 9087 LOCAL_SET_GL_ERROR( | 9087 LOCAL_SET_GL_ERROR( |
| 9088 GL_INVALID_VALUE, "glUniformMatrix4fv", "transpose not FALSE"); | 9088 GL_INVALID_VALUE, "glUniformMatrix4fv", "transpose not FALSE"); |
| 9089 return; | 9089 return; |
| 9090 } | 9090 } |
| 9091 if (!PrepForSetUniformByLocation(fake_location, | 9091 if (!PrepForSetUniformByLocation(fake_location, |
| 9092 "glUniformMatrix4fv", | 9092 "glUniformMatrix4fv", |
| 9093 Program::kUniformMatrix4f, | 9093 Program::kUniformMatrix4f, |
| 9094 &real_location, | 9094 &real_location, |
| 9095 &type, | 9095 &type, |
| 9096 &count)) { | 9096 &count)) { |
| (...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10696 if (SetVertexAttribValue("glVertexAttribI4uiv", index, t)) { | 10696 if (SetVertexAttribValue("glVertexAttribI4uiv", index, t)) { |
| 10697 state_.SetGenericVertexAttribBaseType( | 10697 state_.SetGenericVertexAttribBaseType( |
| 10698 index, SHADER_VARIABLE_UINT); | 10698 index, SHADER_VARIABLE_UINT); |
| 10699 glVertexAttribI4uiv(index, t); | 10699 glVertexAttribI4uiv(index, t); |
| 10700 } | 10700 } |
| 10701 } | 10701 } |
| 10702 | 10702 |
| 10703 error::Error GLES2DecoderImpl::HandleVertexAttribIPointer( | 10703 error::Error GLES2DecoderImpl::HandleVertexAttribIPointer( |
| 10704 uint32_t immediate_data_size, | 10704 uint32_t immediate_data_size, |
| 10705 const volatile void* cmd_data) { | 10705 const volatile void* cmd_data) { |
| 10706 if (!unsafe_es3_apis_enabled()) | 10706 if (!es3_apis_enabled()) |
| 10707 return error::kUnknownCommand; | 10707 return error::kUnknownCommand; |
| 10708 const volatile gles2::cmds::VertexAttribIPointer& c = | 10708 const volatile gles2::cmds::VertexAttribIPointer& c = |
| 10709 *static_cast<const volatile gles2::cmds::VertexAttribIPointer*>(cmd_data); | 10709 *static_cast<const volatile gles2::cmds::VertexAttribIPointer*>(cmd_data); |
| 10710 GLuint indx = c.indx; | 10710 GLuint indx = c.indx; |
| 10711 GLint size = c.size; | 10711 GLint size = c.size; |
| 10712 GLenum type = c.type; | 10712 GLenum type = c.type; |
| 10713 GLsizei stride = c.stride; | 10713 GLsizei stride = c.stride; |
| 10714 GLsizei offset = c.offset; | 10714 GLsizei offset = c.offset; |
| 10715 | 10715 |
| 10716 if (!state_.bound_array_buffer.get() || | 10716 if (!state_.bound_array_buffer.get() || |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11756 if (!bucket->GetAsString(&name_str)) { | 11756 if (!bucket->GetAsString(&name_str)) { |
| 11757 return error::kInvalidArguments; | 11757 return error::kInvalidArguments; |
| 11758 } | 11758 } |
| 11759 return GetAttribLocationHelper( | 11759 return GetAttribLocationHelper( |
| 11760 c.program, c.location_shm_id, c.location_shm_offset, name_str); | 11760 c.program, c.location_shm_id, c.location_shm_offset, name_str); |
| 11761 } | 11761 } |
| 11762 | 11762 |
| 11763 error::Error GLES2DecoderImpl::HandleGetBufferSubDataAsyncCHROMIUM( | 11763 error::Error GLES2DecoderImpl::HandleGetBufferSubDataAsyncCHROMIUM( |
| 11764 uint32_t immediate_data_size, | 11764 uint32_t immediate_data_size, |
| 11765 const volatile void* cmd_data) { | 11765 const volatile void* cmd_data) { |
| 11766 if (!unsafe_es3_apis_enabled()) { | 11766 if (!es3_apis_enabled()) { |
| 11767 return error::kUnknownCommand; | 11767 return error::kUnknownCommand; |
| 11768 } | 11768 } |
| 11769 const volatile gles2::cmds::GetBufferSubDataAsyncCHROMIUM& c = | 11769 const volatile gles2::cmds::GetBufferSubDataAsyncCHROMIUM& c = |
| 11770 *static_cast<const volatile gles2::cmds::GetBufferSubDataAsyncCHROMIUM*>( | 11770 *static_cast<const volatile gles2::cmds::GetBufferSubDataAsyncCHROMIUM*>( |
| 11771 cmd_data); | 11771 cmd_data); |
| 11772 GLenum target = static_cast<GLenum>(c.target); | 11772 GLenum target = static_cast<GLenum>(c.target); |
| 11773 GLintptr offset = static_cast<GLintptr>(c.offset); | 11773 GLintptr offset = static_cast<GLintptr>(c.offset); |
| 11774 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); | 11774 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); |
| 11775 uint32_t data_shm_id = static_cast<uint32_t>(c.data_shm_id); | 11775 uint32_t data_shm_id = static_cast<uint32_t>(c.data_shm_id); |
| 11776 | 11776 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11858 if (!bucket->GetAsString(&name_str)) { | 11858 if (!bucket->GetAsString(&name_str)) { |
| 11859 return error::kInvalidArguments; | 11859 return error::kInvalidArguments; |
| 11860 } | 11860 } |
| 11861 return GetUniformLocationHelper( | 11861 return GetUniformLocationHelper( |
| 11862 c.program, c.location_shm_id, c.location_shm_offset, name_str); | 11862 c.program, c.location_shm_id, c.location_shm_offset, name_str); |
| 11863 } | 11863 } |
| 11864 | 11864 |
| 11865 error::Error GLES2DecoderImpl::HandleGetUniformIndices( | 11865 error::Error GLES2DecoderImpl::HandleGetUniformIndices( |
| 11866 uint32_t immediate_data_size, | 11866 uint32_t immediate_data_size, |
| 11867 const volatile void* cmd_data) { | 11867 const volatile void* cmd_data) { |
| 11868 if (!unsafe_es3_apis_enabled()) | 11868 if (!es3_apis_enabled()) |
| 11869 return error::kUnknownCommand; | 11869 return error::kUnknownCommand; |
| 11870 const volatile gles2::cmds::GetUniformIndices& c = | 11870 const volatile gles2::cmds::GetUniformIndices& c = |
| 11871 *static_cast<const volatile gles2::cmds::GetUniformIndices*>(cmd_data); | 11871 *static_cast<const volatile gles2::cmds::GetUniformIndices*>(cmd_data); |
| 11872 Bucket* bucket = GetBucket(c.names_bucket_id); | 11872 Bucket* bucket = GetBucket(c.names_bucket_id); |
| 11873 if (!bucket) { | 11873 if (!bucket) { |
| 11874 return error::kInvalidArguments; | 11874 return error::kInvalidArguments; |
| 11875 } | 11875 } |
| 11876 GLsizei count = 0; | 11876 GLsizei count = 0; |
| 11877 std::vector<char*> names; | 11877 std::vector<char*> names; |
| 11878 std::vector<GLint> len; | 11878 std::vector<GLint> len; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11939 return error::kNoError; | 11939 return error::kNoError; |
| 11940 } | 11940 } |
| 11941 | 11941 |
| 11942 *location = program->GetFragDataLocation(name_str); | 11942 *location = program->GetFragDataLocation(name_str); |
| 11943 return error::kNoError; | 11943 return error::kNoError; |
| 11944 } | 11944 } |
| 11945 | 11945 |
| 11946 error::Error GLES2DecoderImpl::HandleGetFragDataLocation( | 11946 error::Error GLES2DecoderImpl::HandleGetFragDataLocation( |
| 11947 uint32_t immediate_data_size, | 11947 uint32_t immediate_data_size, |
| 11948 const volatile void* cmd_data) { | 11948 const volatile void* cmd_data) { |
| 11949 if (!unsafe_es3_apis_enabled()) | 11949 if (!es3_apis_enabled()) |
| 11950 return error::kUnknownCommand; | 11950 return error::kUnknownCommand; |
| 11951 const volatile gles2::cmds::GetFragDataLocation& c = | 11951 const volatile gles2::cmds::GetFragDataLocation& c = |
| 11952 *static_cast<const volatile gles2::cmds::GetFragDataLocation*>(cmd_data); | 11952 *static_cast<const volatile gles2::cmds::GetFragDataLocation*>(cmd_data); |
| 11953 Bucket* bucket = GetBucket(c.name_bucket_id); | 11953 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 11954 if (!bucket) { | 11954 if (!bucket) { |
| 11955 return error::kInvalidArguments; | 11955 return error::kInvalidArguments; |
| 11956 } | 11956 } |
| 11957 std::string name_str; | 11957 std::string name_str; |
| 11958 if (!bucket->GetAsString(&name_str)) { | 11958 if (!bucket->GetAsString(&name_str)) { |
| 11959 return error::kInvalidArguments; | 11959 return error::kInvalidArguments; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12007 if (!bucket->GetAsString(&name_str)) { | 12007 if (!bucket->GetAsString(&name_str)) { |
| 12008 return error::kInvalidArguments; | 12008 return error::kInvalidArguments; |
| 12009 } | 12009 } |
| 12010 return GetFragDataIndexHelper(c.program, c.index_shm_id, c.index_shm_offset, | 12010 return GetFragDataIndexHelper(c.program, c.index_shm_id, c.index_shm_offset, |
| 12011 name_str); | 12011 name_str); |
| 12012 } | 12012 } |
| 12013 | 12013 |
| 12014 error::Error GLES2DecoderImpl::HandleGetUniformBlockIndex( | 12014 error::Error GLES2DecoderImpl::HandleGetUniformBlockIndex( |
| 12015 uint32_t immediate_data_size, | 12015 uint32_t immediate_data_size, |
| 12016 const volatile void* cmd_data) { | 12016 const volatile void* cmd_data) { |
| 12017 if (!unsafe_es3_apis_enabled()) | 12017 if (!es3_apis_enabled()) |
| 12018 return error::kUnknownCommand; | 12018 return error::kUnknownCommand; |
| 12019 const volatile gles2::cmds::GetUniformBlockIndex& c = | 12019 const volatile gles2::cmds::GetUniformBlockIndex& c = |
| 12020 *static_cast<const volatile gles2::cmds::GetUniformBlockIndex*>(cmd_data); | 12020 *static_cast<const volatile gles2::cmds::GetUniformBlockIndex*>(cmd_data); |
| 12021 Bucket* bucket = GetBucket(c.name_bucket_id); | 12021 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 12022 if (!bucket) { | 12022 if (!bucket) { |
| 12023 return error::kInvalidArguments; | 12023 return error::kInvalidArguments; |
| 12024 } | 12024 } |
| 12025 std::string name_str; | 12025 std::string name_str; |
| 12026 if (!bucket->GetAsString(&name_str)) { | 12026 if (!bucket->GetAsString(&name_str)) { |
| 12027 return error::kInvalidArguments; | 12027 return error::kInvalidArguments; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 12051 GLenum name = static_cast<GLenum>(c.name); | 12051 GLenum name = static_cast<GLenum>(c.name); |
| 12052 if (!validators_->string_type.IsValid(name)) { | 12052 if (!validators_->string_type.IsValid(name)) { |
| 12053 LOCAL_SET_GL_ERROR_INVALID_ENUM("glGetString", name, "name"); | 12053 LOCAL_SET_GL_ERROR_INVALID_ENUM("glGetString", name, "name"); |
| 12054 return error::kNoError; | 12054 return error::kNoError; |
| 12055 } | 12055 } |
| 12056 | 12056 |
| 12057 const char* str = nullptr; | 12057 const char* str = nullptr; |
| 12058 std::string extensions; | 12058 std::string extensions; |
| 12059 switch (name) { | 12059 switch (name) { |
| 12060 case GL_VERSION: | 12060 case GL_VERSION: |
| 12061 if (unsafe_es3_apis_enabled()) | 12061 if (es3_apis_enabled()) |
| 12062 str = "OpenGL ES 3.0 Chromium"; | 12062 str = "OpenGL ES 3.0 Chromium"; |
| 12063 else | 12063 else |
| 12064 str = "OpenGL ES 2.0 Chromium"; | 12064 str = "OpenGL ES 2.0 Chromium"; |
| 12065 break; | 12065 break; |
| 12066 case GL_SHADING_LANGUAGE_VERSION: | 12066 case GL_SHADING_LANGUAGE_VERSION: |
| 12067 if (unsafe_es3_apis_enabled()) | 12067 if (es3_apis_enabled()) |
| 12068 str = "OpenGL ES GLSL ES 3.0 Chromium"; | 12068 str = "OpenGL ES GLSL ES 3.0 Chromium"; |
| 12069 else | 12069 else |
| 12070 str = "OpenGL ES GLSL ES 1.0 Chromium"; | 12070 str = "OpenGL ES GLSL ES 1.0 Chromium"; |
| 12071 break; | 12071 break; |
| 12072 case GL_RENDERER: | 12072 case GL_RENDERER: |
| 12073 case GL_VENDOR: | 12073 case GL_VENDOR: |
| 12074 // Return the unmasked VENDOR/RENDERER string for WebGL contexts. | 12074 // Return the unmasked VENDOR/RENDERER string for WebGL contexts. |
| 12075 // They are used by WEBGL_debug_renderer_info. | 12075 // They are used by WEBGL_debug_renderer_info. |
| 12076 if (!feature_info_->IsWebGLContext()) | 12076 if (!feature_info_->IsWebGLContext()) |
| 12077 str = "Chromium"; | 12077 str = "Chromium"; |
| (...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13069 } | 13069 } |
| 13070 data = GetSharedMemoryAs<const void*>( | 13070 data = GetSharedMemoryAs<const void*>( |
| 13071 data_shm_id, data_shm_offset, image_size); | 13071 data_shm_id, data_shm_offset, image_size); |
| 13072 } | 13072 } |
| 13073 return DoCompressedTexImage(target, level, internal_format, width, height, 1, | 13073 return DoCompressedTexImage(target, level, internal_format, width, height, 1, |
| 13074 border, image_size, data, ContextState::k2D); | 13074 border, image_size, data, ContextState::k2D); |
| 13075 } | 13075 } |
| 13076 | 13076 |
| 13077 error::Error GLES2DecoderImpl::HandleCompressedTexImage3DBucket( | 13077 error::Error GLES2DecoderImpl::HandleCompressedTexImage3DBucket( |
| 13078 uint32_t immediate_data_size, const volatile void* cmd_data) { | 13078 uint32_t immediate_data_size, const volatile void* cmd_data) { |
| 13079 if (!unsafe_es3_apis_enabled()) | 13079 if (!es3_apis_enabled()) |
| 13080 return error::kUnknownCommand; | 13080 return error::kUnknownCommand; |
| 13081 const volatile gles2::cmds::CompressedTexImage3DBucket& c = | 13081 const volatile gles2::cmds::CompressedTexImage3DBucket& c = |
| 13082 *static_cast<const volatile gles2::cmds::CompressedTexImage3DBucket*>( | 13082 *static_cast<const volatile gles2::cmds::CompressedTexImage3DBucket*>( |
| 13083 cmd_data); | 13083 cmd_data); |
| 13084 GLenum target = static_cast<GLenum>(c.target); | 13084 GLenum target = static_cast<GLenum>(c.target); |
| 13085 GLint level = static_cast<GLint>(c.level); | 13085 GLint level = static_cast<GLint>(c.level); |
| 13086 GLenum internal_format = static_cast<GLenum>(c.internalformat); | 13086 GLenum internal_format = static_cast<GLenum>(c.internalformat); |
| 13087 GLsizei width = static_cast<GLsizei>(c.width); | 13087 GLsizei width = static_cast<GLsizei>(c.width); |
| 13088 GLsizei height = static_cast<GLsizei>(c.height); | 13088 GLsizei height = static_cast<GLsizei>(c.height); |
| 13089 GLsizei depth = static_cast<GLsizei>(c.depth); | 13089 GLsizei depth = static_cast<GLsizei>(c.depth); |
| 13090 GLuint bucket_id = static_cast<GLuint>(c.bucket_id); | 13090 GLuint bucket_id = static_cast<GLuint>(c.bucket_id); |
| 13091 GLint border = static_cast<GLint>(c.border); | 13091 GLint border = static_cast<GLint>(c.border); |
| 13092 | 13092 |
| 13093 if (state_.bound_pixel_unpack_buffer.get()) { | 13093 if (state_.bound_pixel_unpack_buffer.get()) { |
| 13094 return error::kInvalidArguments; | 13094 return error::kInvalidArguments; |
| 13095 } | 13095 } |
| 13096 Bucket* bucket = GetBucket(bucket_id); | 13096 Bucket* bucket = GetBucket(bucket_id); |
| 13097 if (!bucket) | 13097 if (!bucket) |
| 13098 return error::kInvalidArguments; | 13098 return error::kInvalidArguments; |
| 13099 uint32_t image_size = bucket->size(); | 13099 uint32_t image_size = bucket->size(); |
| 13100 const void* data = bucket->GetData(0, image_size); | 13100 const void* data = bucket->GetData(0, image_size); |
| 13101 DCHECK(data || !image_size); | 13101 DCHECK(data || !image_size); |
| 13102 return DoCompressedTexImage(target, level, internal_format, width, height, | 13102 return DoCompressedTexImage(target, level, internal_format, width, height, |
| 13103 depth, border, image_size, data, | 13103 depth, border, image_size, data, |
| 13104 ContextState::k3D); | 13104 ContextState::k3D); |
| 13105 } | 13105 } |
| 13106 | 13106 |
| 13107 error::Error GLES2DecoderImpl::HandleCompressedTexImage3D( | 13107 error::Error GLES2DecoderImpl::HandleCompressedTexImage3D( |
| 13108 uint32_t immediate_data_size, const volatile void* cmd_data) { | 13108 uint32_t immediate_data_size, const volatile void* cmd_data) { |
| 13109 if (!unsafe_es3_apis_enabled()) | 13109 if (!es3_apis_enabled()) |
| 13110 return error::kUnknownCommand; | 13110 return error::kUnknownCommand; |
| 13111 const volatile gles2::cmds::CompressedTexImage3D& c = | 13111 const volatile gles2::cmds::CompressedTexImage3D& c = |
| 13112 *static_cast<const volatile gles2::cmds::CompressedTexImage3D*>(cmd_data); | 13112 *static_cast<const volatile gles2::cmds::CompressedTexImage3D*>(cmd_data); |
| 13113 GLenum target = static_cast<GLenum>(c.target); | 13113 GLenum target = static_cast<GLenum>(c.target); |
| 13114 GLint level = static_cast<GLint>(c.level); | 13114 GLint level = static_cast<GLint>(c.level); |
| 13115 GLenum internal_format = static_cast<GLenum>(c.internalformat); | 13115 GLenum internal_format = static_cast<GLenum>(c.internalformat); |
| 13116 GLsizei width = static_cast<GLsizei>(c.width); | 13116 GLsizei width = static_cast<GLsizei>(c.width); |
| 13117 GLsizei height = static_cast<GLsizei>(c.height); | 13117 GLsizei height = static_cast<GLsizei>(c.height); |
| 13118 GLsizei depth = static_cast<GLsizei>(c.depth); | 13118 GLsizei depth = static_cast<GLsizei>(c.depth); |
| 13119 GLint border = static_cast<GLint>(c.border); | 13119 GLint border = static_cast<GLint>(c.border); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 13134 data = GetSharedMemoryAs<const void*>( | 13134 data = GetSharedMemoryAs<const void*>( |
| 13135 data_shm_id, data_shm_offset, image_size); | 13135 data_shm_id, data_shm_offset, image_size); |
| 13136 } | 13136 } |
| 13137 return DoCompressedTexImage(target, level, internal_format, width, height, | 13137 return DoCompressedTexImage(target, level, internal_format, width, height, |
| 13138 depth, border, image_size, data, | 13138 depth, border, image_size, data, |
| 13139 ContextState::k3D); | 13139 ContextState::k3D); |
| 13140 } | 13140 } |
| 13141 | 13141 |
| 13142 error::Error GLES2DecoderImpl::HandleCompressedTexSubImage3DBucket( | 13142 error::Error GLES2DecoderImpl::HandleCompressedTexSubImage3DBucket( |
| 13143 uint32_t immediate_data_size, const volatile void* cmd_data) { | 13143 uint32_t immediate_data_size, const volatile void* cmd_data) { |
| 13144 if (!unsafe_es3_apis_enabled()) | 13144 if (!es3_apis_enabled()) |
| 13145 return error::kUnknownCommand; | 13145 return error::kUnknownCommand; |
| 13146 const volatile gles2::cmds::CompressedTexSubImage3DBucket& c = | 13146 const volatile gles2::cmds::CompressedTexSubImage3DBucket& c = |
| 13147 *static_cast<const volatile gles2::cmds::CompressedTexSubImage3DBucket*>( | 13147 *static_cast<const volatile gles2::cmds::CompressedTexSubImage3DBucket*>( |
| 13148 cmd_data); | 13148 cmd_data); |
| 13149 GLenum target = static_cast<GLenum>(c.target); | 13149 GLenum target = static_cast<GLenum>(c.target); |
| 13150 GLint level = static_cast<GLint>(c.level); | 13150 GLint level = static_cast<GLint>(c.level); |
| 13151 GLint xoffset = static_cast<GLint>(c.xoffset); | 13151 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 13152 GLint yoffset = static_cast<GLint>(c.yoffset); | 13152 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 13153 GLint zoffset = static_cast<GLint>(c.zoffset); | 13153 GLint zoffset = static_cast<GLint>(c.zoffset); |
| 13154 GLsizei width = static_cast<GLsizei>(c.width); | 13154 GLsizei width = static_cast<GLsizei>(c.width); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 13166 uint32_t image_size = bucket->size(); | 13166 uint32_t image_size = bucket->size(); |
| 13167 const void* data = bucket->GetData(0, image_size); | 13167 const void* data = bucket->GetData(0, image_size); |
| 13168 DCHECK(data || !image_size); | 13168 DCHECK(data || !image_size); |
| 13169 return DoCompressedTexSubImage(target, level, xoffset, yoffset, zoffset, | 13169 return DoCompressedTexSubImage(target, level, xoffset, yoffset, zoffset, |
| 13170 width, height, depth, format, image_size, | 13170 width, height, depth, format, image_size, |
| 13171 data, ContextState::k3D); | 13171 data, ContextState::k3D); |
| 13172 } | 13172 } |
| 13173 | 13173 |
| 13174 error::Error GLES2DecoderImpl::HandleCompressedTexSubImage3D( | 13174 error::Error GLES2DecoderImpl::HandleCompressedTexSubImage3D( |
| 13175 uint32_t immediate_data_size, const volatile void* cmd_data) { | 13175 uint32_t immediate_data_size, const volatile void* cmd_data) { |
| 13176 if (!unsafe_es3_apis_enabled()) | 13176 if (!es3_apis_enabled()) |
| 13177 return error::kUnknownCommand; | 13177 return error::kUnknownCommand; |
| 13178 const volatile gles2::cmds::CompressedTexSubImage3D& c = | 13178 const volatile gles2::cmds::CompressedTexSubImage3D& c = |
| 13179 *static_cast<const volatile gles2::cmds::CompressedTexSubImage3D*>( | 13179 *static_cast<const volatile gles2::cmds::CompressedTexSubImage3D*>( |
| 13180 cmd_data); | 13180 cmd_data); |
| 13181 GLenum target = static_cast<GLenum>(c.target); | 13181 GLenum target = static_cast<GLenum>(c.target); |
| 13182 GLint level = static_cast<GLint>(c.level); | 13182 GLint level = static_cast<GLint>(c.level); |
| 13183 GLint xoffset = static_cast<GLint>(c.xoffset); | 13183 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 13184 GLint yoffset = static_cast<GLint>(c.yoffset); | 13184 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 13185 GLint zoffset = static_cast<GLint>(c.zoffset); | 13185 GLint zoffset = static_cast<GLint>(c.zoffset); |
| 13186 GLsizei width = static_cast<GLsizei>(c.width); | 13186 GLsizei width = static_cast<GLsizei>(c.width); |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13415 &texture_state_, &state_, &framebuffer_state_, func_name, args); | 13415 &texture_state_, &state_, &framebuffer_state_, func_name, args); |
| 13416 | 13416 |
| 13417 // This may be a slow command. Exit command processing to allow for | 13417 // This may be a slow command. Exit command processing to allow for |
| 13418 // context preemption and GPU watchdog checks. | 13418 // context preemption and GPU watchdog checks. |
| 13419 ExitCommandProcessingEarly(); | 13419 ExitCommandProcessingEarly(); |
| 13420 return error::kNoError; | 13420 return error::kNoError; |
| 13421 } | 13421 } |
| 13422 | 13422 |
| 13423 error::Error GLES2DecoderImpl::HandleTexImage3D(uint32_t immediate_data_size, | 13423 error::Error GLES2DecoderImpl::HandleTexImage3D(uint32_t immediate_data_size, |
| 13424 const volatile void* cmd_data) { | 13424 const volatile void* cmd_data) { |
| 13425 if (!unsafe_es3_apis_enabled()) | 13425 if (!es3_apis_enabled()) |
| 13426 return error::kUnknownCommand; | 13426 return error::kUnknownCommand; |
| 13427 | 13427 |
| 13428 const char* func_name = "glTexImage3D"; | 13428 const char* func_name = "glTexImage3D"; |
| 13429 const volatile gles2::cmds::TexImage3D& c = | 13429 const volatile gles2::cmds::TexImage3D& c = |
| 13430 *static_cast<const volatile gles2::cmds::TexImage3D*>(cmd_data); | 13430 *static_cast<const volatile gles2::cmds::TexImage3D*>(cmd_data); |
| 13431 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleTexImage3D", | 13431 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleTexImage3D", |
| 13432 "widthXheight", c.width * c.height, "depth", c.depth); | 13432 "widthXheight", c.width * c.height, "depth", c.depth); |
| 13433 // Set as failed for now, but if it successed, this will be set to not failed. | 13433 // Set as failed for now, but if it successed, this will be set to not failed. |
| 13434 texture_state_.tex_image_failed = true; | 13434 texture_state_.tex_image_failed = true; |
| 13435 GLenum target = static_cast<GLenum>(c.target); | 13435 GLenum target = static_cast<GLenum>(c.target); |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14257 | 14257 |
| 14258 // This may be a slow command. Exit command processing to allow for | 14258 // This may be a slow command. Exit command processing to allow for |
| 14259 // context preemption and GPU watchdog checks. | 14259 // context preemption and GPU watchdog checks. |
| 14260 ExitCommandProcessingEarly(); | 14260 ExitCommandProcessingEarly(); |
| 14261 return error::kNoError; | 14261 return error::kNoError; |
| 14262 } | 14262 } |
| 14263 | 14263 |
| 14264 error::Error GLES2DecoderImpl::HandleTexSubImage3D( | 14264 error::Error GLES2DecoderImpl::HandleTexSubImage3D( |
| 14265 uint32_t immediate_data_size, | 14265 uint32_t immediate_data_size, |
| 14266 const volatile void* cmd_data) { | 14266 const volatile void* cmd_data) { |
| 14267 if (!unsafe_es3_apis_enabled()) | 14267 if (!es3_apis_enabled()) |
| 14268 return error::kUnknownCommand; | 14268 return error::kUnknownCommand; |
| 14269 | 14269 |
| 14270 const char* func_name = "glTexSubImage3D"; | 14270 const char* func_name = "glTexSubImage3D"; |
| 14271 const volatile gles2::cmds::TexSubImage3D& c = | 14271 const volatile gles2::cmds::TexSubImage3D& c = |
| 14272 *static_cast<const volatile gles2::cmds::TexSubImage3D*>(cmd_data); | 14272 *static_cast<const volatile gles2::cmds::TexSubImage3D*>(cmd_data); |
| 14273 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleTexSubImage3D", | 14273 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleTexSubImage3D", |
| 14274 "widthXheight", c.width * c.height, "depth", c.depth); | 14274 "widthXheight", c.width * c.height, "depth", c.depth); |
| 14275 GLboolean internal = static_cast<GLboolean>(c.internal); | 14275 GLboolean internal = static_cast<GLboolean>(c.internal); |
| 14276 if (internal == GL_TRUE && texture_state_.tex_image_failed) | 14276 if (internal == GL_TRUE && texture_state_.tex_image_failed) |
| 14277 return error::kNoError; | 14277 return error::kNoError; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14473 &result_size)) { | 14473 &result_size)) { |
| 14474 glGetUniformiv( | 14474 glGetUniformiv( |
| 14475 service_id, real_location, result->GetData()); | 14475 service_id, real_location, result->GetData()); |
| 14476 } | 14476 } |
| 14477 return error; | 14477 return error; |
| 14478 } | 14478 } |
| 14479 | 14479 |
| 14480 error::Error GLES2DecoderImpl::HandleGetUniformuiv( | 14480 error::Error GLES2DecoderImpl::HandleGetUniformuiv( |
| 14481 uint32_t immediate_data_size, | 14481 uint32_t immediate_data_size, |
| 14482 const volatile void* cmd_data) { | 14482 const volatile void* cmd_data) { |
| 14483 if (!unsafe_es3_apis_enabled()) | 14483 if (!es3_apis_enabled()) |
| 14484 return error::kUnknownCommand; | 14484 return error::kUnknownCommand; |
| 14485 | 14485 |
| 14486 const volatile gles2::cmds::GetUniformuiv& c = | 14486 const volatile gles2::cmds::GetUniformuiv& c = |
| 14487 *static_cast<const volatile gles2::cmds::GetUniformuiv*>(cmd_data); | 14487 *static_cast<const volatile gles2::cmds::GetUniformuiv*>(cmd_data); |
| 14488 GLuint program = c.program; | 14488 GLuint program = c.program; |
| 14489 GLint fake_location = c.location; | 14489 GLint fake_location = c.location; |
| 14490 GLuint service_id; | 14490 GLuint service_id; |
| 14491 GLenum result_type; | 14491 GLenum result_type; |
| 14492 GLsizei result_size; | 14492 GLsizei result_size; |
| 14493 GLint real_location = -1; | 14493 GLint real_location = -1; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14650 result->size = uniform_info->size; | 14650 result->size = uniform_info->size; |
| 14651 result->type = uniform_info->type; | 14651 result->type = uniform_info->type; |
| 14652 Bucket* bucket = CreateBucket(name_bucket_id); | 14652 Bucket* bucket = CreateBucket(name_bucket_id); |
| 14653 bucket->SetFromString(uniform_info->name.c_str()); | 14653 bucket->SetFromString(uniform_info->name.c_str()); |
| 14654 return error::kNoError; | 14654 return error::kNoError; |
| 14655 } | 14655 } |
| 14656 | 14656 |
| 14657 error::Error GLES2DecoderImpl::HandleGetActiveUniformBlockiv( | 14657 error::Error GLES2DecoderImpl::HandleGetActiveUniformBlockiv( |
| 14658 uint32_t immediate_data_size, | 14658 uint32_t immediate_data_size, |
| 14659 const volatile void* cmd_data) { | 14659 const volatile void* cmd_data) { |
| 14660 if (!unsafe_es3_apis_enabled()) | 14660 if (!es3_apis_enabled()) |
| 14661 return error::kUnknownCommand; | 14661 return error::kUnknownCommand; |
| 14662 const volatile gles2::cmds::GetActiveUniformBlockiv& c = | 14662 const volatile gles2::cmds::GetActiveUniformBlockiv& c = |
| 14663 *static_cast<const volatile gles2::cmds::GetActiveUniformBlockiv*>( | 14663 *static_cast<const volatile gles2::cmds::GetActiveUniformBlockiv*>( |
| 14664 cmd_data); | 14664 cmd_data); |
| 14665 GLuint program_id = c.program; | 14665 GLuint program_id = c.program; |
| 14666 GLuint index = static_cast<GLuint>(c.index); | 14666 GLuint index = static_cast<GLuint>(c.index); |
| 14667 GLenum pname = static_cast<GLenum>(c.pname); | 14667 GLenum pname = static_cast<GLenum>(c.pname); |
| 14668 Program* program = GetProgramInfoNotShader( | 14668 Program* program = GetProgramInfoNotShader( |
| 14669 program_id, "glGetActiveUniformBlockiv"); | 14669 program_id, "glGetActiveUniformBlockiv"); |
| 14670 if (!program) { | 14670 if (!program) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14709 result->SetNumResults(num_values); | 14709 result->SetNumResults(num_values); |
| 14710 } else { | 14710 } else { |
| 14711 LOCAL_SET_GL_ERROR(error, "GetActiveUniformBlockiv", ""); | 14711 LOCAL_SET_GL_ERROR(error, "GetActiveUniformBlockiv", ""); |
| 14712 } | 14712 } |
| 14713 return error::kNoError; | 14713 return error::kNoError; |
| 14714 } | 14714 } |
| 14715 | 14715 |
| 14716 error::Error GLES2DecoderImpl::HandleGetActiveUniformBlockName( | 14716 error::Error GLES2DecoderImpl::HandleGetActiveUniformBlockName( |
| 14717 uint32_t immediate_data_size, | 14717 uint32_t immediate_data_size, |
| 14718 const volatile void* cmd_data) { | 14718 const volatile void* cmd_data) { |
| 14719 if (!unsafe_es3_apis_enabled()) | 14719 if (!es3_apis_enabled()) |
| 14720 return error::kUnknownCommand; | 14720 return error::kUnknownCommand; |
| 14721 const volatile gles2::cmds::GetActiveUniformBlockName& c = | 14721 const volatile gles2::cmds::GetActiveUniformBlockName& c = |
| 14722 *static_cast<const volatile gles2::cmds::GetActiveUniformBlockName*>( | 14722 *static_cast<const volatile gles2::cmds::GetActiveUniformBlockName*>( |
| 14723 cmd_data); | 14723 cmd_data); |
| 14724 GLuint program_id = c.program; | 14724 GLuint program_id = c.program; |
| 14725 GLuint index = c.index; | 14725 GLuint index = c.index; |
| 14726 uint32_t name_bucket_id = c.name_bucket_id; | 14726 uint32_t name_bucket_id = c.name_bucket_id; |
| 14727 typedef cmds::GetActiveUniformBlockName::Result Result; | 14727 typedef cmds::GetActiveUniformBlockName::Result Result; |
| 14728 Result* result = GetSharedMemoryAs<Result*>( | 14728 Result* result = GetSharedMemoryAs<Result*>( |
| 14729 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | 14729 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14764 Bucket* bucket = CreateBucket(name_bucket_id); | 14764 Bucket* bucket = CreateBucket(name_bucket_id); |
| 14765 DCHECK_GT(buf_size, length); | 14765 DCHECK_GT(buf_size, length); |
| 14766 DCHECK_EQ(0, buffer[length]); | 14766 DCHECK_EQ(0, buffer[length]); |
| 14767 bucket->SetFromString(&buffer[0]); | 14767 bucket->SetFromString(&buffer[0]); |
| 14768 return error::kNoError; | 14768 return error::kNoError; |
| 14769 } | 14769 } |
| 14770 | 14770 |
| 14771 error::Error GLES2DecoderImpl::HandleGetActiveUniformsiv( | 14771 error::Error GLES2DecoderImpl::HandleGetActiveUniformsiv( |
| 14772 uint32_t immediate_data_size, | 14772 uint32_t immediate_data_size, |
| 14773 const volatile void* cmd_data) { | 14773 const volatile void* cmd_data) { |
| 14774 if (!unsafe_es3_apis_enabled()) | 14774 if (!es3_apis_enabled()) |
| 14775 return error::kUnknownCommand; | 14775 return error::kUnknownCommand; |
| 14776 const volatile gles2::cmds::GetActiveUniformsiv& c = | 14776 const volatile gles2::cmds::GetActiveUniformsiv& c = |
| 14777 *static_cast<const volatile gles2::cmds::GetActiveUniformsiv*>(cmd_data); | 14777 *static_cast<const volatile gles2::cmds::GetActiveUniformsiv*>(cmd_data); |
| 14778 GLuint program_id = c.program; | 14778 GLuint program_id = c.program; |
| 14779 GLenum pname = static_cast<GLenum>(c.pname); | 14779 GLenum pname = static_cast<GLenum>(c.pname); |
| 14780 Bucket* bucket = GetBucket(c.indices_bucket_id); | 14780 Bucket* bucket = GetBucket(c.indices_bucket_id); |
| 14781 if (!bucket) { | 14781 if (!bucket) { |
| 14782 return error::kInvalidArguments; | 14782 return error::kInvalidArguments; |
| 14783 } | 14783 } |
| 14784 if (!validators_->uniform_parameter.IsValid(pname)) { | 14784 if (!validators_->uniform_parameter.IsValid(pname)) { |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15208 if (!program || !program->IsValid()) { | 15208 if (!program || !program->IsValid()) { |
| 15209 return error::kNoError; | 15209 return error::kNoError; |
| 15210 } | 15210 } |
| 15211 program->GetProgramInfo(program_manager(), bucket); | 15211 program->GetProgramInfo(program_manager(), bucket); |
| 15212 return error::kNoError; | 15212 return error::kNoError; |
| 15213 } | 15213 } |
| 15214 | 15214 |
| 15215 error::Error GLES2DecoderImpl::HandleGetUniformBlocksCHROMIUM( | 15215 error::Error GLES2DecoderImpl::HandleGetUniformBlocksCHROMIUM( |
| 15216 uint32_t immediate_data_size, | 15216 uint32_t immediate_data_size, |
| 15217 const volatile void* cmd_data) { | 15217 const volatile void* cmd_data) { |
| 15218 if (!unsafe_es3_apis_enabled()) | 15218 if (!es3_apis_enabled()) |
| 15219 return error::kUnknownCommand; | 15219 return error::kUnknownCommand; |
| 15220 const volatile gles2::cmds::GetUniformBlocksCHROMIUM& c = | 15220 const volatile gles2::cmds::GetUniformBlocksCHROMIUM& c = |
| 15221 *static_cast<const volatile gles2::cmds::GetUniformBlocksCHROMIUM*>( | 15221 *static_cast<const volatile gles2::cmds::GetUniformBlocksCHROMIUM*>( |
| 15222 cmd_data); | 15222 cmd_data); |
| 15223 GLuint program_id = static_cast<GLuint>(c.program); | 15223 GLuint program_id = static_cast<GLuint>(c.program); |
| 15224 uint32_t bucket_id = c.bucket_id; | 15224 uint32_t bucket_id = c.bucket_id; |
| 15225 Bucket* bucket = CreateBucket(bucket_id); | 15225 Bucket* bucket = CreateBucket(bucket_id); |
| 15226 bucket->SetSize(sizeof(UniformBlocksHeader)); // in case we fail. | 15226 bucket->SetSize(sizeof(UniformBlocksHeader)); // in case we fail. |
| 15227 Program* program = NULL; | 15227 Program* program = NULL; |
| 15228 program = GetProgram(program_id); | 15228 program = GetProgram(program_id); |
| 15229 if (!program || !program->IsValid()) { | 15229 if (!program || !program->IsValid()) { |
| 15230 return error::kNoError; | 15230 return error::kNoError; |
| 15231 } | 15231 } |
| 15232 program->GetUniformBlocks(bucket); | 15232 program->GetUniformBlocks(bucket); |
| 15233 return error::kNoError; | 15233 return error::kNoError; |
| 15234 } | 15234 } |
| 15235 | 15235 |
| 15236 error::Error GLES2DecoderImpl::HandleGetUniformsES3CHROMIUM( | 15236 error::Error GLES2DecoderImpl::HandleGetUniformsES3CHROMIUM( |
| 15237 uint32_t immediate_data_size, | 15237 uint32_t immediate_data_size, |
| 15238 const volatile void* cmd_data) { | 15238 const volatile void* cmd_data) { |
| 15239 if (!unsafe_es3_apis_enabled()) | 15239 if (!es3_apis_enabled()) |
| 15240 return error::kUnknownCommand; | 15240 return error::kUnknownCommand; |
| 15241 const volatile gles2::cmds::GetUniformsES3CHROMIUM& c = | 15241 const volatile gles2::cmds::GetUniformsES3CHROMIUM& c = |
| 15242 *static_cast<const volatile gles2::cmds::GetUniformsES3CHROMIUM*>( | 15242 *static_cast<const volatile gles2::cmds::GetUniformsES3CHROMIUM*>( |
| 15243 cmd_data); | 15243 cmd_data); |
| 15244 GLuint program_id = static_cast<GLuint>(c.program); | 15244 GLuint program_id = static_cast<GLuint>(c.program); |
| 15245 uint32_t bucket_id = c.bucket_id; | 15245 uint32_t bucket_id = c.bucket_id; |
| 15246 Bucket* bucket = CreateBucket(bucket_id); | 15246 Bucket* bucket = CreateBucket(bucket_id); |
| 15247 bucket->SetSize(sizeof(UniformsES3Header)); // in case we fail. | 15247 bucket->SetSize(sizeof(UniformsES3Header)); // in case we fail. |
| 15248 Program* program = NULL; | 15248 Program* program = NULL; |
| 15249 program = GetProgram(program_id); | 15249 program = GetProgram(program_id); |
| 15250 if (!program || !program->IsValid()) { | 15250 if (!program || !program->IsValid()) { |
| 15251 return error::kNoError; | 15251 return error::kNoError; |
| 15252 } | 15252 } |
| 15253 program->GetUniformsES3(bucket); | 15253 program->GetUniformsES3(bucket); |
| 15254 return error::kNoError; | 15254 return error::kNoError; |
| 15255 } | 15255 } |
| 15256 | 15256 |
| 15257 error::Error GLES2DecoderImpl::HandleGetTransformFeedbackVarying( | 15257 error::Error GLES2DecoderImpl::HandleGetTransformFeedbackVarying( |
| 15258 uint32_t immediate_data_size, | 15258 uint32_t immediate_data_size, |
| 15259 const volatile void* cmd_data) { | 15259 const volatile void* cmd_data) { |
| 15260 if (!unsafe_es3_apis_enabled()) | 15260 if (!es3_apis_enabled()) |
| 15261 return error::kUnknownCommand; | 15261 return error::kUnknownCommand; |
| 15262 const volatile gles2::cmds::GetTransformFeedbackVarying& c = | 15262 const volatile gles2::cmds::GetTransformFeedbackVarying& c = |
| 15263 *static_cast<const volatile gles2::cmds::GetTransformFeedbackVarying*>( | 15263 *static_cast<const volatile gles2::cmds::GetTransformFeedbackVarying*>( |
| 15264 cmd_data); | 15264 cmd_data); |
| 15265 GLuint program_id = c.program; | 15265 GLuint program_id = c.program; |
| 15266 GLuint index = c.index; | 15266 GLuint index = c.index; |
| 15267 uint32_t name_bucket_id = c.name_bucket_id; | 15267 uint32_t name_bucket_id = c.name_bucket_id; |
| 15268 typedef cmds::GetTransformFeedbackVarying::Result Result; | 15268 typedef cmds::GetTransformFeedbackVarying::Result Result; |
| 15269 Result* result = GetSharedMemoryAs<Result*>( | 15269 Result* result = GetSharedMemoryAs<Result*>( |
| 15270 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | 15270 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15310 Bucket* bucket = CreateBucket(name_bucket_id); | 15310 Bucket* bucket = CreateBucket(name_bucket_id); |
| 15311 DCHECK(length >= 0 && length < max_length); | 15311 DCHECK(length >= 0 && length < max_length); |
| 15312 buffer[length] = '\0'; // Just to be safe. | 15312 buffer[length] = '\0'; // Just to be safe. |
| 15313 bucket->SetFromString(&buffer[0]); | 15313 bucket->SetFromString(&buffer[0]); |
| 15314 return error::kNoError; | 15314 return error::kNoError; |
| 15315 } | 15315 } |
| 15316 | 15316 |
| 15317 error::Error GLES2DecoderImpl::HandleGetTransformFeedbackVaryingsCHROMIUM( | 15317 error::Error GLES2DecoderImpl::HandleGetTransformFeedbackVaryingsCHROMIUM( |
| 15318 uint32_t immediate_data_size, | 15318 uint32_t immediate_data_size, |
| 15319 const volatile void* cmd_data) { | 15319 const volatile void* cmd_data) { |
| 15320 if (!unsafe_es3_apis_enabled()) | 15320 if (!es3_apis_enabled()) |
| 15321 return error::kUnknownCommand; | 15321 return error::kUnknownCommand; |
| 15322 const volatile gles2::cmds::GetTransformFeedbackVaryingsCHROMIUM& c = | 15322 const volatile gles2::cmds::GetTransformFeedbackVaryingsCHROMIUM& c = |
| 15323 *static_cast< | 15323 *static_cast< |
| 15324 const volatile gles2::cmds::GetTransformFeedbackVaryingsCHROMIUM*>( | 15324 const volatile gles2::cmds::GetTransformFeedbackVaryingsCHROMIUM*>( |
| 15325 cmd_data); | 15325 cmd_data); |
| 15326 GLuint program_id = static_cast<GLuint>(c.program); | 15326 GLuint program_id = static_cast<GLuint>(c.program); |
| 15327 uint32_t bucket_id = c.bucket_id; | 15327 uint32_t bucket_id = c.bucket_id; |
| 15328 Bucket* bucket = CreateBucket(bucket_id); | 15328 Bucket* bucket = CreateBucket(bucket_id); |
| 15329 bucket->SetSize(sizeof(TransformFeedbackVaryingsHeader)); // in case we fail. | 15329 bucket->SetSize(sizeof(TransformFeedbackVaryingsHeader)); // in case we fail. |
| 15330 Program* program = NULL; | 15330 Program* program = NULL; |
| (...skipping 1808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17139 memcpy(target_matrix, kIdentityMatrix, sizeof(kIdentityMatrix)); | 17139 memcpy(target_matrix, kIdentityMatrix, sizeof(kIdentityMatrix)); |
| 17140 // The matrix_mode is either GL_PATH_MODELVIEW_NV or GL_PATH_PROJECTION_NV | 17140 // The matrix_mode is either GL_PATH_MODELVIEW_NV or GL_PATH_PROJECTION_NV |
| 17141 // since the values of the _NV and _CHROMIUM tokens match. | 17141 // since the values of the _NV and _CHROMIUM tokens match. |
| 17142 glMatrixLoadIdentityEXT(matrix_mode); | 17142 glMatrixLoadIdentityEXT(matrix_mode); |
| 17143 } | 17143 } |
| 17144 | 17144 |
| 17145 error::Error GLES2DecoderImpl::HandleUniformBlockBinding( | 17145 error::Error GLES2DecoderImpl::HandleUniformBlockBinding( |
| 17146 uint32_t immediate_data_size, | 17146 uint32_t immediate_data_size, |
| 17147 const volatile void* cmd_data) { | 17147 const volatile void* cmd_data) { |
| 17148 const char* func_name = "glUniformBlockBinding"; | 17148 const char* func_name = "glUniformBlockBinding"; |
| 17149 if (!unsafe_es3_apis_enabled()) | 17149 if (!es3_apis_enabled()) |
| 17150 return error::kUnknownCommand; | 17150 return error::kUnknownCommand; |
| 17151 const volatile gles2::cmds::UniformBlockBinding& c = | 17151 const volatile gles2::cmds::UniformBlockBinding& c = |
| 17152 *static_cast<const volatile gles2::cmds::UniformBlockBinding*>(cmd_data); | 17152 *static_cast<const volatile gles2::cmds::UniformBlockBinding*>(cmd_data); |
| 17153 GLuint client_id = c.program; | 17153 GLuint client_id = c.program; |
| 17154 GLuint index = static_cast<GLuint>(c.index); | 17154 GLuint index = static_cast<GLuint>(c.index); |
| 17155 GLuint binding = static_cast<GLuint>(c.binding); | 17155 GLuint binding = static_cast<GLuint>(c.binding); |
| 17156 Program* program = GetProgramInfoNotShader(client_id, func_name); | 17156 Program* program = GetProgramInfoNotShader(client_id, func_name); |
| 17157 if (!program) { | 17157 if (!program) { |
| 17158 return error::kNoError; | 17158 return error::kNoError; |
| 17159 } | 17159 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 17170 GLuint service_id = program->service_id(); | 17170 GLuint service_id = program->service_id(); |
| 17171 glUniformBlockBinding(service_id, index, binding); | 17171 glUniformBlockBinding(service_id, index, binding); |
| 17172 program->SetUniformBlockBinding(index, binding); | 17172 program->SetUniformBlockBinding(index, binding); |
| 17173 return error::kNoError; | 17173 return error::kNoError; |
| 17174 } | 17174 } |
| 17175 | 17175 |
| 17176 error::Error GLES2DecoderImpl::HandleClientWaitSync( | 17176 error::Error GLES2DecoderImpl::HandleClientWaitSync( |
| 17177 uint32_t immediate_data_size, | 17177 uint32_t immediate_data_size, |
| 17178 const volatile void* cmd_data) { | 17178 const volatile void* cmd_data) { |
| 17179 const char* function_name = "glClientWaitSync"; | 17179 const char* function_name = "glClientWaitSync"; |
| 17180 if (!unsafe_es3_apis_enabled()) | 17180 if (!es3_apis_enabled()) |
| 17181 return error::kUnknownCommand; | 17181 return error::kUnknownCommand; |
| 17182 const volatile gles2::cmds::ClientWaitSync& c = | 17182 const volatile gles2::cmds::ClientWaitSync& c = |
| 17183 *static_cast<const volatile gles2::cmds::ClientWaitSync*>(cmd_data); | 17183 *static_cast<const volatile gles2::cmds::ClientWaitSync*>(cmd_data); |
| 17184 const GLuint sync = static_cast<GLuint>(c.sync); | 17184 const GLuint sync = static_cast<GLuint>(c.sync); |
| 17185 GLbitfield flags = static_cast<GLbitfield>(c.flags); | 17185 GLbitfield flags = static_cast<GLbitfield>(c.flags); |
| 17186 const GLuint64 timeout = c.timeout(); | 17186 const GLuint64 timeout = c.timeout(); |
| 17187 typedef cmds::ClientWaitSync::Result Result; | 17187 typedef cmds::ClientWaitSync::Result Result; |
| 17188 Result* result_dst = GetSharedMemoryAs<Result*>( | 17188 Result* result_dst = GetSharedMemoryAs<Result*>( |
| 17189 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); | 17189 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); |
| 17190 if (!result_dst) { | 17190 if (!result_dst) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 17219 NOTREACHED(); | 17219 NOTREACHED(); |
| 17220 break; | 17220 break; |
| 17221 } | 17221 } |
| 17222 *result_dst = status; | 17222 *result_dst = status; |
| 17223 return error::kNoError; | 17223 return error::kNoError; |
| 17224 } | 17224 } |
| 17225 | 17225 |
| 17226 error::Error GLES2DecoderImpl::HandleWaitSync(uint32_t immediate_data_size, | 17226 error::Error GLES2DecoderImpl::HandleWaitSync(uint32_t immediate_data_size, |
| 17227 const volatile void* cmd_data) { | 17227 const volatile void* cmd_data) { |
| 17228 const char* function_name = "glWaitSync"; | 17228 const char* function_name = "glWaitSync"; |
| 17229 if (!unsafe_es3_apis_enabled()) | 17229 if (!es3_apis_enabled()) |
| 17230 return error::kUnknownCommand; | 17230 return error::kUnknownCommand; |
| 17231 const volatile gles2::cmds::WaitSync& c = | 17231 const volatile gles2::cmds::WaitSync& c = |
| 17232 *static_cast<const volatile gles2::cmds::WaitSync*>(cmd_data); | 17232 *static_cast<const volatile gles2::cmds::WaitSync*>(cmd_data); |
| 17233 const GLuint sync = static_cast<GLuint>(c.sync); | 17233 const GLuint sync = static_cast<GLuint>(c.sync); |
| 17234 const GLbitfield flags = static_cast<GLbitfield>(c.flags); | 17234 const GLbitfield flags = static_cast<GLbitfield>(c.flags); |
| 17235 const GLuint64 timeout = c.timeout(); | 17235 const GLuint64 timeout = c.timeout(); |
| 17236 GLsync service_sync = 0; | 17236 GLsync service_sync = 0; |
| 17237 if (!group_->GetSyncServiceId(sync, &service_sync)) { | 17237 if (!group_->GetSyncServiceId(sync, &service_sync)) { |
| 17238 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "invalid sync"); | 17238 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "invalid sync"); |
| 17239 return error::kNoError; | 17239 return error::kNoError; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 17259 if (flags != 0) { | 17259 if (flags != 0) { |
| 17260 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "invalid flags"); | 17260 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "invalid flags"); |
| 17261 return 0; | 17261 return 0; |
| 17262 } | 17262 } |
| 17263 return glFenceSync(condition, flags); | 17263 return glFenceSync(condition, flags); |
| 17264 } | 17264 } |
| 17265 | 17265 |
| 17266 error::Error GLES2DecoderImpl::HandleGetInternalformativ( | 17266 error::Error GLES2DecoderImpl::HandleGetInternalformativ( |
| 17267 uint32_t immediate_data_size, | 17267 uint32_t immediate_data_size, |
| 17268 const volatile void* cmd_data) { | 17268 const volatile void* cmd_data) { |
| 17269 if (!unsafe_es3_apis_enabled()) | 17269 if (!es3_apis_enabled()) |
| 17270 return error::kUnknownCommand; | 17270 return error::kUnknownCommand; |
| 17271 const volatile gles2::cmds::GetInternalformativ& c = | 17271 const volatile gles2::cmds::GetInternalformativ& c = |
| 17272 *static_cast<const volatile gles2::cmds::GetInternalformativ*>(cmd_data); | 17272 *static_cast<const volatile gles2::cmds::GetInternalformativ*>(cmd_data); |
| 17273 GLenum target = static_cast<GLenum>(c.target); | 17273 GLenum target = static_cast<GLenum>(c.target); |
| 17274 GLenum format = static_cast<GLenum>(c.format); | 17274 GLenum format = static_cast<GLenum>(c.format); |
| 17275 GLenum pname = static_cast<GLenum>(c.pname); | 17275 GLenum pname = static_cast<GLenum>(c.pname); |
| 17276 if (!validators_->render_buffer_target.IsValid(target)) { | 17276 if (!validators_->render_buffer_target.IsValid(target)) { |
| 17277 LOCAL_SET_GL_ERROR_INVALID_ENUM("glGetInternalformativ", target, "target"); | 17277 LOCAL_SET_GL_ERROR_INVALID_ENUM("glGetInternalformativ", target, "target"); |
| 17278 return error::kNoError; | 17278 return error::kNoError; |
| 17279 } | 17279 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17353 } | 17353 } |
| 17354 } else { | 17354 } else { |
| 17355 glGetInternalformativ(target, format, pname, num_values, params); | 17355 glGetInternalformativ(target, format, pname, num_values, params); |
| 17356 } | 17356 } |
| 17357 result->SetNumResults(num_values); | 17357 result->SetNumResults(num_values); |
| 17358 return error::kNoError; | 17358 return error::kNoError; |
| 17359 } | 17359 } |
| 17360 | 17360 |
| 17361 error::Error GLES2DecoderImpl::HandleMapBufferRange( | 17361 error::Error GLES2DecoderImpl::HandleMapBufferRange( |
| 17362 uint32_t immediate_data_size, const volatile void* cmd_data) { | 17362 uint32_t immediate_data_size, const volatile void* cmd_data) { |
| 17363 if (!unsafe_es3_apis_enabled()) { | 17363 if (!es3_apis_enabled()) { |
| 17364 return error::kUnknownCommand; | 17364 return error::kUnknownCommand; |
| 17365 } | 17365 } |
| 17366 | 17366 |
| 17367 const char* func_name = "glMapBufferRange"; | 17367 const char* func_name = "glMapBufferRange"; |
| 17368 const volatile gles2::cmds::MapBufferRange& c = | 17368 const volatile gles2::cmds::MapBufferRange& c = |
| 17369 *static_cast<const volatile gles2::cmds::MapBufferRange*>(cmd_data); | 17369 *static_cast<const volatile gles2::cmds::MapBufferRange*>(cmd_data); |
| 17370 GLenum target = static_cast<GLenum>(c.target); | 17370 GLenum target = static_cast<GLenum>(c.target); |
| 17371 GLbitfield access = static_cast<GLbitfield>(c.access); | 17371 GLbitfield access = static_cast<GLbitfield>(c.access); |
| 17372 GLintptr offset = static_cast<GLintptr>(c.offset); | 17372 GLintptr offset = static_cast<GLintptr>(c.offset); |
| 17373 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); | 17373 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17464 static_cast<unsigned int>(data_shm_offset)); | 17464 static_cast<unsigned int>(data_shm_offset)); |
| 17465 if ((access & GL_MAP_INVALIDATE_RANGE_BIT) == 0) { | 17465 if ((access & GL_MAP_INVALIDATE_RANGE_BIT) == 0) { |
| 17466 memcpy(mem, ptr, size); | 17466 memcpy(mem, ptr, size); |
| 17467 } | 17467 } |
| 17468 *result = 1; | 17468 *result = 1; |
| 17469 return error::kNoError; | 17469 return error::kNoError; |
| 17470 } | 17470 } |
| 17471 | 17471 |
| 17472 error::Error GLES2DecoderImpl::HandleUnmapBuffer( | 17472 error::Error GLES2DecoderImpl::HandleUnmapBuffer( |
| 17473 uint32_t immediate_data_size, const volatile void* cmd_data) { | 17473 uint32_t immediate_data_size, const volatile void* cmd_data) { |
| 17474 if (!unsafe_es3_apis_enabled()) { | 17474 if (!es3_apis_enabled()) { |
| 17475 return error::kUnknownCommand; | 17475 return error::kUnknownCommand; |
| 17476 } | 17476 } |
| 17477 const char* func_name = "glUnmapBuffer"; | 17477 const char* func_name = "glUnmapBuffer"; |
| 17478 | 17478 |
| 17479 const volatile gles2::cmds::UnmapBuffer& c = | 17479 const volatile gles2::cmds::UnmapBuffer& c = |
| 17480 *static_cast<const volatile gles2::cmds::UnmapBuffer*>(cmd_data); | 17480 *static_cast<const volatile gles2::cmds::UnmapBuffer*>(cmd_data); |
| 17481 GLenum target = static_cast<GLenum>(c.target); | 17481 GLenum target = static_cast<GLenum>(c.target); |
| 17482 | 17482 |
| 17483 if (!validators_->buffer_target.IsValid(target)) { | 17483 if (!validators_->buffer_target.IsValid(target)) { |
| 17484 LOCAL_SET_GL_ERROR_INVALID_ENUM(func_name, target, "target"); | 17484 LOCAL_SET_GL_ERROR_INVALID_ENUM(func_name, target, "target"); |
| (...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18760 } | 18760 } |
| 18761 | 18761 |
| 18762 // Include the auto-generated part of this file. We split this because it means | 18762 // Include the auto-generated part of this file. We split this because it means |
| 18763 // we can easily edit the non-auto generated parts right here in this file | 18763 // we can easily edit the non-auto generated parts right here in this file |
| 18764 // instead of having to edit some template or the code generator. | 18764 // instead of having to edit some template or the code generator. |
| 18765 #include "base/macros.h" | 18765 #include "base/macros.h" |
| 18766 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 18766 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 18767 | 18767 |
| 18768 } // namespace gles2 | 18768 } // namespace gles2 |
| 18769 } // namespace gpu | 18769 } // namespace gpu |
| OLD | NEW |