Пример #1
0
 Vector4f GetReg(Register reg)
 {
     switch (reg.Kind) {
     case RegKind.Temp:
         return temp [reg.Number];
     case RegKind.Constant:
         return constants [reg.Number];
     case RegKind.ColorOut:
         return colorOut [reg.Number];
     case RegKind.Texture:
         return textures [reg.Number];
     default:
         throw new Exception ("can't handle reg load of type " + reg.Kind);
     }
 }
Пример #2
0
 void VisitReg(Register reg)
 {
     if (reg.Kind == RegKind.Constant) {
         if (!constantMap.ContainsKey (reg.Number))
             constantMap [reg.Number] = true;
     }
 }