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 7038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7049 // it in each draw call, and attrib 0 generic data queries use cached | 7049 // it in each draw call, and attrib 0 generic data queries use cached |
7050 // values instead of passing down to the underlying driver. | 7050 // values instead of passing down to the underlying driver. |
7051 RestoreStateForAttrib(0, false); | 7051 RestoreStateForAttrib(0, false); |
7052 } | 7052 } |
7053 } | 7053 } |
7054 return error::kNoError; | 7054 return error::kNoError; |
7055 } | 7055 } |
7056 | 7056 |
7057 error::Error GLES2DecoderImpl::HandleDrawArrays(uint32 immediate_data_size, | 7057 error::Error GLES2DecoderImpl::HandleDrawArrays(uint32 immediate_data_size, |
7058 const void* cmd_data) { | 7058 const void* cmd_data) { |
| 7059 // TODO(zmo): crbug.com/481184 |
| 7060 // On Desktop GL with versions lower than 4.3, we need to emulate |
| 7061 // GL_PRIMITIVE_RESTART_FIXED_INDEX using glPrimitiveRestartIndex(). |
7059 const cmds::DrawArrays& c = *static_cast<const cmds::DrawArrays*>(cmd_data); | 7062 const cmds::DrawArrays& c = *static_cast<const cmds::DrawArrays*>(cmd_data); |
7060 return DoDrawArrays("glDrawArrays", | 7063 return DoDrawArrays("glDrawArrays", |
7061 false, | 7064 false, |
7062 static_cast<GLenum>(c.mode), | 7065 static_cast<GLenum>(c.mode), |
7063 static_cast<GLint>(c.first), | 7066 static_cast<GLint>(c.first), |
7064 static_cast<GLsizei>(c.count), | 7067 static_cast<GLsizei>(c.count), |
7065 1); | 7068 1); |
7066 } | 7069 } |
7067 | 7070 |
7068 error::Error GLES2DecoderImpl::HandleDrawArraysInstancedANGLE( | 7071 error::Error GLES2DecoderImpl::HandleDrawArraysInstancedANGLE( |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7192 // it in each draw call, and attrib 0 generic data queries use cached | 7195 // it in each draw call, and attrib 0 generic data queries use cached |
7193 // values instead of passing down to the underlying driver. | 7196 // values instead of passing down to the underlying driver. |
7194 RestoreStateForAttrib(0, false); | 7197 RestoreStateForAttrib(0, false); |
7195 } | 7198 } |
7196 } | 7199 } |
7197 return error::kNoError; | 7200 return error::kNoError; |
7198 } | 7201 } |
7199 | 7202 |
7200 error::Error GLES2DecoderImpl::HandleDrawElements(uint32 immediate_data_size, | 7203 error::Error GLES2DecoderImpl::HandleDrawElements(uint32 immediate_data_size, |
7201 const void* cmd_data) { | 7204 const void* cmd_data) { |
| 7205 // TODO(zmo): crbug.com/481184 |
| 7206 // On Desktop GL with versions lower than 4.3, we need to emulate |
| 7207 // GL_PRIMITIVE_RESTART_FIXED_INDEX using glPrimitiveRestartIndex(). |
7202 const gles2::cmds::DrawElements& c = | 7208 const gles2::cmds::DrawElements& c = |
7203 *static_cast<const gles2::cmds::DrawElements*>(cmd_data); | 7209 *static_cast<const gles2::cmds::DrawElements*>(cmd_data); |
7204 return DoDrawElements("glDrawElements", | 7210 return DoDrawElements("glDrawElements", |
7205 false, | 7211 false, |
7206 static_cast<GLenum>(c.mode), | 7212 static_cast<GLenum>(c.mode), |
7207 static_cast<GLsizei>(c.count), | 7213 static_cast<GLsizei>(c.count), |
7208 static_cast<GLenum>(c.type), | 7214 static_cast<GLenum>(c.type), |
7209 static_cast<int32>(c.index_offset), | 7215 static_cast<int32>(c.index_offset), |
7210 1); | 7216 1); |
7211 } | 7217 } |
(...skipping 5409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12621 } | 12627 } |
12622 } | 12628 } |
12623 | 12629 |
12624 // Include the auto-generated part of this file. We split this because it means | 12630 // Include the auto-generated part of this file. We split this because it means |
12625 // we can easily edit the non-auto generated parts right here in this file | 12631 // we can easily edit the non-auto generated parts right here in this file |
12626 // instead of having to edit some template or the code generator. | 12632 // instead of having to edit some template or the code generator. |
12627 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 12633 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
12628 | 12634 |
12629 } // namespace gles2 | 12635 } // namespace gles2 |
12630 } // namespace gpu | 12636 } // namespace gpu |
OLD | NEW |