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

ArbReg.hpp

00001 // Sh: A GPU metaprogramming language. 00002 // 00003 // Copyright (c) 2003 University of Waterloo Computer Graphics Laboratory 00004 // Project administrator: Michael D. McCool 00005 // Authors: Zheng Qin, Stefanus Du Toit, Kevin Moule, Tiberiu S. Popa, 00006 // Michael D. McCool 00007 // 00008 // This software is provided 'as-is', without any express or implied 00009 // warranty. In no event will the authors be held liable for any damages 00010 // arising from the use of this software. 00011 // 00012 // Permission is granted to anyone to use this software for any purpose, 00013 // including commercial applications, and to alter it and redistribute it 00014 // freely, subject to the following restrictions: 00015 // 00016 // 1. The origin of this software must not be misrepresented; you must 00017 // not claim that you wrote the original software. If you use this 00018 // software in a product, an acknowledgment in the product documentation 00019 // would be appreciated but is not required. 00020 // 00021 // 2. Altered source versions must be plainly marked as such, and must 00022 // not be misrepresented as being the original software. 00023 // 00024 // 3. This notice may not be removed or altered from any source 00025 // distribution. 00027 #ifndef ARBREG_HPP 00028 #define ARBREG_HPP 00029 00030 #include <string> 00031 #include <iosfwd> 00032 00033 #include "ShRefCount.hpp" 00034 00035 namespace shgl { 00036 00039 enum ArbRegType { 00040 SH_ARB_REG_ATTRIB, 00041 SH_ARB_REG_PARAM, 00042 SH_ARB_REG_TEMP, 00043 SH_ARB_REG_ADDRESS, 00044 SH_ARB_REG_OUTPUT, 00045 SH_ARB_REG_CONST, 00046 SH_ARB_REG_TEXTURE 00047 }; 00048 00051 enum ArbRegBinding { 00052 // VERTEX and FRAGMENT 00053 // Parameter 00054 SH_ARB_REG_PARAMLOC, 00055 SH_ARB_REG_PARAMENV, 00056 // Output 00057 SH_ARB_REG_RESULTCOL, 00058 00059 // VERTEX 00060 // Input 00061 SH_ARB_REG_VERTEXPOS, 00062 SH_ARB_REG_VERTEXWGT, 00063 SH_ARB_REG_VERTEXNRM, 00064 SH_ARB_REG_VERTEXCOL, 00065 SH_ARB_REG_VERTEXFOG, 00066 SH_ARB_REG_VERTEXTEX, 00067 SH_ARB_REG_VERTEXMAT, 00068 SH_ARB_REG_VERTEXATR, 00069 // Output 00070 SH_ARB_REG_RESULTPOS, 00071 SH_ARB_REG_RESULTFOG, 00072 SH_ARB_REG_RESULTPTS, 00073 SH_ARB_REG_RESULTTEX, 00074 00075 // FRAGMENT 00076 // Input 00077 SH_ARB_REG_FRAGMENTCOL, 00078 SH_ARB_REG_FRAGMENTTEX, 00079 SH_ARB_REG_FRAGMENTFOG, 00080 SH_ARB_REG_FRAGMENTPOS, 00081 // Output 00082 SH_ARB_REG_RESULTDPT, 00083 00084 SH_ARB_REG_NONE 00085 }; 00086 00089 struct ArbReg : public SH::ShRefCountable { 00090 ArbReg(); 00091 ArbReg(ArbRegType type, int index, std::string name = ""); 00092 00093 ArbRegType type; 00094 int index; 00095 std::string name; //< variable name (if any) associated with the register 00096 00097 union { 00098 struct { 00099 ArbRegBinding binding; 00100 int bindingIndex; 00101 }; 00102 float values[4]; 00103 }; 00104 00105 friend std::ostream& operator<<(std::ostream& out, const ArbReg& reg); 00106 00108 std::ostream& printDecl(std::ostream& out) const; 00109 }; 00110 00111 00112 } 00113 00114 #endif

Generated on Mon Oct 18 14:17:38 2004 for Sh by doxygen 1.3.7