Changeset 439 for trunk/src/gl/gl_device.cc
- Timestamp:
- 07/23/15 18:14:48 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_device.cc
r438 r439 212 212 for ( auto& i : *info->m_uniform_map ) 213 213 { 214 auto j = lmap.find( i.first .c_str());214 auto j = lmap.find( i.first ); 215 215 if ( j != lmap.end() ) 216 216 { … … 218 218 } 219 219 220 auto k = map.find( i.first .c_str());220 auto k = map.find( i.first ); 221 221 if ( k != map.end() ) 222 222 { … … 227 227 } 228 228 229 uniform_base* nv::gl_device::get_uniform( program p, const st d::string& name, bool fatal /*= true */ ) const229 uniform_base* nv::gl_device::get_uniform( program p, const string_view& name, bool fatal /*= true */ ) const 230 230 { 231 231 const gl_program_info* info = m_programs.get( p ); … … 238 238 if ( fatal ) 239 239 { 240 NV_LOG_CRITICAL( "gl_device : uniform '", string_view( name.c_str(), name.size() ), "' not found in program!" );240 NV_LOG_CRITICAL( "gl_device : uniform '", name, "' not found in program!" ); 241 241 NV_ABORT( "gl_device : uniform not found!" ); 242 242 } … … 245 245 } 246 246 247 int nv::gl_device::get_attribute_location( program p, const st d::string& name, bool fatal /*= true */ ) const247 int nv::gl_device::get_attribute_location( program p, const string_view& name, bool fatal /*= true */ ) const 248 248 { 249 249 const gl_program_info* info = m_programs.get( p ); … … 257 257 if ( fatal ) 258 258 { 259 NV_LOG_CRITICAL( "gl_device : attribute '", string_view( name.c_str(), name.size() ), "' not found in program!" );259 NV_LOG_CRITICAL( "gl_device : attribute '", name, "' not found in program!" ); 260 260 NV_ABORT( "gl_device : attribute not found!" ); 261 261 } … … 357 357 glGetActiveAttrib( p->glid, i, 128, &attr_nlen, &attr_len, &attr_type, name_buffer ); 358 358 359 st d::stringname( name_buffer, size_t( attr_nlen ) );359 string_view name( name_buffer, size_t( attr_nlen ) ); 360 360 361 361 // skip built-ins 362 362 if ( name.substr(0,3) == "gl_" ) continue; 363 363 364 int attr_loc = glGetAttribLocation( p->glid, name. c_str() );364 int attr_loc = glGetAttribLocation( p->glid, name.data() ); 365 365 366 366 attribute& attr = (*p->m_attribute_map)[ name ]; 367 attr.name = name;368 367 attr.location = attr_loc; 369 368 attr.type = gl_enum_to_datatype( attr_type ); … … 386 385 glGetActiveUniform( p->glid, i, 128, &uni_nlen, &uni_len, &uni_type, name_buffer ); 387 386 388 st d::stringname( name_buffer, size_t( uni_nlen ) );387 string_view name( name_buffer, size_t( uni_nlen ) ); 389 388 390 389 // skip built-ins 391 390 if ( name.substr(0,3) == "gl_" ) continue; 392 391 393 int uni_loc = glGetUniformLocation( p->glid, name. c_str() );392 int uni_loc = glGetUniformLocation( p->glid, name.data() ); 394 393 datatype utype = gl_enum_to_datatype( uni_type ); 395 394 396 395 // check for array 397 s td::string::size_typearrchar = name.find( '[' );398 if ( arrchar != st d::string::npos )396 size_t arrchar = name.find( '[' ); 397 if ( arrchar != string_view::npos ) 399 398 { 400 399 name = name.substr( 0, arrchar ); 401 400 } 402 401 403 uniform_base* u = uniform_base::create( utype, name,uni_loc, uni_len );402 uniform_base* u = uniform_base::create( utype, uni_loc, uni_len ); 404 403 NV_ASSERT( u, "Unknown uniform type!" ); 405 404 (*p->m_uniform_map)[ name ] = u;
Note: See TracChangeset
for help on using the changeset viewer.