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

ArbReg.hpp

00001 // Sh: A GPU metaprogramming language.
00002 //
00003 // Copyright 2003-2005 Serious Hack Inc.
00004 // 
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
00018 // MA  02110-1301, USA
00020 #ifndef ARBREG_HPP
00021 #define ARBREG_HPP
00022 
00023 #include <string>
00024 #include <iosfwd>
00025 
00026 #include "ShRefCount.hpp"
00027 
00028 namespace shgl {
00029 
00032 enum ArbRegType {
00033   SH_ARB_REG_ATTRIB,
00034   SH_ARB_REG_PARAM,
00035   SH_ARB_REG_TEMP,
00036   SH_ARB_REG_HALF_TEMP, // @todo type may want to rethink this
00037   SH_ARB_REG_ADDRESS,
00038   SH_ARB_REG_OUTPUT,
00039   SH_ARB_REG_CONST,
00040   SH_ARB_REG_TEXTURE
00041 };
00042 
00045 enum ArbRegBinding {
00046   // VERTEX and FRAGMENT
00047   // Parameter
00048   SH_ARB_REG_PROGRAMLOC,
00049   SH_ARB_REG_PROGRAMENV,
00050   SH_ARB_REG_STATE,
00051   // Output
00052   SH_ARB_REG_RESULTCOL,
00053 
00054   // VERTEX
00055   // Input
00056   SH_ARB_REG_VERTEXPOS,
00057   SH_ARB_REG_VERTEXWGT,
00058   SH_ARB_REG_VERTEXNRM,
00059   SH_ARB_REG_VERTEXCOL,
00060   SH_ARB_REG_VERTEXFOG,
00061   SH_ARB_REG_VERTEXTEX,
00062   SH_ARB_REG_VERTEXMAT,
00063   SH_ARB_REG_VERTEXATR,
00064   // Output
00065   SH_ARB_REG_RESULTPOS,
00066   SH_ARB_REG_RESULTFOG,
00067   SH_ARB_REG_RESULTPTS, 
00068   SH_ARB_REG_RESULTTEX,
00069 
00070   // FRAGMENT
00071   // Input
00072   SH_ARB_REG_FRAGMENTCOL,
00073   SH_ARB_REG_FRAGMENTTEX,
00074   SH_ARB_REG_FRAGMENTFOG,
00075   SH_ARB_REG_FRAGMENTPOS,
00076   // Output
00077   SH_ARB_REG_RESULTDPT,
00078   SH_ARB_REG_RESULTCOL_ATI,
00079 
00080   SH_ARB_REG_NONE
00081 };
00082 
00085 struct ArbReg : public SH::ShRefCountable {
00086   ArbReg();
00087   ArbReg(ArbRegType type, int index, std::string name = "");
00088 
00089   ArbRegType type;
00090   int index;
00091   bool preset;
00092   std::string name; //< variable name (if any) associated with the register
00093 
00094   struct BindingInfo
00095     {
00096     ArbRegBinding type;
00097     int index;
00098     int count;
00099     std::string name;
00100     float values[4];
00101     };
00102   BindingInfo binding;
00103 
00104   friend std::ostream& operator<<(std::ostream& out, const ArbReg& reg);
00105   
00107   std::ostream& printDecl(std::ostream& out) const;
00108 };
00109 
00110 
00111 }
00112 
00113 #endif

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