| 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/program_manager.h" | 5 #include "gpu/command_buffer/service/program_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 glGetFragDataLocation(service_id_, service_name.c_str()); | 1020 glGetFragDataLocation(service_id_, service_name.c_str()); |
| 1021 if (color_name < 0) | 1021 if (color_name < 0) |
| 1022 continue; | 1022 continue; |
| 1023 GLint index = 0; | 1023 GLint index = 0; |
| 1024 if (feature_info().feature_flags().ext_blend_func_extended) | 1024 if (feature_info().feature_flags().ext_blend_func_extended) |
| 1025 index = glGetFragDataIndex(service_id_, service_name.c_str()); | 1025 index = glGetFragDataIndex(service_id_, service_name.c_str()); |
| 1026 if (index < 0) | 1026 if (index < 0) |
| 1027 continue; | 1027 continue; |
| 1028 program_output_infos_.push_back( | 1028 program_output_infos_.push_back( |
| 1029 ProgramOutputInfo(color_name, index, client_name)); | 1029 ProgramOutputInfo(color_name, index, client_name)); |
| 1030 } else if (feature_info().workarounds().get_frag_data_info_bug) { |
| 1031 DCHECK(!feature_info().feature_flags().ext_blend_func_extended); |
| 1032 GLint color_name = |
| 1033 glGetFragDataLocation(service_id_, service_name.c_str()); |
| 1034 if (color_name >= 0) { |
| 1035 GLint index = 0; |
| 1036 for (size_t ii = 0; ii < output_var.arraySize; ++ii) { |
| 1037 std::string array_spec( |
| 1038 std::string("[") + base::IntToString(ii) + "]"); |
| 1039 program_output_infos_.push_back(ProgramOutputInfo( |
| 1040 color_name + ii, index, client_name + array_spec)); |
| 1041 } |
| 1042 } |
| 1030 } else { | 1043 } else { |
| 1031 for (size_t ii = 0; ii < output_var.arraySize; ++ii) { | 1044 for (size_t ii = 0; ii < output_var.arraySize; ++ii) { |
| 1032 std::string array_spec(std::string("[") + base::IntToString(ii) + "]"); | 1045 std::string array_spec(std::string("[") + base::IntToString(ii) + "]"); |
| 1033 std::string service_element_name(service_name + array_spec); | 1046 std::string service_element_name(service_name + array_spec); |
| 1034 GLint color_name = | 1047 GLint color_name = |
| 1035 glGetFragDataLocation(service_id_, service_element_name.c_str()); | 1048 glGetFragDataLocation(service_id_, service_element_name.c_str()); |
| 1036 if (color_name < 0) | 1049 if (color_name < 0) |
| 1037 continue; | 1050 continue; |
| 1038 GLint index = 0; | 1051 GLint index = 0; |
| 1039 if (feature_info().feature_flags().ext_blend_func_extended) | 1052 if (feature_info().feature_flags().ext_blend_func_extended) |
| (...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2565 DCHECK(program); | 2578 DCHECK(program); |
| 2566 program->ClearUniforms(&zero_); | 2579 program->ClearUniforms(&zero_); |
| 2567 } | 2580 } |
| 2568 | 2581 |
| 2569 int32_t ProgramManager::MakeFakeLocation(int32_t index, int32_t element) { | 2582 int32_t ProgramManager::MakeFakeLocation(int32_t index, int32_t element) { |
| 2570 return index + element * 0x10000; | 2583 return index + element * 0x10000; |
| 2571 } | 2584 } |
| 2572 | 2585 |
| 2573 } // namespace gles2 | 2586 } // namespace gles2 |
| 2574 } // namespace gpu | 2587 } // namespace gpu |
| OLD | NEW |