Changeset 2805
- Timestamp:
- Jul 18, 2013, 12:03:42 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gpu/shader.cpp
r2787 r2805 61 61 #elif !defined __CELLOS_LV2__ 62 62 GLuint prog_id, vert_id, frag_id; 63 // Benlitz: using a simple array could be faster since there is never more than a few attribute locations to store 64 Map<String, GLint> attrib_locations; 63 65 #else 64 66 CGprogram vert_id, frag_id; … … 333 335 #if defined USE_D3D9 || defined _XBOX 334 336 #elif !defined __CELLOS_LV2__ 335 GLint l = glGetAttribLocation(data->prog_id, attr); 336 if (l < 0) 337 { 338 Log::Warn("tried to query invalid attribute: %s\n", attr); 339 l = 0; 340 } 337 GLint l; 338 339 if (!data->attrib_locations.TryGetValue(attr, l)) 340 { 341 l = glGetAttribLocation(data->prog_id, attr); 342 if (l < 0) 343 { 344 Log::Warn("tried to query invalid attribute: %s\n", attr); 345 l = 0; 346 } 347 else 348 { 349 data->attrib_locations[String(attr)] = l; 350 } 351 } 341 352 ret.m_flags |= (uint64_t)(uint32_t)l << 32; 342 353 #else
Note: See TracChangeset
for help on using the changeset viewer.