From: <re...@us...> - 2007-02-21 04:54:57
|
Revision: 26454 http://svn.sourceforge.net/crystal/?rev=26454&view=rev Author: res2002 Date: 2007-02-20 20:54:55 -0800 (Tue, 20 Feb 2007) Log Message: ----------- res augmented shaderweaver to optionally prevent merging of input (can be useful when targetting more restricted hardware and such). Modified Paths: -------------- CS/trunk/docs/history.txt CS/trunk/plugins/video/render3d/shader/shadercompiler/weaver/snippet.cpp CS/trunk/plugins/video/render3d/shader/shadercompiler/weaver/snippet.h CS/trunk/plugins/video/render3d/shader/shadercompiler/weaver/synth.cpp Modified: CS/trunk/docs/history.txt =================================================================== --- CS/trunk/docs/history.txt 2007-02-21 04:50:33 UTC (rev 26453) +++ CS/trunk/docs/history.txt 2007-02-21 04:54:55 UTC (rev 26454) @@ -19,6 +19,8 @@ static linking into a binary. - res added dsplex to the walktest plugin list (since it's the iDocumentSystem set in walktest.cfg). + - res augmented shaderweaver to optionally prevent merging of input + (can be useful when targetting more restricted hardware and such). 20-Feb-2007 - res made a number of reftracker-related tweaks: - Made CS compile again with reftracker enabled. Modified: CS/trunk/plugins/video/render3d/shader/shadercompiler/weaver/snippet.cpp =================================================================== --- CS/trunk/plugins/video/render3d/shader/shadercompiler/weaver/snippet.cpp 2007-02-21 04:50:33 UTC (rev 26453) +++ CS/trunk/plugins/video/render3d/shader/shadercompiler/weaver/snippet.cpp 2007-02-21 04:54:55 UTC (rev 26454) @@ -268,6 +268,8 @@ newInput.condition = condition; if (child->GetAttributeValueAsBool ("private")) newInput.flags |= Technique::Input::flagPrivate; + if (child->GetAttributeValueAsBool ("forcenomerge")) + newInput.flags |= Technique::Input::flagNoMerge; newTech.AddInput (newInput); } Modified: CS/trunk/plugins/video/render3d/shader/shadercompiler/weaver/snippet.h =================================================================== --- CS/trunk/plugins/video/render3d/shader/shadercompiler/weaver/snippet.h 2007-02-21 04:50:33 UTC (rev 26453) +++ CS/trunk/plugins/video/render3d/shader/shadercompiler/weaver/snippet.h 2007-02-21 04:54:55 UTC (rev 26454) @@ -65,7 +65,8 @@ } defaultType; enum { - flagPrivate = 1 + flagPrivate = 1, + flagNoMerge = 2 }; uint flags; csArray<Block> complexBlocks; Modified: CS/trunk/plugins/video/render3d/shader/shadercompiler/weaver/synth.cpp =================================================================== --- CS/trunk/plugins/video/render3d/shader/shadercompiler/weaver/synth.cpp 2007-02-21 04:50:33 UTC (rev 26453) +++ CS/trunk/plugins/video/render3d/shader/shadercompiler/weaver/synth.cpp 2007-02-21 04:54:55 UTC (rev 26454) @@ -252,19 +252,23 @@ // Look if there's already an input that has the same tag as this. EmittedInput* prevInput = 0; - csString tag = GetInputTag (combiner, *comb, - node.tech->GetCombiner(), inp); - if (!tag.IsEmpty()) + csString tag; + if (!(inp.flags & Snippet::Technique::Input::flagNoMerge)) { - TaggedInputHash::Iterator iter ( - taggedInputs.GetIterator (tag)); - while (iter.HasNext()) + tag = GetInputTag (combiner, *comb, node.tech->GetCombiner(), + inp); + if (!tag.IsEmpty()) { - size_t taggedInpIndex = iter.Next(); - if (emitInputs[taggedInpIndex].input->type == inp.type) + TaggedInputHash::Iterator iter ( + taggedInputs.GetIterator (tag)); + while (iter.HasNext()) { - prevInput = &emitInputs[taggedInpIndex]; - break; + size_t taggedInpIndex = iter.Next(); + if (emitInputs[taggedInpIndex].input->type == inp.type) + { + prevInput = &emitInputs[taggedInpIndex]; + break; + } } } } @@ -330,7 +334,8 @@ if (!inp.condition.IsEmpty()) emit.conditions.Push (inp.condition); size_t index = emitInputs.Push (emit); - if (!tag.IsEmpty()) + if (!tag.IsEmpty() + && !(inp.flags & Snippet::Technique::Input::flagNoMerge)) taggedInputs.Put (tag, index); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |