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 <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 } | 1181 } |
1182 | 1182 |
1183 bool Program::DetectVaryingsMismatch(std::string* conflicting_name) const { | 1183 bool Program::DetectVaryingsMismatch(std::string* conflicting_name) const { |
1184 DCHECK(attached_shaders_[0].get() && | 1184 DCHECK(attached_shaders_[0].get() && |
1185 attached_shaders_[0]->shader_type() == GL_VERTEX_SHADER && | 1185 attached_shaders_[0]->shader_type() == GL_VERTEX_SHADER && |
1186 attached_shaders_[1].get() && | 1186 attached_shaders_[1].get() && |
1187 attached_shaders_[1]->shader_type() == GL_FRAGMENT_SHADER); | 1187 attached_shaders_[1]->shader_type() == GL_FRAGMENT_SHADER); |
1188 const VaryingMap* vertex_varyings = &(attached_shaders_[0]->varying_map()); | 1188 const VaryingMap* vertex_varyings = &(attached_shaders_[0]->varying_map()); |
1189 const VaryingMap* fragment_varyings = &(attached_shaders_[1]->varying_map()); | 1189 const VaryingMap* fragment_varyings = &(attached_shaders_[1]->varying_map()); |
1190 | 1190 |
| 1191 int shader_version = attached_shaders_[0]->shader_version(); |
| 1192 |
1191 for (VaryingMap::const_iterator iter = fragment_varyings->begin(); | 1193 for (VaryingMap::const_iterator iter = fragment_varyings->begin(); |
1192 iter != fragment_varyings->end(); ++iter) { | 1194 iter != fragment_varyings->end(); ++iter) { |
1193 const std::string& name = iter->first; | 1195 const std::string& name = iter->first; |
1194 if (IsBuiltInFragmentVarying(name)) | 1196 if (IsBuiltInFragmentVarying(name)) |
1195 continue; | 1197 continue; |
1196 | 1198 |
1197 VaryingMap::const_iterator hit = vertex_varyings->find(name); | 1199 VaryingMap::const_iterator hit = vertex_varyings->find(name); |
1198 if (hit == vertex_varyings->end()) { | 1200 if (hit == vertex_varyings->end()) { |
1199 if (iter->second.staticUse) { | 1201 if (iter->second.staticUse) { |
1200 *conflicting_name = name; | 1202 *conflicting_name = name; |
1201 return true; | 1203 return true; |
1202 } | 1204 } |
1203 continue; | 1205 continue; |
1204 } | 1206 } |
1205 | 1207 |
1206 if (!hit->second.isSameVaryingAtLinkTime(iter->second)) { | 1208 if (!hit->second.isSameVaryingAtLinkTime(iter->second, shader_version)) { |
1207 *conflicting_name = name; | 1209 *conflicting_name = name; |
1208 return true; | 1210 return true; |
1209 } | 1211 } |
1210 | 1212 |
1211 } | 1213 } |
1212 return false; | 1214 return false; |
1213 } | 1215 } |
1214 | 1216 |
1215 bool Program::DetectBuiltInInvariantConflicts() const { | 1217 bool Program::DetectBuiltInInvariantConflicts() const { |
1216 DCHECK(attached_shaders_[0].get() && | 1218 DCHECK(attached_shaders_[0].get() && |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1820 DCHECK(program); | 1822 DCHECK(program); |
1821 program->ClearUniforms(&zero_); | 1823 program->ClearUniforms(&zero_); |
1822 } | 1824 } |
1823 | 1825 |
1824 int32 ProgramManager::MakeFakeLocation(int32 index, int32 element) { | 1826 int32 ProgramManager::MakeFakeLocation(int32 index, int32 element) { |
1825 return index + element * 0x10000; | 1827 return index + element * 0x10000; |
1826 } | 1828 } |
1827 | 1829 |
1828 } // namespace gles2 | 1830 } // namespace gles2 |
1829 } // namespace gpu | 1831 } // namespace gpu |
OLD | NEW |