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 7032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7043 GL_INVALID_OPERATION, | 7043 GL_INVALID_OPERATION, |
7044 "GetMaxValueInBufferCHROMIUM", "range out of bounds for buffer"); | 7044 "GetMaxValueInBufferCHROMIUM", "range out of bounds for buffer"); |
7045 } | 7045 } |
7046 } | 7046 } |
7047 return max_vertex_accessed; | 7047 return max_vertex_accessed; |
7048 } | 7048 } |
7049 | 7049 |
7050 void GLES2DecoderImpl::DoShaderSource( | 7050 void GLES2DecoderImpl::DoShaderSource( |
7051 GLuint client_id, GLsizei count, const char** data, const GLint* length) { | 7051 GLuint client_id, GLsizei count, const char** data, const GLint* length) { |
7052 std::string str; | 7052 std::string str; |
7053 for (GLsizei ii = 0; ii < count; ++ii) { | 7053 if (length) { |
7054 str.append(data[ii]); | 7054 for (GLsizei ii = 0; ii < count; ++ii) { |
7055 str.append(data[ii], length[ii]); | |
vmiura
2015/02/04 05:49:02
I believe the spec is that if length[ii] is NULL t
vmiura
2015/02/04 05:55:51
Btw, is this a bug fix that should be in it's own
David Yen
2015/02/04 19:13:33
Done. Strictly speaking this is not a bug fix. It
| |
7056 } | |
7057 } else { | |
7058 for (GLsizei ii = 0; ii < count; ++ii) { | |
7059 str.append(data[ii]); | |
7060 } | |
7055 } | 7061 } |
7056 Shader* shader = GetShaderInfoNotProgram(client_id, "glShaderSource"); | 7062 Shader* shader = GetShaderInfoNotProgram(client_id, "glShaderSource"); |
7057 if (!shader) { | 7063 if (!shader) { |
7058 return; | 7064 return; |
7059 } | 7065 } |
7060 // Note: We don't actually call glShaderSource here. We wait until | 7066 // Note: We don't actually call glShaderSource here. We wait until |
7061 // the call to glCompileShader. | 7067 // we actually compile the shader. |
7062 shader->set_source(str); | 7068 shader->set_source(str); |
7063 } | 7069 } |
7064 | 7070 |
7065 void GLES2DecoderImpl::DoTransformFeedbackVaryings( | 7071 void GLES2DecoderImpl::DoTransformFeedbackVaryings( |
7066 GLuint client_program_id, GLsizei count, const char* const* varyings, | 7072 GLuint client_program_id, GLsizei count, const char* const* varyings, |
7067 GLenum buffer_mode) { | 7073 GLenum buffer_mode) { |
7068 Program* program = GetProgramInfoNotShader( | 7074 Program* program = GetProgramInfoNotShader( |
7069 client_program_id, "glTransformFeedbackVaryings"); | 7075 client_program_id, "glTransformFeedbackVaryings"); |
7070 if (!program) { | 7076 if (!program) { |
7071 return; | 7077 return; |
(...skipping 4596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11668 } | 11674 } |
11669 } | 11675 } |
11670 | 11676 |
11671 // Include the auto-generated part of this file. We split this because it means | 11677 // Include the auto-generated part of this file. We split this because it means |
11672 // we can easily edit the non-auto generated parts right here in this file | 11678 // we can easily edit the non-auto generated parts right here in this file |
11673 // instead of having to edit some template or the code generator. | 11679 // instead of having to edit some template or the code generator. |
11674 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 11680 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
11675 | 11681 |
11676 } // namespace gles2 | 11682 } // namespace gles2 |
11677 } // namespace gpu | 11683 } // namespace gpu |
OLD | NEW |