csplugincommon/shader/weavercombiner.h
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2003-2007 by Marten Svanfeldt 00003 2004-2007 by Frank Richter 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 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 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 00020 #ifndef __CS_CSPLUGINCOMMON_SHADER_WEAVERCOMBINER_H__ 00021 #define __CS_CSPLUGINCOMMON_SHADER_WEAVERCOMBINER_H__ 00022 00023 #include "csutil/scf.h" 00024 #include "csgeom/vector4.h" 00025 #include <limits.h> 00026 00033 struct iDocumentNode; 00034 struct iDocumentNodeIterator; 00035 00036 namespace CS 00037 { 00038 namespace PluginCommon 00039 { 00040 namespace ShaderWeaver 00041 { 00042 static const uint NoCoercion = UINT_MAX; 00043 00044 struct iCoerceChainIterator : public iDocumentNodeIterator 00045 { 00046 SCF_INTERFACE (iCoerceChainIterator, 0, 1, 0); 00047 00048 virtual csRef<iDocumentNode> Next () = 0; 00049 virtual csRef<iDocumentNode> Next (const char*& fromType, 00050 const char*& toType) = 0; 00051 }; 00052 00053 struct iCombiner : public virtual iBase 00054 { 00055 SCF_INTERFACE (iCombiner, 0, 2, 0); 00056 00058 virtual void BeginSnippet (const char* annotation = 0) = 0; 00060 virtual void AddInput (const char* name, const char* type) = 0; 00062 virtual void AddInputValue (const char* name, const char* type, 00063 const char* value) = 0; 00065 virtual void AddOutput (const char* name, const char* type) = 0; 00067 virtual void InputRename (const char* fromName, const char* toName) = 0; 00069 virtual void OutputRename (const char* fromName, const char* toName) = 0; 00074 virtual void PropagateAttributes (const char* fromInput, 00075 const char* toOutput) = 0; 00077 virtual void AddOutputAttribute (const char* outputName, 00078 const char* name, const char* type) = 0; 00080 virtual void AddInputAttribute (const char* inputName, 00081 const char* name, const char* type, const char* defVal) = 0; 00086 virtual void Link (const char* fromName, const char* toName) = 0; 00088 virtual void WriteBlock (const char* location, 00089 iDocumentNode* blockNodes) = 0; 00091 virtual bool EndSnippet () = 0; 00092 00094 virtual void AddGlobal (const char* name, const char* type, 00095 const char* annotation = 0) = 0; 00097 virtual void SetOutput (const char* name, 00098 const char* annotation = 0) = 0; 00099 00104 /* @@@ FIXME: A bit of a design issue that weaver nodes are returned, 00105 since that means combiners have to "know" the syntax of 00106 weaver input docs! */ 00107 virtual csPtr<iCoerceChainIterator> QueryCoerceChain (const char* fromType, 00108 const char* toType) = 0; 00109 00116 virtual uint CoerceCost (const char* fromType, const char* toType) = 0; 00117 00119 virtual void WriteToPass (iDocumentNode* pass) = 0; 00120 00125 virtual bool CompatibleParams (iDocumentNode* params) = 0; 00126 00133 virtual csRef<iString> QueryInputTag (const char* location, 00134 iDocumentNode* blockNodes) = 0; 00135 }; 00136 00137 struct iCombinerLoader : public virtual iBase 00138 { 00139 SCF_INTERFACE (iCombinerLoader, 0, 0, 2); 00140 00141 virtual csPtr<iCombiner> GetCombiner (iDocumentNode* params) = 0; 00142 00143 virtual void GenerateConstantInputBlocks (iDocumentNode* node, 00144 const char* locationPrefix, const csVector4& value, 00145 int usedComponents, const char* outputName) = 0; 00146 virtual void GenerateSVInputBlocks (iDocumentNode* node, 00147 const char* locationPrefix, const char* svName, 00148 const char* outputType, const char* outputName, 00149 const char* uniqueTag) = 0; 00150 }; 00151 } // namespace ShaderWeaver 00152 } // namespace PluginCommon 00153 } // namespace CS 00154 00157 #endif // __CS_CSPLUGINCOMMON_SHADER_WEAVERCOMBINER_H__ 00158
Generated for Crystal Space 1.4.1 by doxygen 1.7.1