| 326 | } |
| 327 | |
| 328 | size_t PatchMeshPrimitive::variableSize( PrimitiveVariable::Interpolation interpolation ) const |
| 329 | { |
| 330 | switch ( interpolation ) |
| 331 | { |
| 332 | case PrimitiveVariable::Constant : |
| 333 | return 1; |
| 334 | case PrimitiveVariable::Uniform : |
| 335 | return uPatches() * vPatches(); |
| 336 | case PrimitiveVariable::Vertex : |
| 337 | return m_uPoints * m_vPoints; |
| 338 | case PrimitiveVariable::Varying : |
| 339 | case PrimitiveVariable::FaceVarying : |
| 340 | |
| 341 | { |
| 342 | if ( !m_uPeriodic ) |
| 343 | { |
| 344 | if ( m_vPeriodic ) |
| 345 | { |
| 346 | return ( uPatches() + 1 ) * vPatches(); |
| 347 | } |
| 348 | else |
| 349 | { |
| 350 | return ( uPatches() + 1 ) * ( vPatches() + 1 ); |
| 351 | } |
| 352 | } |
| 353 | else |
| 354 | { |
| 355 | if ( !m_vPeriodic ) |
| 356 | { |
| 357 | return uPatches() * ( vPatches() + 1 ); |
| 358 | } |
| 359 | else |
| 360 | { |
| 361 | return uPatches() * vPatches(); |
| 362 | } |
| 363 | } |
| 364 | } |
| 365 | assert( false ); // Unreachable |
| 366 | default : |
| 367 | return 0; |
| 368 | } |
| 369 | } |
no outgoing calls