| 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 6707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6718 if (unit.bound_texture_3d.get()) { | 6718 if (unit.bound_texture_3d.get()) { |
| 6719 *params = unit.bound_texture_3d->client_id(); | 6719 *params = unit.bound_texture_3d->client_id(); |
| 6720 } else { | 6720 } else { |
| 6721 *params = 0; | 6721 *params = 0; |
| 6722 } | 6722 } |
| 6723 } | 6723 } |
| 6724 return true; | 6724 return true; |
| 6725 case GL_SAMPLER_BINDING: | 6725 case GL_SAMPLER_BINDING: |
| 6726 *num_written = 1; | 6726 *num_written = 1; |
| 6727 if (params) { | 6727 if (params) { |
| 6728 // TODO(vmiura): Need to implement this for ES3 clients. WebGL 2 tracks | 6728 DCHECK_LT(state_.active_texture_unit, state_.sampler_units.size()); |
| 6729 // this on the client side. | 6729 Sampler* sampler = |
| 6730 *params = 0; | 6730 state_.sampler_units[state_.active_texture_unit].get(); |
| 6731 *params = sampler ? sampler->client_id() : 0; |
| 6731 } | 6732 } |
| 6732 return true; | 6733 return true; |
| 6733 case GL_TRANSFORM_FEEDBACK_BINDING: | 6734 case GL_TRANSFORM_FEEDBACK_BINDING: |
| 6734 *num_written = 1; | 6735 *num_written = 1; |
| 6735 if (params) { | 6736 if (params) { |
| 6736 // TODO(vmiura): Need to implement this for ES3 clients. WebGL 2 tracks | 6737 *params = state_.bound_transform_feedback->client_id(); |
| 6737 // this on the client side. | |
| 6738 *params = 0; | |
| 6739 } | 6738 } |
| 6740 return true; | 6739 return true; |
| 6741 case GL_NUM_PROGRAM_BINARY_FORMATS: | 6740 case GL_NUM_PROGRAM_BINARY_FORMATS: |
| 6742 *num_written = 1; | 6741 *num_written = 1; |
| 6743 if (params) { | 6742 if (params) { |
| 6744 *params = 0; | 6743 *params = 0; |
| 6745 } | 6744 } |
| 6746 return true; | 6745 return true; |
| 6747 case GL_PROGRAM_BINARY_FORMATS: | 6746 case GL_PROGRAM_BINARY_FORMATS: |
| 6748 *num_written = 0; | 6747 *num_written = 0; |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7000 return; | 6999 return; |
| 7001 } | 7000 } |
| 7002 Program* program = GetProgramInfoNotShader( | 7001 Program* program = GetProgramInfoNotShader( |
| 7003 program_id, "glBindAttribLocation"); | 7002 program_id, "glBindAttribLocation"); |
| 7004 if (!program) { | 7003 if (!program) { |
| 7005 return; | 7004 return; |
| 7006 } | 7005 } |
| 7007 // At this point, the program's shaders may not be translated yet, | 7006 // At this point, the program's shaders may not be translated yet, |
| 7008 // therefore, we may not find the hashed attribute name. | 7007 // therefore, we may not find the hashed attribute name. |
| 7009 // glBindAttribLocation call with original name is useless. | 7008 // glBindAttribLocation call with original name is useless. |
| 7010 // So instead, we should simply cache the binding, and then call | 7009 // So instead, we simply cache the binding, and then call |
| 7011 // Program::ExecuteBindAttribLocationCalls() right before link. | 7010 // Program::ExecuteBindAttribLocationCalls() right before link. |
| 7012 program->SetAttribLocationBinding(name, static_cast<GLint>(index)); | 7011 program->SetAttribLocationBinding(name, static_cast<GLint>(index)); |
| 7013 // TODO(zmo): Get rid of the following glBindAttribLocation call. | |
| 7014 glBindAttribLocation(program->service_id(), index, name.c_str()); | |
| 7015 } | 7012 } |
| 7016 | 7013 |
| 7017 error::Error GLES2DecoderImpl::HandleBindAttribLocationBucket( | 7014 error::Error GLES2DecoderImpl::HandleBindAttribLocationBucket( |
| 7018 uint32_t immediate_data_size, | 7015 uint32_t immediate_data_size, |
| 7019 const volatile void* cmd_data) { | 7016 const volatile void* cmd_data) { |
| 7020 const volatile gles2::cmds::BindAttribLocationBucket& c = | 7017 const volatile gles2::cmds::BindAttribLocationBucket& c = |
| 7021 *static_cast<const volatile gles2::cmds::BindAttribLocationBucket*>( | 7018 *static_cast<const volatile gles2::cmds::BindAttribLocationBucket*>( |
| 7022 cmd_data); | 7019 cmd_data); |
| 7023 GLuint program = static_cast<GLuint>(c.program); | 7020 GLuint program = static_cast<GLuint>(c.program); |
| 7024 GLuint index = static_cast<GLuint>(c.index); | 7021 GLuint index = static_cast<GLuint>(c.index); |
| (...skipping 11890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18915 } | 18912 } |
| 18916 | 18913 |
| 18917 // Include the auto-generated part of this file. We split this because it means | 18914 // Include the auto-generated part of this file. We split this because it means |
| 18918 // we can easily edit the non-auto generated parts right here in this file | 18915 // we can easily edit the non-auto generated parts right here in this file |
| 18919 // instead of having to edit some template or the code generator. | 18916 // instead of having to edit some template or the code generator. |
| 18920 #include "base/macros.h" | 18917 #include "base/macros.h" |
| 18921 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 18918 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 18922 | 18919 |
| 18923 } // namespace gles2 | 18920 } // namespace gles2 |
| 18924 } // namespace gpu | 18921 } // namespace gpu |
| OLD | NEW |