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 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1167 const std::string& name_str); | 1167 const std::string& name_str); |
1168 | 1168 |
1169 error::Error GetUniformLocationHelper( | 1169 error::Error GetUniformLocationHelper( |
1170 GLuint client_id, uint32 location_shm_id, uint32 location_shm_offset, | 1170 GLuint client_id, uint32 location_shm_id, uint32 location_shm_offset, |
1171 const std::string& name_str); | 1171 const std::string& name_str); |
1172 | 1172 |
1173 // Wrapper for glShaderSource. | 1173 // Wrapper for glShaderSource. |
1174 void DoShaderSource( | 1174 void DoShaderSource( |
1175 GLuint client_id, GLsizei count, const char** data, const GLint* length); | 1175 GLuint client_id, GLsizei count, const char** data, const GLint* length); |
1176 | 1176 |
1177 // Wrapper for glShaderSource. | |
Ken Russell (switch to Gerrit)
2015/01/24 03:15:36
Comment needs to be updated.
Zhenyao Mo
2015/01/26 23:24:53
Done.
| |
1178 void DoTransformFeedbackVaryings( | |
1179 GLuint client_program_id, GLsizei count, const char* const* varyings, | |
1180 GLenum buffer_mode); | |
1181 | |
1177 // Clear any textures used by the current program. | 1182 // Clear any textures used by the current program. |
1178 bool ClearUnclearedTextures(); | 1183 bool ClearUnclearedTextures(); |
1179 | 1184 |
1180 // Clears any uncleared attachments attached to the given frame buffer. | 1185 // Clears any uncleared attachments attached to the given frame buffer. |
1181 // Returns false if there was a generated GL error. | 1186 // Returns false if there was a generated GL error. |
1182 void ClearUnclearedAttachments(GLenum target, Framebuffer* framebuffer); | 1187 void ClearUnclearedAttachments(GLenum target, Framebuffer* framebuffer); |
1183 | 1188 |
1184 // overridden from GLES2Decoder | 1189 // overridden from GLES2Decoder |
1185 bool ClearLevel(unsigned service_id, | 1190 bool ClearLevel(unsigned service_id, |
1186 unsigned bind_target, | 1191 unsigned bind_target, |
(...skipping 5859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7046 } | 7051 } |
7047 Shader* shader = GetShaderInfoNotProgram(client_id, "glShaderSource"); | 7052 Shader* shader = GetShaderInfoNotProgram(client_id, "glShaderSource"); |
7048 if (!shader) { | 7053 if (!shader) { |
7049 return; | 7054 return; |
7050 } | 7055 } |
7051 // Note: We don't actually call glShaderSource here. We wait until | 7056 // Note: We don't actually call glShaderSource here. We wait until |
7052 // the call to glCompileShader. | 7057 // the call to glCompileShader. |
7053 shader->set_source(str); | 7058 shader->set_source(str); |
7054 } | 7059 } |
7055 | 7060 |
7061 void GLES2DecoderImpl::DoTransformFeedbackVaryings( | |
7062 GLuint client_program_id, GLsizei count, const char* const* varyings, | |
7063 GLenum buffer_mode) { | |
7064 Program* program = GetProgramInfoNotShader( | |
7065 client_program_id, "glTransformFeedbackVaryings"); | |
7066 if (!program) { | |
7067 return; | |
7068 } | |
7069 glTransformFeedbackVaryings( | |
7070 program->service_id(), count, varyings, buffer_mode); | |
7071 } | |
7072 | |
7056 void GLES2DecoderImpl::DoCompileShader(GLuint client_id) { | 7073 void GLES2DecoderImpl::DoCompileShader(GLuint client_id) { |
7057 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCompileShader"); | 7074 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCompileShader"); |
7058 Shader* shader = GetShaderInfoNotProgram(client_id, "glCompileShader"); | 7075 Shader* shader = GetShaderInfoNotProgram(client_id, "glCompileShader"); |
7059 if (!shader) { | 7076 if (!shader) { |
7060 return; | 7077 return; |
7061 } | 7078 } |
7062 ShaderTranslator* translator = NULL; | 7079 ShaderTranslator* translator = NULL; |
7063 if (use_shader_translator_) { | 7080 if (use_shader_translator_) { |
7064 translator = shader->shader_type() == GL_VERTEX_SHADER ? | 7081 translator = shader->shader_type() == GL_VERTEX_SHADER ? |
7065 vertex_translator_.get() : fragment_translator_.get(); | 7082 vertex_translator_.get() : fragment_translator_.get(); |
(...skipping 4540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11606 } | 11623 } |
11607 } | 11624 } |
11608 | 11625 |
11609 // Include the auto-generated part of this file. We split this because it means | 11626 // Include the auto-generated part of this file. We split this because it means |
11610 // we can easily edit the non-auto generated parts right here in this file | 11627 // we can easily edit the non-auto generated parts right here in this file |
11611 // instead of having to edit some template or the code generator. | 11628 // instead of having to edit some template or the code generator. |
11612 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 11629 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
11613 | 11630 |
11614 } // namespace gles2 | 11631 } // namespace gles2 |
11615 } // namespace gpu | 11632 } // namespace gpu |
OLD | NEW |