Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ShAttribImpl.hpp

00001 // WARNING - DO NOT EDIT THIS FILE:
00002 // This file was automatically generated from ../../sh-trunk/src/scripts/ShAttribImpl.hpp.py.
00003 // If you wish to change it, edit that file instead.
00004 //
00005 // ---
00006 //
00007 // Sh: A GPU metaprogramming language.
00008 //
00009 // Copyright 2003-2005 Serious Hack Inc.
00010 // 
00011 // This library is free software; you can redistribute it and/or
00012 // modify it under the terms of the GNU Lesser General Public
00013 // License as published by the Free Software Foundation; either
00014 // version 2.1 of the License, or (at your option) any later version.
00015 //
00016 // This library is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019 // Lesser General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Lesser General Public
00022 // License along with this library; if not, write to the Free Software
00023 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
00024 // MA  02110-1301, USA
00026 
00027 #ifndef SH_SHATTRIBIMPL_HPP
00028 #define SH_SHATTRIBIMPL_HPP
00029 
00030 #include "ShAttrib.hpp"
00031 #include "ShContext.hpp"
00032 #include "ShStatement.hpp"
00033 #include "ShDebug.hpp"
00034 
00035 namespace SH {
00036 
00037 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00038 ShAttrib<N, Binding, T, Semantic, Swizzled>::ShAttrib()
00039   : ShGeneric<N, T>(new ShVariableNode(Binding, N, ShStorageTypeInfo<T>::value_type, Semantic))
00040 {
00041 }
00042 
00043 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00044 template<typename T2>
00045 ShAttrib<N, Binding, T, Semantic, Swizzled>::ShAttrib(const ShGeneric<N, T2>& other)
00046   : ShGeneric<N, T>(new ShVariableNode(Binding, N, ShStorageTypeInfo<T>::value_type, Semantic))
00047 {
00048   shASN(*this, other);
00049 }
00050 
00051 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00052 ShAttrib<N, Binding, T, Semantic, Swizzled>::ShAttrib(const ShAttrib<N, Binding, T, Semantic, Swizzled>& other)
00053   : ShGeneric<N, T>(new ShVariableNode(Binding, N, ShStorageTypeInfo<T>::value_type, Semantic))
00054 {
00055   shASN(*this, other);
00056 }
00057 
00058 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00059 template<typename T2>
00060 ShAttrib<N, Binding, T, Semantic, Swizzled>::ShAttrib(const ShAttrib<N, Binding, T2, Semantic, Swizzled>& other)
00061   : ShGeneric<N, T>(new ShVariableNode(Binding, N, ShStorageTypeInfo<T>::value_type, Semantic))
00062 {
00063   shASN(*this, other);
00064 }
00065 
00066 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00067 ShAttrib<N, Binding, T, Semantic, Swizzled>::ShAttrib(const ShVariableNodePtr& node,
00068   const ShSwizzle& swizzle, bool neg)
00069   : ShGeneric<N, T>(node, swizzle, neg)
00070 {
00071 }
00072 
00073 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00074 ShAttrib<N, Binding, T, Semantic, Swizzled>::ShAttrib(host_type data[N])
00075   : ShGeneric<N, T>(new ShVariableNode(Binding, N, ShStorageTypeInfo<T>::value_type, Semantic))
00076 {
00077   if (Binding == SH_CONST) {
00078     for (int i = 0; i < N; i++) setValue(i, data[i]);
00079   } else {
00080     (*this) = ShAttrib<N, SH_CONST, T, Semantic>(data);
00081   }
00082 }
00083 
00084 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00085 ShAttrib<N, Binding, T, Semantic, Swizzled>::~ShAttrib()
00086 {
00087 }
00088 
00089 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00090 template<typename T2>
00091 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00092 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator=(const ShGeneric<N, T2>& other)
00093 {
00094   ParentType::operator=(other);
00095   return *this;
00096 }
00097 
00098 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00099 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00100 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator=(const ShAttrib<N, Binding, T, Semantic, Swizzled>& other)
00101 {
00102   ParentType::operator=(other);
00103   return *this;
00104 }
00105 
00106 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00107 template<typename T2>
00108 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00109 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator=(const ShAttrib<N, Binding, T2, Semantic, Swizzled>& other)
00110 {
00111   ParentType::operator=(other);
00112   return *this;
00113 }
00114 
00115 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00116 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00117 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator=(const ShProgram& prg)
00118 {
00119   ParentType::operator=(prg);
00120   return *this;
00121 }
00122 
00123 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00124 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00125 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator++()
00126 {
00127   ParentType::operator++();
00128   return *this;
00129 }
00130 
00131 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00132 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00133 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator--()
00134 {
00135   ParentType::operator--();
00136   return *this;
00137 }
00138 
00139 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00140 template<typename T2>
00141 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00142 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator+=(const ShGeneric<N, T2>& right)
00143 {
00144   ParentType::operator+=(right);
00145   return *this;
00146 }
00147 
00148 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00149 template<typename T2>
00150 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00151 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator-=(const ShGeneric<N, T2>& right)
00152 {
00153   ParentType::operator-=(right);
00154   return *this;
00155 }
00156 
00157 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00158 template<typename T2>
00159 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00160 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator*=(const ShGeneric<N, T2>& right)
00161 {
00162   ParentType::operator*=(right);
00163   return *this;
00164 }
00165 
00166 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00167 template<typename T2>
00168 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00169 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator/=(const ShGeneric<N, T2>& right)
00170 {
00171   ParentType::operator/=(right);
00172   return *this;
00173 }
00174 
00175 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00176 template<typename T2>
00177 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00178 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator%=(const ShGeneric<N, T2>& right)
00179 {
00180   ParentType::operator%=(right);
00181   return *this;
00182 }
00183 
00184 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00185 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00186 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator+=(host_type right)
00187 {
00188   ParentType::operator+=(right);
00189   return *this;
00190 }
00191 
00192 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00193 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00194 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator-=(host_type right)
00195 {
00196   ParentType::operator-=(right);
00197   return *this;
00198 }
00199 
00200 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00201 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00202 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator*=(host_type right)
00203 {
00204   ParentType::operator*=(right);
00205   return *this;
00206 }
00207 
00208 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00209 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00210 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator/=(host_type right)
00211 {
00212   ParentType::operator/=(right);
00213   return *this;
00214 }
00215 
00216 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00217 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00218 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator%=(host_type right)
00219 {
00220   ParentType::operator%=(right);
00221   return *this;
00222 }
00223 
00224 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00225 template<typename T2>
00226 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00227 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator+=(const ShGeneric<1, T2>& right)
00228 {
00229   ParentType::operator+=(right);
00230   return *this;
00231 }
00232 
00233 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00234 template<typename T2>
00235 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00236 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator-=(const ShGeneric<1, T2>& right)
00237 {
00238   ParentType::operator-=(right);
00239   return *this;
00240 }
00241 
00242 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00243 template<typename T2>
00244 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00245 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator*=(const ShGeneric<1, T2>& right)
00246 {
00247   ParentType::operator*=(right);
00248   return *this;
00249 }
00250 
00251 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00252 template<typename T2>
00253 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00254 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator/=(const ShGeneric<1, T2>& right)
00255 {
00256   ParentType::operator/=(right);
00257   return *this;
00258 }
00259 
00260 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00261 template<typename T2>
00262 ShAttrib<N, Binding, T, Semantic, Swizzled>&
00263 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator%=(const ShGeneric<1, T2>& right)
00264 {
00265   ParentType::operator%=(right);
00266   return *this;
00267 }
00268 
00269 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00270 ShAttrib<1, Binding, T, Semantic, true>
00271 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator()(int s0) const
00272 {
00273   return ShAttrib<1, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(N, s0), this->m_neg);
00274 }
00275 
00276 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00277 ShAttrib<2, Binding, T, Semantic, true>
00278 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1) const
00279 {
00280   return ShAttrib<2, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(N, s0, s1), this->m_neg);
00281 }
00282 
00283 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00284 ShAttrib<3, Binding, T, Semantic, true>
00285 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1, int s2) const
00286 {
00287   return ShAttrib<3, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(N, s0, s1, s2), this->m_neg);
00288 }
00289 
00290 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00291 ShAttrib<4, Binding, T, Semantic, true>
00292 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1, int s2, int s3) const
00293 {
00294   return ShAttrib<4, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(N, s0, s1, s2, s3), this->m_neg);
00295 }
00296 
00297 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00298 template<int N2>
00299 ShAttrib<N2, Binding, T, Semantic, true>
00300 ShAttrib<N, Binding, T, Semantic, Swizzled>::swiz(int indices[]) const
00301 {
00302   return ShAttrib<N2, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(N, N2, indices), this->m_neg);
00303 }
00304 
00305 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00306 ShAttrib<1, Binding, T, Semantic, true>
00307 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator[](int s0) const
00308 {
00309   return ShAttrib<1, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(N, s0), this->m_neg);
00310 }
00311 
00312 template<int N, ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00313 ShAttrib<N, Binding, T, Semantic, Swizzled>
00314 ShAttrib<N, Binding, T, Semantic, Swizzled>::operator-() const
00315 {
00316   return ShAttrib<N, Binding, T, Semantic, Swizzled>(this->m_node, this->m_swizzle, !this->m_neg);
00317 }
00318 
00319 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00320 ShAttrib<1, Binding, T, Semantic, Swizzled>::ShAttrib()
00321   : ShGeneric<1, T>(new ShVariableNode(Binding, 1, ShStorageTypeInfo<T>::value_type, Semantic))
00322 {
00323 }
00324 
00325 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00326 template<typename T2>
00327 ShAttrib<1, Binding, T, Semantic, Swizzled>::ShAttrib(const ShGeneric<1, T2>& other)
00328   : ShGeneric<1, T>(new ShVariableNode(Binding, 1, ShStorageTypeInfo<T>::value_type, Semantic))
00329 {
00330   shASN(*this, other);
00331 }
00332 
00333 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00334 ShAttrib<1, Binding, T, Semantic, Swizzled>::ShAttrib(const ShAttrib<1, Binding, T, Semantic, Swizzled>& other)
00335   : ShGeneric<1, T>(new ShVariableNode(Binding, 1, ShStorageTypeInfo<T>::value_type, Semantic))
00336 {
00337   shASN(*this, other);
00338 }
00339 
00340 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00341 template<typename T2>
00342 ShAttrib<1, Binding, T, Semantic, Swizzled>::ShAttrib(const ShAttrib<1, Binding, T2, Semantic, Swizzled>& other)
00343   : ShGeneric<1, T>(new ShVariableNode(Binding, 1, ShStorageTypeInfo<T>::value_type, Semantic))
00344 {
00345   shASN(*this, other);
00346 }
00347 
00348 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00349 ShAttrib<1, Binding, T, Semantic, Swizzled>::ShAttrib(const ShVariableNodePtr& node,
00350   const ShSwizzle& swizzle, bool neg)
00351   : ShGeneric<1, T>(node, swizzle, neg)
00352 {
00353 }
00354 
00355 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00356 ShAttrib<1, Binding, T, Semantic, Swizzled>::ShAttrib(host_type data[1])
00357   : ShGeneric<1, T>(new ShVariableNode(Binding, 1, ShStorageTypeInfo<T>::value_type, Semantic))
00358 {
00359   if (Binding == SH_CONST) {
00360     for (int i = 0; i < 1; i++) setValue(i, data[i]);
00361   } else {
00362     (*this) = ShAttrib<1, SH_CONST, T, Semantic>(data);
00363   }
00364 }
00365 
00366 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00367 ShAttrib<1, Binding, T, Semantic, Swizzled>::ShAttrib(host_type s0)
00368   : ShGeneric<1, T>(new ShVariableNode(Binding, 1, ShStorageTypeInfo<T>::value_type, Semantic))
00369 {
00370   if (Binding == SH_CONST) {
00371     setValue(0, s0);
00372   } else {
00373     (*this) = ShAttrib<1, SH_CONST, T, Semantic>(s0);
00374   }
00375 }
00376 
00377 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00378 ShAttrib<1, Binding, T, Semantic, Swizzled>::~ShAttrib()
00379 {
00380 }
00381 
00382 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00383 template<typename T2>
00384 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00385 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator=(const ShGeneric<1, T2>& other)
00386 {
00387   ParentType::operator=(other);
00388   return *this;
00389 }
00390 
00391 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00392 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00393 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator=(const ShAttrib<1, Binding, T, Semantic, Swizzled>& other)
00394 {
00395   ParentType::operator=(other);
00396   return *this;
00397 }
00398 
00399 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00400 template<typename T2>
00401 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00402 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator=(const ShAttrib<1, Binding, T2, Semantic, Swizzled>& other)
00403 {
00404   ParentType::operator=(other);
00405   return *this;
00406 }
00407 
00408 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00409 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00410 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator=(host_type other)
00411 {
00412   ParentType::operator=(other);
00413   return *this;
00414 }
00415 
00416 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00417 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00418 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator=(const ShProgram& prg)
00419 {
00420   ParentType::operator=(prg);
00421   return *this;
00422 }
00423 
00424 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00425 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00426 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator++()
00427 {
00428   ParentType::operator++();
00429   return *this;
00430 }
00431 
00432 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00433 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00434 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator--()
00435 {
00436   ParentType::operator--();
00437   return *this;
00438 }
00439 
00440 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00441 template<typename T2>
00442 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00443 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator+=(const ShGeneric<1, T2>& right)
00444 {
00445   ParentType::operator+=(right);
00446   return *this;
00447 }
00448 
00449 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00450 template<typename T2>
00451 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00452 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator-=(const ShGeneric<1, T2>& right)
00453 {
00454   ParentType::operator-=(right);
00455   return *this;
00456 }
00457 
00458 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00459 template<typename T2>
00460 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00461 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator*=(const ShGeneric<1, T2>& right)
00462 {
00463   ParentType::operator*=(right);
00464   return *this;
00465 }
00466 
00467 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00468 template<typename T2>
00469 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00470 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator/=(const ShGeneric<1, T2>& right)
00471 {
00472   ParentType::operator/=(right);
00473   return *this;
00474 }
00475 
00476 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00477 template<typename T2>
00478 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00479 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator%=(const ShGeneric<1, T2>& right)
00480 {
00481   ParentType::operator%=(right);
00482   return *this;
00483 }
00484 
00485 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00486 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00487 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator+=(host_type right)
00488 {
00489   ParentType::operator+=(right);
00490   return *this;
00491 }
00492 
00493 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00494 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00495 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator-=(host_type right)
00496 {
00497   ParentType::operator-=(right);
00498   return *this;
00499 }
00500 
00501 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00502 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00503 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator*=(host_type right)
00504 {
00505   ParentType::operator*=(right);
00506   return *this;
00507 }
00508 
00509 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00510 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00511 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator/=(host_type right)
00512 {
00513   ParentType::operator/=(right);
00514   return *this;
00515 }
00516 
00517 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00518 ShAttrib<1, Binding, T, Semantic, Swizzled>&
00519 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator%=(host_type right)
00520 {
00521   ParentType::operator%=(right);
00522   return *this;
00523 }
00524 
00525 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00526 ShAttrib<1, Binding, T, Semantic, true>
00527 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator()(int s0) const
00528 {
00529   return ShAttrib<1, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(1, s0), this->m_neg);
00530 }
00531 
00532 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00533 ShAttrib<2, Binding, T, Semantic, true>
00534 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1) const
00535 {
00536   return ShAttrib<2, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(1, s0, s1), this->m_neg);
00537 }
00538 
00539 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00540 ShAttrib<3, Binding, T, Semantic, true>
00541 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1, int s2) const
00542 {
00543   return ShAttrib<3, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(1, s0, s1, s2), this->m_neg);
00544 }
00545 
00546 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00547 ShAttrib<4, Binding, T, Semantic, true>
00548 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1, int s2, int s3) const
00549 {
00550   return ShAttrib<4, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(1, s0, s1, s2, s3), this->m_neg);
00551 }
00552 
00553 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00554 template<int N2>
00555 ShAttrib<N2, Binding, T, Semantic, true>
00556 ShAttrib<1, Binding, T, Semantic, Swizzled>::swiz(int indices[]) const
00557 {
00558   return ShAttrib<N2, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(1, N2, indices), this->m_neg);
00559 }
00560 
00561 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00562 ShAttrib<1, Binding, T, Semantic, true>
00563 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator[](int s0) const
00564 {
00565   return ShAttrib<1, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(1, s0), this->m_neg);
00566 }
00567 
00568 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00569 ShAttrib<1, Binding, T, Semantic, Swizzled>
00570 ShAttrib<1, Binding, T, Semantic, Swizzled>::operator-() const
00571 {
00572   return ShAttrib<1, Binding, T, Semantic, Swizzled>(this->m_node, this->m_swizzle, !this->m_neg);
00573 }
00574 
00575 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00576 ShAttrib<2, Binding, T, Semantic, Swizzled>::ShAttrib()
00577   : ShGeneric<2, T>(new ShVariableNode(Binding, 2, ShStorageTypeInfo<T>::value_type, Semantic))
00578 {
00579 }
00580 
00581 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00582 template<typename T2>
00583 ShAttrib<2, Binding, T, Semantic, Swizzled>::ShAttrib(const ShGeneric<2, T2>& other)
00584   : ShGeneric<2, T>(new ShVariableNode(Binding, 2, ShStorageTypeInfo<T>::value_type, Semantic))
00585 {
00586   shASN(*this, other);
00587 }
00588 
00589 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00590 ShAttrib<2, Binding, T, Semantic, Swizzled>::ShAttrib(const ShAttrib<2, Binding, T, Semantic, Swizzled>& other)
00591   : ShGeneric<2, T>(new ShVariableNode(Binding, 2, ShStorageTypeInfo<T>::value_type, Semantic))
00592 {
00593   shASN(*this, other);
00594 }
00595 
00596 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00597 template<typename T2>
00598 ShAttrib<2, Binding, T, Semantic, Swizzled>::ShAttrib(const ShAttrib<2, Binding, T2, Semantic, Swizzled>& other)
00599   : ShGeneric<2, T>(new ShVariableNode(Binding, 2, ShStorageTypeInfo<T>::value_type, Semantic))
00600 {
00601   shASN(*this, other);
00602 }
00603 
00604 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00605 ShAttrib<2, Binding, T, Semantic, Swizzled>::ShAttrib(const ShVariableNodePtr& node,
00606   const ShSwizzle& swizzle, bool neg)
00607   : ShGeneric<2, T>(node, swizzle, neg)
00608 {
00609 }
00610 
00611 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00612 ShAttrib<2, Binding, T, Semantic, Swizzled>::ShAttrib(host_type data[2])
00613   : ShGeneric<2, T>(new ShVariableNode(Binding, 2, ShStorageTypeInfo<T>::value_type, Semantic))
00614 {
00615   if (Binding == SH_CONST) {
00616     for (int i = 0; i < 2; i++) setValue(i, data[i]);
00617   } else {
00618     (*this) = ShAttrib<2, SH_CONST, T, Semantic>(data);
00619   }
00620 }
00621 
00622 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00623 ShAttrib<2, Binding, T, Semantic, Swizzled>::ShAttrib(host_type s0, host_type s1)
00624   : ShGeneric<2, T>(new ShVariableNode(Binding, 2, ShStorageTypeInfo<T>::value_type, Semantic))
00625 {
00626   if (Binding == SH_CONST) {
00627     host_type data[2] = {s0, s1};
00628     setValues(data);
00629   } else {
00630     (*this) = ShAttrib<2, SH_CONST, T, Semantic>(s0, s1);
00631   }
00632 }
00633 
00634 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00635 template<typename T2, typename T3>
00636 ShAttrib<2, Binding, T, Semantic, Swizzled>::ShAttrib(const ShGeneric<1, T2>& s0, const ShGeneric<1, T3>& s1)
00637   : ShGeneric<2, T>(new ShVariableNode(Binding, 2, ShStorageTypeInfo<T>::value_type, Semantic))
00638 {
00639   if (Binding == SH_CONST) {
00640     SH_DEBUG_ASSERT(s0.hasValues());
00641     SH_DEBUG_ASSERT(s1.hasValues());
00642     host_type data[2] = {s0.getValue(0), s1.getValue(0)};
00643     setValues(data);
00644   } else {
00645     (*this)[0] = s0;
00646     (*this)[1] = s1;
00647   }
00648 }
00649 
00650 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00651 ShAttrib<2, Binding, T, Semantic, Swizzled>::~ShAttrib()
00652 {
00653 }
00654 
00655 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00656 template<typename T2>
00657 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00658 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator=(const ShGeneric<2, T2>& other)
00659 {
00660   ParentType::operator=(other);
00661   return *this;
00662 }
00663 
00664 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00665 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00666 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator=(const ShAttrib<2, Binding, T, Semantic, Swizzled>& other)
00667 {
00668   ParentType::operator=(other);
00669   return *this;
00670 }
00671 
00672 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00673 template<typename T2>
00674 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00675 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator=(const ShAttrib<2, Binding, T2, Semantic, Swizzled>& other)
00676 {
00677   ParentType::operator=(other);
00678   return *this;
00679 }
00680 
00681 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00682 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00683 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator=(const ShProgram& prg)
00684 {
00685   ParentType::operator=(prg);
00686   return *this;
00687 }
00688 
00689 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00690 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00691 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator++()
00692 {
00693   ParentType::operator++();
00694   return *this;
00695 }
00696 
00697 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00698 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00699 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator--()
00700 {
00701   ParentType::operator--();
00702   return *this;
00703 }
00704 
00705 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00706 template<typename T2>
00707 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00708 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator+=(const ShGeneric<2, T2>& right)
00709 {
00710   ParentType::operator+=(right);
00711   return *this;
00712 }
00713 
00714 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00715 template<typename T2>
00716 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00717 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator-=(const ShGeneric<2, T2>& right)
00718 {
00719   ParentType::operator-=(right);
00720   return *this;
00721 }
00722 
00723 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00724 template<typename T2>
00725 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00726 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator*=(const ShGeneric<2, T2>& right)
00727 {
00728   ParentType::operator*=(right);
00729   return *this;
00730 }
00731 
00732 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00733 template<typename T2>
00734 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00735 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator/=(const ShGeneric<2, T2>& right)
00736 {
00737   ParentType::operator/=(right);
00738   return *this;
00739 }
00740 
00741 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00742 template<typename T2>
00743 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00744 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator%=(const ShGeneric<2, T2>& right)
00745 {
00746   ParentType::operator%=(right);
00747   return *this;
00748 }
00749 
00750 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00751 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00752 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator+=(host_type right)
00753 {
00754   ParentType::operator+=(right);
00755   return *this;
00756 }
00757 
00758 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00759 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00760 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator-=(host_type right)
00761 {
00762   ParentType::operator-=(right);
00763   return *this;
00764 }
00765 
00766 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00767 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00768 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator*=(host_type right)
00769 {
00770   ParentType::operator*=(right);
00771   return *this;
00772 }
00773 
00774 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00775 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00776 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator/=(host_type right)
00777 {
00778   ParentType::operator/=(right);
00779   return *this;
00780 }
00781 
00782 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00783 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00784 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator%=(host_type right)
00785 {
00786   ParentType::operator%=(right);
00787   return *this;
00788 }
00789 
00790 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00791 template<typename T2>
00792 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00793 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator+=(const ShGeneric<1, T2>& right)
00794 {
00795   ParentType::operator+=(right);
00796   return *this;
00797 }
00798 
00799 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00800 template<typename T2>
00801 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00802 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator-=(const ShGeneric<1, T2>& right)
00803 {
00804   ParentType::operator-=(right);
00805   return *this;
00806 }
00807 
00808 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00809 template<typename T2>
00810 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00811 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator*=(const ShGeneric<1, T2>& right)
00812 {
00813   ParentType::operator*=(right);
00814   return *this;
00815 }
00816 
00817 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00818 template<typename T2>
00819 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00820 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator/=(const ShGeneric<1, T2>& right)
00821 {
00822   ParentType::operator/=(right);
00823   return *this;
00824 }
00825 
00826 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00827 template<typename T2>
00828 ShAttrib<2, Binding, T, Semantic, Swizzled>&
00829 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator%=(const ShGeneric<1, T2>& right)
00830 {
00831   ParentType::operator%=(right);
00832   return *this;
00833 }
00834 
00835 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00836 ShAttrib<1, Binding, T, Semantic, true>
00837 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator()(int s0) const
00838 {
00839   return ShAttrib<1, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(2, s0), this->m_neg);
00840 }
00841 
00842 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00843 ShAttrib<2, Binding, T, Semantic, true>
00844 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1) const
00845 {
00846   return ShAttrib<2, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(2, s0, s1), this->m_neg);
00847 }
00848 
00849 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00850 ShAttrib<3, Binding, T, Semantic, true>
00851 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1, int s2) const
00852 {
00853   return ShAttrib<3, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(2, s0, s1, s2), this->m_neg);
00854 }
00855 
00856 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00857 ShAttrib<4, Binding, T, Semantic, true>
00858 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1, int s2, int s3) const
00859 {
00860   return ShAttrib<4, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(2, s0, s1, s2, s3), this->m_neg);
00861 }
00862 
00863 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00864 template<int N2>
00865 ShAttrib<N2, Binding, T, Semantic, true>
00866 ShAttrib<2, Binding, T, Semantic, Swizzled>::swiz(int indices[]) const
00867 {
00868   return ShAttrib<N2, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(2, N2, indices), this->m_neg);
00869 }
00870 
00871 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00872 ShAttrib<1, Binding, T, Semantic, true>
00873 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator[](int s0) const
00874 {
00875   return ShAttrib<1, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(2, s0), this->m_neg);
00876 }
00877 
00878 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00879 ShAttrib<2, Binding, T, Semantic, Swizzled>
00880 ShAttrib<2, Binding, T, Semantic, Swizzled>::operator-() const
00881 {
00882   return ShAttrib<2, Binding, T, Semantic, Swizzled>(this->m_node, this->m_swizzle, !this->m_neg);
00883 }
00884 
00885 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00886 ShAttrib<3, Binding, T, Semantic, Swizzled>::ShAttrib()
00887   : ShGeneric<3, T>(new ShVariableNode(Binding, 3, ShStorageTypeInfo<T>::value_type, Semantic))
00888 {
00889 }
00890 
00891 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00892 template<typename T2>
00893 ShAttrib<3, Binding, T, Semantic, Swizzled>::ShAttrib(const ShGeneric<3, T2>& other)
00894   : ShGeneric<3, T>(new ShVariableNode(Binding, 3, ShStorageTypeInfo<T>::value_type, Semantic))
00895 {
00896   shASN(*this, other);
00897 }
00898 
00899 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00900 ShAttrib<3, Binding, T, Semantic, Swizzled>::ShAttrib(const ShAttrib<3, Binding, T, Semantic, Swizzled>& other)
00901   : ShGeneric<3, T>(new ShVariableNode(Binding, 3, ShStorageTypeInfo<T>::value_type, Semantic))
00902 {
00903   shASN(*this, other);
00904 }
00905 
00906 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00907 template<typename T2>
00908 ShAttrib<3, Binding, T, Semantic, Swizzled>::ShAttrib(const ShAttrib<3, Binding, T2, Semantic, Swizzled>& other)
00909   : ShGeneric<3, T>(new ShVariableNode(Binding, 3, ShStorageTypeInfo<T>::value_type, Semantic))
00910 {
00911   shASN(*this, other);
00912 }
00913 
00914 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00915 ShAttrib<3, Binding, T, Semantic, Swizzled>::ShAttrib(const ShVariableNodePtr& node,
00916   const ShSwizzle& swizzle, bool neg)
00917   : ShGeneric<3, T>(node, swizzle, neg)
00918 {
00919 }
00920 
00921 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00922 ShAttrib<3, Binding, T, Semantic, Swizzled>::ShAttrib(host_type data[3])
00923   : ShGeneric<3, T>(new ShVariableNode(Binding, 3, ShStorageTypeInfo<T>::value_type, Semantic))
00924 {
00925   if (Binding == SH_CONST) {
00926     for (int i = 0; i < 3; i++) setValue(i, data[i]);
00927   } else {
00928     (*this) = ShAttrib<3, SH_CONST, T, Semantic>(data);
00929   }
00930 }
00931 
00932 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00933 ShAttrib<3, Binding, T, Semantic, Swizzled>::ShAttrib(host_type s0, host_type s1, host_type s2)
00934   : ShGeneric<3, T>(new ShVariableNode(Binding, 3, ShStorageTypeInfo<T>::value_type, Semantic))
00935 {
00936   if (Binding == SH_CONST) {
00937     host_type data[3] = {s0, s1, s2};
00938     setValues(data);
00939   } else {
00940     (*this) = ShAttrib<3, SH_CONST, T, Semantic>(s0, s1, s2);
00941   }
00942 }
00943 
00944 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00945 template<typename T2, typename T3, typename T4>
00946 ShAttrib<3, Binding, T, Semantic, Swizzled>::ShAttrib(const ShGeneric<1, T2>& s0, const ShGeneric<1, T3>& s1, const ShGeneric<1, T4>& s2)
00947   : ShGeneric<3, T>(new ShVariableNode(Binding, 3, ShStorageTypeInfo<T>::value_type, Semantic))
00948 {
00949   if (Binding == SH_CONST) {
00950     SH_DEBUG_ASSERT(s0.hasValues());
00951     SH_DEBUG_ASSERT(s1.hasValues());
00952     SH_DEBUG_ASSERT(s2.hasValues());
00953     host_type data[3] = {s0.getValue(0), s1.getValue(0), s2.getValue(0)};
00954     setValues(data);
00955   } else {
00956     (*this)[0] = s0;
00957     (*this)[1] = s1;
00958     (*this)[2] = s2;
00959   }
00960 }
00961 
00962 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00963 ShAttrib<3, Binding, T, Semantic, Swizzled>::~ShAttrib()
00964 {
00965 }
00966 
00967 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00968 template<typename T2>
00969 ShAttrib<3, Binding, T, Semantic, Swizzled>&
00970 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator=(const ShGeneric<3, T2>& other)
00971 {
00972   ParentType::operator=(other);
00973   return *this;
00974 }
00975 
00976 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00977 ShAttrib<3, Binding, T, Semantic, Swizzled>&
00978 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator=(const ShAttrib<3, Binding, T, Semantic, Swizzled>& other)
00979 {
00980   ParentType::operator=(other);
00981   return *this;
00982 }
00983 
00984 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00985 template<typename T2>
00986 ShAttrib<3, Binding, T, Semantic, Swizzled>&
00987 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator=(const ShAttrib<3, Binding, T2, Semantic, Swizzled>& other)
00988 {
00989   ParentType::operator=(other);
00990   return *this;
00991 }
00992 
00993 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
00994 ShAttrib<3, Binding, T, Semantic, Swizzled>&
00995 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator=(const ShProgram& prg)
00996 {
00997   ParentType::operator=(prg);
00998   return *this;
00999 }
01000 
01001 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01002 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01003 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator++()
01004 {
01005   ParentType::operator++();
01006   return *this;
01007 }
01008 
01009 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01010 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01011 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator--()
01012 {
01013   ParentType::operator--();
01014   return *this;
01015 }
01016 
01017 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01018 template<typename T2>
01019 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01020 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator+=(const ShGeneric<3, T2>& right)
01021 {
01022   ParentType::operator+=(right);
01023   return *this;
01024 }
01025 
01026 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01027 template<typename T2>
01028 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01029 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator-=(const ShGeneric<3, T2>& right)
01030 {
01031   ParentType::operator-=(right);
01032   return *this;
01033 }
01034 
01035 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01036 template<typename T2>
01037 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01038 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator*=(const ShGeneric<3, T2>& right)
01039 {
01040   ParentType::operator*=(right);
01041   return *this;
01042 }
01043 
01044 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01045 template<typename T2>
01046 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01047 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator/=(const ShGeneric<3, T2>& right)
01048 {
01049   ParentType::operator/=(right);
01050   return *this;
01051 }
01052 
01053 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01054 template<typename T2>
01055 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01056 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator%=(const ShGeneric<3, T2>& right)
01057 {
01058   ParentType::operator%=(right);
01059   return *this;
01060 }
01061 
01062 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01063 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01064 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator+=(host_type right)
01065 {
01066   ParentType::operator+=(right);
01067   return *this;
01068 }
01069 
01070 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01071 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01072 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator-=(host_type right)
01073 {
01074   ParentType::operator-=(right);
01075   return *this;
01076 }
01077 
01078 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01079 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01080 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator*=(host_type right)
01081 {
01082   ParentType::operator*=(right);
01083   return *this;
01084 }
01085 
01086 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01087 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01088 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator/=(host_type right)
01089 {
01090   ParentType::operator/=(right);
01091   return *this;
01092 }
01093 
01094 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01095 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01096 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator%=(host_type right)
01097 {
01098   ParentType::operator%=(right);
01099   return *this;
01100 }
01101 
01102 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01103 template<typename T2>
01104 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01105 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator+=(const ShGeneric<1, T2>& right)
01106 {
01107   ParentType::operator+=(right);
01108   return *this;
01109 }
01110 
01111 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01112 template<typename T2>
01113 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01114 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator-=(const ShGeneric<1, T2>& right)
01115 {
01116   ParentType::operator-=(right);
01117   return *this;
01118 }
01119 
01120 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01121 template<typename T2>
01122 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01123 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator*=(const ShGeneric<1, T2>& right)
01124 {
01125   ParentType::operator*=(right);
01126   return *this;
01127 }
01128 
01129 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01130 template<typename T2>
01131 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01132 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator/=(const ShGeneric<1, T2>& right)
01133 {
01134   ParentType::operator/=(right);
01135   return *this;
01136 }
01137 
01138 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01139 template<typename T2>
01140 ShAttrib<3, Binding, T, Semantic, Swizzled>&
01141 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator%=(const ShGeneric<1, T2>& right)
01142 {
01143   ParentType::operator%=(right);
01144   return *this;
01145 }
01146 
01147 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01148 ShAttrib<1, Binding, T, Semantic, true>
01149 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator()(int s0) const
01150 {
01151   return ShAttrib<1, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(3, s0), this->m_neg);
01152 }
01153 
01154 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01155 ShAttrib<2, Binding, T, Semantic, true>
01156 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1) const
01157 {
01158   return ShAttrib<2, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(3, s0, s1), this->m_neg);
01159 }
01160 
01161 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01162 ShAttrib<3, Binding, T, Semantic, true>
01163 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1, int s2) const
01164 {
01165   return ShAttrib<3, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(3, s0, s1, s2), this->m_neg);
01166 }
01167 
01168 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01169 ShAttrib<4, Binding, T, Semantic, true>
01170 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1, int s2, int s3) const
01171 {
01172   return ShAttrib<4, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(3, s0, s1, s2, s3), this->m_neg);
01173 }
01174 
01175 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01176 template<int N2>
01177 ShAttrib<N2, Binding, T, Semantic, true>
01178 ShAttrib<3, Binding, T, Semantic, Swizzled>::swiz(int indices[]) const
01179 {
01180   return ShAttrib<N2, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(3, N2, indices), this->m_neg);
01181 }
01182 
01183 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01184 ShAttrib<1, Binding, T, Semantic, true>
01185 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator[](int s0) const
01186 {
01187   return ShAttrib<1, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(3, s0), this->m_neg);
01188 }
01189 
01190 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01191 ShAttrib<3, Binding, T, Semantic, Swizzled>
01192 ShAttrib<3, Binding, T, Semantic, Swizzled>::operator-() const
01193 {
01194   return ShAttrib<3, Binding, T, Semantic, Swizzled>(this->m_node, this->m_swizzle, !this->m_neg);
01195 }
01196 
01197 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01198 ShAttrib<4, Binding, T, Semantic, Swizzled>::ShAttrib()
01199   : ShGeneric<4, T>(new ShVariableNode(Binding, 4, ShStorageTypeInfo<T>::value_type, Semantic))
01200 {
01201 }
01202 
01203 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01204 template<typename T2>
01205 ShAttrib<4, Binding, T, Semantic, Swizzled>::ShAttrib(const ShGeneric<4, T2>& other)
01206   : ShGeneric<4, T>(new ShVariableNode(Binding, 4, ShStorageTypeInfo<T>::value_type, Semantic))
01207 {
01208   shASN(*this, other);
01209 }
01210 
01211 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01212 ShAttrib<4, Binding, T, Semantic, Swizzled>::ShAttrib(const ShAttrib<4, Binding, T, Semantic, Swizzled>& other)
01213   : ShGeneric<4, T>(new ShVariableNode(Binding, 4, ShStorageTypeInfo<T>::value_type, Semantic))
01214 {
01215   shASN(*this, other);
01216 }
01217 
01218 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01219 template<typename T2>
01220 ShAttrib<4, Binding, T, Semantic, Swizzled>::ShAttrib(const ShAttrib<4, Binding, T2, Semantic, Swizzled>& other)
01221   : ShGeneric<4, T>(new ShVariableNode(Binding, 4, ShStorageTypeInfo<T>::value_type, Semantic))
01222 {
01223   shASN(*this, other);
01224 }
01225 
01226 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01227 ShAttrib<4, Binding, T, Semantic, Swizzled>::ShAttrib(const ShVariableNodePtr& node,
01228   const ShSwizzle& swizzle, bool neg)
01229   : ShGeneric<4, T>(node, swizzle, neg)
01230 {
01231 }
01232 
01233 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01234 ShAttrib<4, Binding, T, Semantic, Swizzled>::ShAttrib(host_type data[4])
01235   : ShGeneric<4, T>(new ShVariableNode(Binding, 4, ShStorageTypeInfo<T>::value_type, Semantic))
01236 {
01237   if (Binding == SH_CONST) {
01238     for (int i = 0; i < 4; i++) setValue(i, data[i]);
01239   } else {
01240     (*this) = ShAttrib<4, SH_CONST, T, Semantic>(data);
01241   }
01242 }
01243 
01244 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01245 ShAttrib<4, Binding, T, Semantic, Swizzled>::ShAttrib(host_type s0, host_type s1, host_type s2, host_type s3)
01246   : ShGeneric<4, T>(new ShVariableNode(Binding, 4, ShStorageTypeInfo<T>::value_type, Semantic))
01247 {
01248   if (Binding == SH_CONST) {
01249     host_type data[4] = {s0, s1, s2, s3};
01250     setValues(data);
01251   } else {
01252     (*this) = ShAttrib<4, SH_CONST, T, Semantic>(s0, s1, s2, s3);
01253   }
01254 }
01255 
01256 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01257 template<typename T2, typename T3, typename T4, typename T5>
01258 ShAttrib<4, Binding, T, Semantic, Swizzled>::ShAttrib(const ShGeneric<1, T2>& s0, const ShGeneric<1, T3>& s1, const ShGeneric<1, T4>& s2, const ShGeneric<1, T5>& s3)
01259   : ShGeneric<4, T>(new ShVariableNode(Binding, 4, ShStorageTypeInfo<T>::value_type, Semantic))
01260 {
01261   if (Binding == SH_CONST) {
01262     SH_DEBUG_ASSERT(s0.hasValues());
01263     SH_DEBUG_ASSERT(s1.hasValues());
01264     SH_DEBUG_ASSERT(s2.hasValues());
01265     SH_DEBUG_ASSERT(s3.hasValues());
01266     host_type data[4] = {s0.getValue(0), s1.getValue(0), s2.getValue(0), s3.getValue(0)};
01267     setValues(data);
01268   } else {
01269     (*this)[0] = s0;
01270     (*this)[1] = s1;
01271     (*this)[2] = s2;
01272     (*this)[3] = s3;
01273   }
01274 }
01275 
01276 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01277 ShAttrib<4, Binding, T, Semantic, Swizzled>::~ShAttrib()
01278 {
01279 }
01280 
01281 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01282 template<typename T2>
01283 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01284 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator=(const ShGeneric<4, T2>& other)
01285 {
01286   ParentType::operator=(other);
01287   return *this;
01288 }
01289 
01290 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01291 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01292 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator=(const ShAttrib<4, Binding, T, Semantic, Swizzled>& other)
01293 {
01294   ParentType::operator=(other);
01295   return *this;
01296 }
01297 
01298 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01299 template<typename T2>
01300 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01301 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator=(const ShAttrib<4, Binding, T2, Semantic, Swizzled>& other)
01302 {
01303   ParentType::operator=(other);
01304   return *this;
01305 }
01306 
01307 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01308 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01309 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator=(const ShProgram& prg)
01310 {
01311   ParentType::operator=(prg);
01312   return *this;
01313 }
01314 
01315 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01316 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01317 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator++()
01318 {
01319   ParentType::operator++();
01320   return *this;
01321 }
01322 
01323 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01324 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01325 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator--()
01326 {
01327   ParentType::operator--();
01328   return *this;
01329 }
01330 
01331 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01332 template<typename T2>
01333 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01334 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator+=(const ShGeneric<4, T2>& right)
01335 {
01336   ParentType::operator+=(right);
01337   return *this;
01338 }
01339 
01340 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01341 template<typename T2>
01342 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01343 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator-=(const ShGeneric<4, T2>& right)
01344 {
01345   ParentType::operator-=(right);
01346   return *this;
01347 }
01348 
01349 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01350 template<typename T2>
01351 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01352 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator*=(const ShGeneric<4, T2>& right)
01353 {
01354   ParentType::operator*=(right);
01355   return *this;
01356 }
01357 
01358 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01359 template<typename T2>
01360 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01361 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator/=(const ShGeneric<4, T2>& right)
01362 {
01363   ParentType::operator/=(right);
01364   return *this;
01365 }
01366 
01367 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01368 template<typename T2>
01369 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01370 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator%=(const ShGeneric<4, T2>& right)
01371 {
01372   ParentType::operator%=(right);
01373   return *this;
01374 }
01375 
01376 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01377 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01378 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator+=(host_type right)
01379 {
01380   ParentType::operator+=(right);
01381   return *this;
01382 }
01383 
01384 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01385 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01386 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator-=(host_type right)
01387 {
01388   ParentType::operator-=(right);
01389   return *this;
01390 }
01391 
01392 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01393 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01394 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator*=(host_type right)
01395 {
01396   ParentType::operator*=(right);
01397   return *this;
01398 }
01399 
01400 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01401 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01402 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator/=(host_type right)
01403 {
01404   ParentType::operator/=(right);
01405   return *this;
01406 }
01407 
01408 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01409 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01410 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator%=(host_type right)
01411 {
01412   ParentType::operator%=(right);
01413   return *this;
01414 }
01415 
01416 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01417 template<typename T2>
01418 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01419 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator+=(const ShGeneric<1, T2>& right)
01420 {
01421   ParentType::operator+=(right);
01422   return *this;
01423 }
01424 
01425 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01426 template<typename T2>
01427 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01428 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator-=(const ShGeneric<1, T2>& right)
01429 {
01430   ParentType::operator-=(right);
01431   return *this;
01432 }
01433 
01434 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01435 template<typename T2>
01436 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01437 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator*=(const ShGeneric<1, T2>& right)
01438 {
01439   ParentType::operator*=(right);
01440   return *this;
01441 }
01442 
01443 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01444 template<typename T2>
01445 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01446 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator/=(const ShGeneric<1, T2>& right)
01447 {
01448   ParentType::operator/=(right);
01449   return *this;
01450 }
01451 
01452 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01453 template<typename T2>
01454 ShAttrib<4, Binding, T, Semantic, Swizzled>&
01455 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator%=(const ShGeneric<1, T2>& right)
01456 {
01457   ParentType::operator%=(right);
01458   return *this;
01459 }
01460 
01461 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01462 ShAttrib<1, Binding, T, Semantic, true>
01463 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator()(int s0) const
01464 {
01465   return ShAttrib<1, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(4, s0), this->m_neg);
01466 }
01467 
01468 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01469 ShAttrib<2, Binding, T, Semantic, true>
01470 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1) const
01471 {
01472   return ShAttrib<2, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(4, s0, s1), this->m_neg);
01473 }
01474 
01475 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01476 ShAttrib<3, Binding, T, Semantic, true>
01477 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1, int s2) const
01478 {
01479   return ShAttrib<3, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(4, s0, s1, s2), this->m_neg);
01480 }
01481 
01482 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01483 ShAttrib<4, Binding, T, Semantic, true>
01484 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator()(int s0, int s1, int s2, int s3) const
01485 {
01486   return ShAttrib<4, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(4, s0, s1, s2, s3), this->m_neg);
01487 }
01488 
01489 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01490 template<int N2>
01491 ShAttrib<N2, Binding, T, Semantic, true>
01492 ShAttrib<4, Binding, T, Semantic, Swizzled>::swiz(int indices[]) const
01493 {
01494   return ShAttrib<N2, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(4, N2, indices), this->m_neg);
01495 }
01496 
01497 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01498 ShAttrib<1, Binding, T, Semantic, true>
01499 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator[](int s0) const
01500 {
01501   return ShAttrib<1, Binding, T, Semantic, true>(this->m_node, this->m_swizzle * ShSwizzle(4, s0), this->m_neg);
01502 }
01503 
01504 template<ShBindingType Binding, typename T, ShSemanticType Semantic, bool Swizzled>
01505 ShAttrib<4, Binding, T, Semantic, Swizzled>
01506 ShAttrib<4, Binding, T, Semantic, Swizzled>::operator-() const
01507 {
01508   return ShAttrib<4, Binding, T, Semantic, Swizzled>(this->m_node, this->m_swizzle, !this->m_neg);
01509 }
01510 
01511 
01512 } // namespace SH
01513 
01514 #endif // SH_SHATTRIBIMPL_HPP

Generated on Thu Jul 28 17:33:01 2005 for Sh by  doxygen 1.4.3-20050530