暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ShaderStripToolTests.cs 192KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751
  1. using System;
  2. using System.Collections.Generic;
  3. using NUnit.Framework;
  4. using UnityEditor.Rendering;
  5. using UnityEditor.Rendering.Universal;
  6. using UnityEngine;
  7. using UnityEngine.Rendering;
  8. using UnityEngine.Rendering.Universal;
  9. using UnityEngine.SocialPlatforms;
  10. using IShaderScriptableStrippingData = UnityEditor.Rendering.Universal.ShaderScriptableStripper.IShaderScriptableStrippingData;
  11. namespace ShaderStrippingAndPrefiltering
  12. {
  13. class ShaderStripToolTests
  14. {
  15. private static List<string> s_EnabledKeywords;
  16. private static List<string> s_PassKeywords;
  17. internal struct TestStrippingData : IShaderScriptableStrippingData
  18. {
  19. public ShaderFeatures shaderFeatures { get; set; }
  20. public VolumeFeatures volumeFeatures { get; set; }
  21. public bool isGLDevice { get; set; }
  22. public bool stripSoftShadowQualityLevels { get; set; }
  23. public bool strip2DPasses { get; set; }
  24. public bool stripDebugDisplayShaders { get; set; }
  25. public bool stripScreenCoordOverrideVariants { get; set; }
  26. public bool stripUnusedVariants { get; set; }
  27. public bool stripUnusedPostProcessingVariants { get; set; }
  28. public bool stripUnusedXRVariants { get; set; }
  29. public Shader shader { get; set; }
  30. public ShaderType shaderType { get; set; }
  31. public ShaderCompilerPlatform shaderCompilerPlatform { get; set; }
  32. public string passName { get; set; }
  33. public PassType passType { get; set; }
  34. public PassIdentifier passIdentifier { get; set; }
  35. public bool IsHDRDisplaySupportEnabled { get; set; }
  36. public bool IsHDRShaderVariantValid { get; set; }
  37. public bool IsKeywordEnabled(LocalKeyword keyword)
  38. {
  39. return s_EnabledKeywords != null && s_EnabledKeywords.Contains(keyword.name);
  40. }
  41. public bool IsShaderFeatureEnabled(ShaderFeatures feature)
  42. {
  43. return (shaderFeatures & feature) != 0;
  44. }
  45. public bool IsVolumeFeatureEnabled(VolumeFeatures feature)
  46. {
  47. return (volumeFeatures & feature) != 0;
  48. }
  49. public void ClearEnablePasses()
  50. {
  51. s_PassKeywords = null;
  52. }
  53. public bool PassHasKeyword(LocalKeyword keyword)
  54. {
  55. return s_PassKeywords != null && s_PassKeywords.Contains(keyword.name);
  56. }
  57. }
  58. [Test]
  59. public void TestContainsKeyword()
  60. {
  61. s_PassKeywords = new List<string>();
  62. s_EnabledKeywords = new List<string>();
  63. ShaderStripTool<ShaderFeatures> stripTool;
  64. IShaderScriptableStrippingData strippingData;
  65. LocalKeyword kw = new (Shader.Find("Universal Render Pipeline/Lit"), ShaderKeywordStrings.ScreenSpaceOcclusion);
  66. bool actual;
  67. strippingData = new TestStrippingData();
  68. strippingData.shaderFeatures = ShaderFeatures.None;
  69. s_PassKeywords = new List<string>();
  70. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  71. actual = stripTool.ContainsKeyword(kw);
  72. Assert.IsFalse(actual);
  73. strippingData = new TestStrippingData();
  74. strippingData.shaderFeatures = ShaderFeatures.None;
  75. s_PassKeywords = new List<string>() { ShaderKeywordStrings.ScreenSpaceOcclusion };
  76. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  77. actual = stripTool.ContainsKeyword(kw);
  78. Assert.IsTrue(actual);
  79. }
  80. [Test]
  81. public void TestStripMultiCompileKeepOffVariant1()
  82. {
  83. s_PassKeywords = new List<string>();
  84. s_EnabledKeywords = new List<string>();
  85. ShaderStripTool<ShaderFeatures> stripTool;
  86. IShaderScriptableStrippingData strippingData;
  87. LocalKeyword kw = new (Shader.Find("Universal Render Pipeline/Lit"), ShaderKeywordStrings.ScreenSpaceOcclusion);
  88. bool actual;
  89. strippingData = new TestStrippingData();
  90. strippingData.shaderFeatures = ShaderFeatures.None;
  91. s_EnabledKeywords = new List<string>();
  92. s_PassKeywords = new List<string>();
  93. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  94. actual = stripTool.StripMultiCompileKeepOffVariant(kw, ShaderFeatures.ScreenSpaceOcclusion);
  95. Assert.IsFalse(actual);
  96. strippingData = new TestStrippingData();
  97. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceOcclusion;
  98. s_EnabledKeywords = new List<string>();
  99. s_PassKeywords = new List<string>();
  100. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  101. actual = stripTool.StripMultiCompileKeepOffVariant(kw, ShaderFeatures.ScreenSpaceOcclusion);
  102. Assert.IsFalse(actual);
  103. strippingData = new TestStrippingData();
  104. strippingData.shaderFeatures = ShaderFeatures.None;
  105. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.ScreenSpaceOcclusion };
  106. s_PassKeywords = new List<string>();
  107. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  108. actual = stripTool.StripMultiCompileKeepOffVariant(kw, ShaderFeatures.ScreenSpaceOcclusion);
  109. Assert.IsTrue(actual);
  110. strippingData = new TestStrippingData();
  111. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceOcclusion;
  112. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.ScreenSpaceOcclusion };
  113. s_PassKeywords = new List<string>();
  114. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  115. actual = stripTool.StripMultiCompileKeepOffVariant(kw, ShaderFeatures.ScreenSpaceOcclusion);
  116. Assert.IsFalse(actual);
  117. }
  118. [Test]
  119. public void TestStripMultiCompile1()
  120. {
  121. s_PassKeywords = new List<string>();
  122. s_EnabledKeywords = new List<string>();
  123. ShaderStripTool<ShaderFeatures> stripTool;
  124. IShaderScriptableStrippingData strippingData;
  125. LocalKeyword kw = new (Shader.Find("Universal Render Pipeline/Lit"), ShaderKeywordStrings.ScreenSpaceOcclusion);
  126. bool actual;
  127. // stripUnusedVariants = false; => Same as Keep Off variant
  128. strippingData = new TestStrippingData();
  129. strippingData.stripUnusedVariants = false;
  130. strippingData.shaderFeatures = ShaderFeatures.None;
  131. s_EnabledKeywords = new List<string>();
  132. s_PassKeywords = new List<string>();
  133. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  134. actual = stripTool.StripMultiCompile(kw, ShaderFeatures.ScreenSpaceOcclusion);
  135. Assert.IsFalse(actual);
  136. strippingData = new TestStrippingData();
  137. strippingData.stripUnusedVariants = false;
  138. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceOcclusion;
  139. s_EnabledKeywords = new List<string>();
  140. s_PassKeywords = new List<string>();
  141. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  142. actual = stripTool.StripMultiCompile(kw, ShaderFeatures.ScreenSpaceOcclusion);
  143. Assert.IsFalse(actual);
  144. strippingData = new TestStrippingData();
  145. strippingData.stripUnusedVariants = false;
  146. strippingData.shaderFeatures = ShaderFeatures.None;
  147. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.ScreenSpaceOcclusion };
  148. s_PassKeywords = new List<string>();
  149. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  150. actual = stripTool.StripMultiCompile(kw, ShaderFeatures.ScreenSpaceOcclusion);
  151. Assert.IsTrue(actual);
  152. strippingData = new TestStrippingData();
  153. strippingData.stripUnusedVariants = false;
  154. strippingData.shaderFeatures = ShaderFeatures.None;
  155. s_EnabledKeywords = new List<string>();
  156. s_PassKeywords = new List<string>() { ShaderKeywordStrings.ScreenSpaceOcclusion };
  157. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  158. actual = stripTool.StripMultiCompile(kw, ShaderFeatures.ScreenSpaceOcclusion);
  159. Assert.IsFalse(actual);
  160. strippingData = new TestStrippingData();
  161. strippingData.stripUnusedVariants = false;
  162. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceOcclusion;
  163. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.ScreenSpaceOcclusion };
  164. s_PassKeywords = new List<string>();
  165. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  166. actual = stripTool.StripMultiCompile(kw, ShaderFeatures.ScreenSpaceOcclusion);
  167. Assert.IsFalse(actual);
  168. strippingData = new TestStrippingData();
  169. strippingData.stripUnusedVariants = false;
  170. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceOcclusion;
  171. s_EnabledKeywords = new List<string>();
  172. s_PassKeywords = new List<string>() { ShaderKeywordStrings.ScreenSpaceOcclusion };
  173. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  174. actual = stripTool.StripMultiCompile(kw, ShaderFeatures.ScreenSpaceOcclusion);
  175. Assert.IsFalse(actual);
  176. // stripUnusedVariants = true => takes out the Off variant
  177. strippingData = new TestStrippingData();
  178. strippingData.stripUnusedVariants = true;
  179. strippingData.shaderFeatures = ShaderFeatures.None;
  180. s_EnabledKeywords = new List<string>();
  181. s_PassKeywords = new List<string>();
  182. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  183. actual = stripTool.StripMultiCompile(kw, ShaderFeatures.ScreenSpaceOcclusion);
  184. Assert.IsFalse(actual);
  185. strippingData = new TestStrippingData();
  186. strippingData.stripUnusedVariants = true;
  187. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceOcclusion;
  188. s_EnabledKeywords = new List<string>();
  189. s_PassKeywords = new List<string>();
  190. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  191. actual = stripTool.StripMultiCompile(kw, ShaderFeatures.ScreenSpaceOcclusion);
  192. Assert.IsFalse(actual);
  193. strippingData = new TestStrippingData();
  194. strippingData.stripUnusedVariants = true;
  195. strippingData.shaderFeatures = ShaderFeatures.None;
  196. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.ScreenSpaceOcclusion };
  197. s_PassKeywords = new List<string>();
  198. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  199. actual = stripTool.StripMultiCompile(kw, ShaderFeatures.ScreenSpaceOcclusion);
  200. Assert.IsTrue(actual);
  201. strippingData = new TestStrippingData();
  202. strippingData.stripUnusedVariants = true;
  203. strippingData.shaderFeatures = ShaderFeatures.None;
  204. s_EnabledKeywords = new List<string>();
  205. s_PassKeywords = new List<string>() { ShaderKeywordStrings.ScreenSpaceOcclusion };
  206. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  207. actual = stripTool.StripMultiCompile(kw, ShaderFeatures.ScreenSpaceOcclusion);
  208. Assert.IsFalse(actual);
  209. strippingData = new TestStrippingData();
  210. strippingData.stripUnusedVariants = true;
  211. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceOcclusion;
  212. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.ScreenSpaceOcclusion };
  213. s_PassKeywords = new List<string>();
  214. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  215. actual = stripTool.StripMultiCompile(kw, ShaderFeatures.ScreenSpaceOcclusion);
  216. Assert.IsFalse(actual);
  217. // Here the OFF variant is stripped
  218. strippingData = new TestStrippingData();
  219. strippingData.stripUnusedVariants = true;
  220. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceOcclusion;
  221. s_EnabledKeywords = new List<string>();
  222. s_PassKeywords = new List<string>() { ShaderKeywordStrings.ScreenSpaceOcclusion };
  223. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  224. actual = stripTool.StripMultiCompile(kw, ShaderFeatures.ScreenSpaceOcclusion);
  225. Assert.IsTrue(actual);
  226. }
  227. [Test]
  228. public void TestStripMultiCompileKeepOffVariant2()
  229. {
  230. s_PassKeywords = new List<string>();
  231. s_EnabledKeywords = new List<string>();
  232. ShaderStripTool<ShaderFeatures> stripTool;
  233. IShaderScriptableStrippingData strippingData;
  234. LocalKeyword kw1 = new (Shader.Find("Universal Render Pipeline/Lit"), ShaderKeywordStrings.AdditionalLightsVertex);
  235. LocalKeyword kw2 = new (Shader.Find("Universal Render Pipeline/Lit"), ShaderKeywordStrings.AdditionalLightsPixel);
  236. bool actual;
  237. // All keywords disabled
  238. strippingData = new TestStrippingData();
  239. strippingData.shaderFeatures = ShaderFeatures.None;
  240. s_EnabledKeywords = new List<string>();
  241. s_PassKeywords = new List<string>();
  242. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  243. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  244. Assert.IsFalse(actual);
  245. strippingData = new TestStrippingData();
  246. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex;
  247. s_EnabledKeywords = new List<string>();
  248. s_PassKeywords = new List<string>();
  249. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  250. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  251. Assert.IsFalse(actual);
  252. strippingData = new TestStrippingData();
  253. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsPixel;
  254. s_EnabledKeywords = new List<string>();
  255. s_PassKeywords = new List<string>();
  256. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  257. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  258. Assert.IsFalse(actual);
  259. strippingData = new TestStrippingData();
  260. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  261. s_EnabledKeywords = new List<string>();
  262. s_PassKeywords = new List<string>();
  263. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  264. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  265. Assert.IsFalse(actual);
  266. // With enabled keywords
  267. strippingData = new TestStrippingData();
  268. strippingData.shaderFeatures = ShaderFeatures.None;
  269. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  270. s_PassKeywords = new List<string>();
  271. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  272. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  273. Assert.IsTrue(actual);
  274. strippingData = new TestStrippingData();
  275. strippingData.shaderFeatures = ShaderFeatures.None;
  276. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  277. s_PassKeywords = new List<string>();
  278. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  279. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  280. Assert.IsTrue(actual);
  281. strippingData = new TestStrippingData();
  282. strippingData.shaderFeatures = ShaderFeatures.None;
  283. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex, ShaderKeywordStrings.AdditionalLightsPixel };
  284. s_PassKeywords = new List<string>();
  285. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  286. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  287. Assert.IsTrue(actual);
  288. strippingData = new TestStrippingData();
  289. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex;
  290. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  291. s_PassKeywords = new List<string>();
  292. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  293. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  294. Assert.IsFalse(actual);
  295. strippingData = new TestStrippingData();
  296. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex;
  297. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  298. s_PassKeywords = new List<string>();
  299. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  300. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  301. Assert.IsTrue(actual);
  302. strippingData = new TestStrippingData();
  303. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex;
  304. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex, ShaderKeywordStrings.AdditionalLightsPixel };
  305. s_PassKeywords = new List<string>();
  306. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  307. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  308. Assert.IsTrue(actual);
  309. strippingData = new TestStrippingData();
  310. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsPixel;
  311. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  312. s_PassKeywords = new List<string>();
  313. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  314. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  315. Assert.IsTrue(actual);
  316. strippingData = new TestStrippingData();
  317. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsPixel;
  318. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  319. s_PassKeywords = new List<string>();
  320. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  321. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  322. Assert.IsFalse(actual);
  323. strippingData = new TestStrippingData();
  324. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsPixel;
  325. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex, ShaderKeywordStrings.AdditionalLightsPixel };
  326. s_PassKeywords = new List<string>();
  327. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  328. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  329. Assert.IsTrue(actual);
  330. // Both features enabled
  331. strippingData = new TestStrippingData();
  332. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  333. s_EnabledKeywords = new List<string>();
  334. s_PassKeywords = new List<string>();
  335. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  336. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  337. Assert.IsFalse(actual);
  338. strippingData = new TestStrippingData();
  339. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  340. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  341. s_PassKeywords = new List<string>();
  342. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  343. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  344. Assert.IsFalse(actual);
  345. strippingData = new TestStrippingData();
  346. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  347. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  348. s_PassKeywords = new List<string>();
  349. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  350. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  351. Assert.IsFalse(actual);
  352. strippingData = new TestStrippingData();
  353. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  354. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex, ShaderKeywordStrings.AdditionalLightsPixel };
  355. s_PassKeywords = new List<string>();
  356. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  357. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  358. Assert.IsFalse(actual);
  359. }
  360. [Test]
  361. public void TestStripMultiCompile2()
  362. {
  363. s_PassKeywords = new List<string>();
  364. s_EnabledKeywords = new List<string>();
  365. ShaderStripTool<ShaderFeatures> stripTool;
  366. IShaderScriptableStrippingData strippingData;
  367. LocalKeyword kw1 = new (Shader.Find("Universal Render Pipeline/Lit"), ShaderKeywordStrings.AdditionalLightsVertex);
  368. LocalKeyword kw2 = new (Shader.Find("Universal Render Pipeline/Lit"), ShaderKeywordStrings.AdditionalLightsPixel);
  369. bool actual;
  370. /////////////////////////////////////
  371. /// Strip Unused Variants Disabled
  372. /////////////////////////////////////
  373. // All keywords disabled
  374. strippingData = new TestStrippingData();
  375. strippingData.stripUnusedVariants = false;
  376. strippingData.shaderFeatures = ShaderFeatures.None;
  377. s_EnabledKeywords = new List<string>();
  378. s_PassKeywords = new List<string>();
  379. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  380. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  381. Assert.IsFalse(actual);
  382. strippingData = new TestStrippingData();
  383. strippingData.stripUnusedVariants = false;
  384. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex;
  385. s_EnabledKeywords = new List<string>();
  386. s_PassKeywords = new List<string>();
  387. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  388. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  389. Assert.IsFalse(actual);
  390. strippingData = new TestStrippingData();
  391. strippingData.stripUnusedVariants = false;
  392. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsPixel;
  393. s_EnabledKeywords = new List<string>();
  394. s_PassKeywords = new List<string>();
  395. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  396. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  397. Assert.IsFalse(actual);
  398. strippingData = new TestStrippingData();
  399. strippingData.stripUnusedVariants = false;
  400. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  401. s_EnabledKeywords = new List<string>();
  402. s_PassKeywords = new List<string>();
  403. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  404. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  405. Assert.IsFalse(actual);
  406. // With enabled keywords
  407. strippingData = new TestStrippingData();
  408. strippingData.stripUnusedVariants = false;
  409. strippingData.shaderFeatures = ShaderFeatures.None;
  410. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  411. s_PassKeywords = new List<string>();
  412. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  413. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  414. Assert.IsTrue(actual);
  415. strippingData = new TestStrippingData();
  416. strippingData.stripUnusedVariants = false;
  417. strippingData.shaderFeatures = ShaderFeatures.None;
  418. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  419. s_PassKeywords = new List<string>();
  420. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  421. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  422. Assert.IsTrue(actual);
  423. strippingData = new TestStrippingData();
  424. strippingData.stripUnusedVariants = false;
  425. strippingData.shaderFeatures = ShaderFeatures.None;
  426. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex, ShaderKeywordStrings.AdditionalLightsPixel };
  427. s_PassKeywords = new List<string>();
  428. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  429. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  430. Assert.IsTrue(actual);
  431. strippingData = new TestStrippingData();
  432. strippingData.stripUnusedVariants = false;
  433. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex;
  434. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  435. s_PassKeywords = new List<string>();
  436. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  437. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  438. Assert.IsFalse(actual);
  439. strippingData = new TestStrippingData();
  440. strippingData.stripUnusedVariants = false;
  441. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex;
  442. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  443. s_PassKeywords = new List<string>();
  444. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  445. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  446. Assert.IsTrue(actual);
  447. strippingData = new TestStrippingData();
  448. strippingData.stripUnusedVariants = false;
  449. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex;
  450. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex, ShaderKeywordStrings.AdditionalLightsPixel };
  451. s_PassKeywords = new List<string>();
  452. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  453. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  454. Assert.IsTrue(actual);
  455. strippingData = new TestStrippingData();
  456. strippingData.stripUnusedVariants = false;
  457. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsPixel;
  458. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  459. s_PassKeywords = new List<string>();
  460. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  461. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  462. Assert.IsTrue(actual);
  463. strippingData = new TestStrippingData();
  464. strippingData.stripUnusedVariants = false;
  465. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsPixel;
  466. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  467. s_PassKeywords = new List<string>();
  468. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  469. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  470. Assert.IsFalse(actual);
  471. strippingData = new TestStrippingData();
  472. strippingData.stripUnusedVariants = false;
  473. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsPixel;
  474. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex, ShaderKeywordStrings.AdditionalLightsPixel };
  475. s_PassKeywords = new List<string>();
  476. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  477. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  478. Assert.IsTrue(actual);
  479. // Both features enabled
  480. strippingData = new TestStrippingData();
  481. strippingData.stripUnusedVariants = false;
  482. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  483. s_EnabledKeywords = new List<string>();
  484. s_PassKeywords = new List<string>();
  485. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  486. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  487. Assert.IsFalse(actual);
  488. strippingData = new TestStrippingData();
  489. strippingData.stripUnusedVariants = false;
  490. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  491. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  492. s_PassKeywords = new List<string>();
  493. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  494. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  495. Assert.IsFalse(actual);
  496. strippingData = new TestStrippingData();
  497. strippingData.stripUnusedVariants = false;
  498. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  499. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  500. s_PassKeywords = new List<string>();
  501. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  502. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  503. Assert.IsFalse(actual);
  504. strippingData = new TestStrippingData();
  505. strippingData.stripUnusedVariants = false;
  506. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  507. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex, ShaderKeywordStrings.AdditionalLightsPixel };
  508. s_PassKeywords = new List<string>();
  509. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  510. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  511. Assert.IsFalse(actual);
  512. /////////////////////////////////////
  513. /// Strip Unused Variants Enabled
  514. /////////////////////////////////////
  515. // All keywords disabled
  516. strippingData = new TestStrippingData();
  517. strippingData.stripUnusedVariants = true;
  518. strippingData.shaderFeatures = ShaderFeatures.None;
  519. s_EnabledKeywords = new List<string>();
  520. s_PassKeywords = new List<string>();
  521. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  522. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  523. Assert.IsFalse(actual);
  524. strippingData = new TestStrippingData();
  525. strippingData.stripUnusedVariants = true;
  526. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex;
  527. s_EnabledKeywords = new List<string>();
  528. s_PassKeywords = new List<string>();
  529. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  530. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  531. Assert.IsFalse(actual);
  532. strippingData = new TestStrippingData();
  533. strippingData.stripUnusedVariants = true;
  534. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsPixel;
  535. s_EnabledKeywords = new List<string>();
  536. s_PassKeywords = new List<string>();
  537. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  538. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  539. Assert.IsFalse(actual);
  540. strippingData = new TestStrippingData();
  541. strippingData.stripUnusedVariants = true;
  542. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  543. s_EnabledKeywords = new List<string>();
  544. s_PassKeywords = new List<string>();
  545. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  546. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  547. Assert.IsFalse(actual);
  548. // With enabled keywords
  549. strippingData = new TestStrippingData();
  550. strippingData.stripUnusedVariants = true;
  551. strippingData.shaderFeatures = ShaderFeatures.None;
  552. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  553. s_PassKeywords = new List<string>();
  554. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  555. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  556. Assert.IsTrue(actual);
  557. strippingData = new TestStrippingData();
  558. strippingData.stripUnusedVariants = true;
  559. strippingData.shaderFeatures = ShaderFeatures.None;
  560. s_EnabledKeywords = new List<string>();
  561. s_PassKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  562. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  563. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  564. Assert.IsFalse(actual);
  565. strippingData = new TestStrippingData();
  566. strippingData.stripUnusedVariants = true;
  567. strippingData.shaderFeatures = ShaderFeatures.None;
  568. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  569. s_PassKeywords = new List<string>();
  570. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  571. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  572. Assert.IsTrue(actual);
  573. strippingData = new TestStrippingData();
  574. strippingData.stripUnusedVariants = true;
  575. strippingData.shaderFeatures = ShaderFeatures.None;
  576. s_EnabledKeywords = new List<string>();
  577. s_PassKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  578. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  579. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  580. Assert.IsFalse(actual);
  581. strippingData = new TestStrippingData();
  582. strippingData.stripUnusedVariants = true;
  583. strippingData.shaderFeatures = ShaderFeatures.None;
  584. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex, ShaderKeywordStrings.AdditionalLightsPixel };
  585. s_PassKeywords = new List<string>();
  586. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  587. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  588. Assert.IsTrue(actual);
  589. strippingData = new TestStrippingData();
  590. strippingData.stripUnusedVariants = true;
  591. strippingData.shaderFeatures = ShaderFeatures.None;
  592. s_EnabledKeywords = new List<string>();
  593. s_PassKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex, ShaderKeywordStrings.AdditionalLightsPixel };
  594. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  595. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  596. Assert.IsFalse(actual);
  597. strippingData = new TestStrippingData();
  598. strippingData.stripUnusedVariants = true;
  599. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex;
  600. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  601. s_PassKeywords = new List<string>();
  602. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  603. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  604. Assert.IsFalse(actual);
  605. strippingData = new TestStrippingData();
  606. strippingData.stripUnusedVariants = true;
  607. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex;
  608. s_EnabledKeywords = new List<string>();
  609. s_PassKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  610. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  611. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  612. Assert.IsFalse(actual);
  613. strippingData = new TestStrippingData();
  614. strippingData.stripUnusedVariants = true;
  615. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex;
  616. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  617. s_PassKeywords = new List<string>();
  618. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  619. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  620. Assert.IsTrue(actual);
  621. strippingData = new TestStrippingData();
  622. strippingData.stripUnusedVariants = true;
  623. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex;
  624. s_EnabledKeywords = new List<string>();
  625. s_PassKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  626. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  627. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  628. Assert.IsFalse(actual);
  629. strippingData = new TestStrippingData();
  630. strippingData.stripUnusedVariants = true;
  631. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex;
  632. s_EnabledKeywords = new List<string>();
  633. s_PassKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex, ShaderKeywordStrings.AdditionalLightsPixel };
  634. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  635. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  636. Assert.IsTrue(actual);
  637. strippingData = new TestStrippingData();
  638. strippingData.stripUnusedVariants = true;
  639. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsPixel;
  640. s_EnabledKeywords = new List<string>();
  641. s_PassKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  642. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  643. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  644. Assert.IsFalse(actual);
  645. strippingData = new TestStrippingData();
  646. strippingData.stripUnusedVariants = true;
  647. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsPixel;
  648. s_EnabledKeywords = new List<string>();
  649. s_PassKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  650. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  651. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  652. Assert.IsFalse(actual);
  653. strippingData = new TestStrippingData();
  654. strippingData.stripUnusedVariants = true;
  655. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsPixel;
  656. s_EnabledKeywords = new List<string>();
  657. s_PassKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex, ShaderKeywordStrings.AdditionalLightsPixel };
  658. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  659. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  660. Assert.IsTrue(actual);
  661. // Both features enabled
  662. strippingData = new TestStrippingData();
  663. strippingData.stripUnusedVariants = true;
  664. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  665. s_EnabledKeywords = new List<string>();
  666. s_PassKeywords = new List<string>();
  667. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  668. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  669. Assert.IsFalse(actual);
  670. strippingData = new TestStrippingData();
  671. strippingData.stripUnusedVariants = true;
  672. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  673. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  674. s_PassKeywords = new List<string>();
  675. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  676. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  677. Assert.IsFalse(actual);
  678. strippingData = new TestStrippingData();
  679. strippingData.stripUnusedVariants = true;
  680. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  681. s_EnabledKeywords = new List<string>();
  682. s_PassKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex };
  683. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  684. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  685. Assert.IsFalse(actual);
  686. strippingData = new TestStrippingData();
  687. strippingData.stripUnusedVariants = false;
  688. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  689. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  690. s_PassKeywords = new List<string>();
  691. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  692. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  693. Assert.IsFalse(actual);
  694. strippingData = new TestStrippingData();
  695. strippingData.stripUnusedVariants = false;
  696. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  697. s_EnabledKeywords = new List<string>();
  698. s_PassKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsPixel };
  699. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  700. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  701. Assert.IsFalse(actual);
  702. strippingData = new TestStrippingData();
  703. strippingData.stripUnusedVariants = true;
  704. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  705. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex, ShaderKeywordStrings.AdditionalLightsPixel };
  706. s_PassKeywords = new List<string>();
  707. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  708. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  709. Assert.IsFalse(actual);
  710. strippingData = new TestStrippingData();
  711. strippingData.stripUnusedVariants = true;
  712. strippingData.shaderFeatures = ShaderFeatures.AdditionalLightsVertex | ShaderFeatures.AdditionalLightsPixel;
  713. s_EnabledKeywords = new List<string>();
  714. s_PassKeywords = new List<string>() { ShaderKeywordStrings.AdditionalLightsVertex, ShaderKeywordStrings.AdditionalLightsPixel };
  715. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  716. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.AdditionalLightsVertex, kw2, ShaderFeatures.AdditionalLightsPixel);
  717. Assert.IsTrue(actual);
  718. }
  719. [Test]
  720. public void TestStripMultiCompileKeepOffVariant3()
  721. {
  722. s_PassKeywords = new List<string>();
  723. s_EnabledKeywords = new List<string>();
  724. ShaderStripTool<ShaderFeatures> stripTool;
  725. IShaderScriptableStrippingData strippingData;
  726. LocalKeyword kw1 = new (Shader.Find("Universal Render Pipeline/Lit"), ShaderKeywordStrings.MainLightShadows);
  727. LocalKeyword kw2 = new (Shader.Find("Universal Render Pipeline/Lit"), ShaderKeywordStrings.MainLightShadowCascades);
  728. LocalKeyword kw3 = new (Shader.Find("Universal Render Pipeline/Lit"), ShaderKeywordStrings.MainLightShadowScreen);
  729. bool actual;
  730. // All keywords disabled
  731. strippingData = new TestStrippingData();
  732. strippingData.shaderFeatures = ShaderFeatures.None;
  733. s_EnabledKeywords = new List<string>();
  734. s_PassKeywords = new List<string>();
  735. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  736. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  737. Assert.IsFalse(actual);
  738. strippingData = new TestStrippingData();
  739. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  740. s_EnabledKeywords = new List<string>();
  741. s_PassKeywords = new List<string>();
  742. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  743. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  744. Assert.IsFalse(actual);
  745. strippingData = new TestStrippingData();
  746. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  747. s_EnabledKeywords = new List<string>();
  748. s_PassKeywords = new List<string>();
  749. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  750. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  751. Assert.IsFalse(actual);
  752. strippingData = new TestStrippingData();
  753. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  754. s_EnabledKeywords = new List<string>();
  755. s_PassKeywords = new List<string>();
  756. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  757. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  758. Assert.IsFalse(actual);
  759. strippingData = new TestStrippingData();
  760. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  761. s_EnabledKeywords = new List<string>();
  762. s_PassKeywords = new List<string>();
  763. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  764. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  765. Assert.IsFalse(actual);
  766. strippingData = new TestStrippingData();
  767. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  768. s_EnabledKeywords = new List<string>();
  769. s_PassKeywords = new List<string>();
  770. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  771. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  772. Assert.IsFalse(actual);
  773. strippingData = new TestStrippingData();
  774. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  775. s_EnabledKeywords = new List<string>();
  776. s_PassKeywords = new List<string>();
  777. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  778. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  779. Assert.IsFalse(actual);
  780. strippingData = new TestStrippingData();
  781. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  782. s_EnabledKeywords = new List<string>();
  783. s_PassKeywords = new List<string>();
  784. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  785. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  786. Assert.IsFalse(actual);
  787. // With enabled keywords
  788. strippingData = new TestStrippingData();
  789. strippingData.shaderFeatures = ShaderFeatures.None;
  790. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  791. s_PassKeywords = new List<string>();
  792. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  793. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  794. Assert.IsTrue(actual);
  795. strippingData = new TestStrippingData();
  796. strippingData.shaderFeatures = ShaderFeatures.None;
  797. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  798. s_PassKeywords = new List<string>();
  799. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  800. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  801. Assert.IsTrue(actual);
  802. strippingData = new TestStrippingData();
  803. strippingData.shaderFeatures = ShaderFeatures.None;
  804. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  805. s_PassKeywords = new List<string>();
  806. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  807. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  808. Assert.IsTrue(actual);
  809. strippingData = new TestStrippingData();
  810. strippingData.shaderFeatures = ShaderFeatures.None;
  811. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  812. s_PassKeywords = new List<string>();
  813. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  814. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  815. Assert.IsTrue(actual);
  816. strippingData = new TestStrippingData();
  817. strippingData.shaderFeatures = ShaderFeatures.None;
  818. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  819. s_PassKeywords = new List<string>();
  820. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  821. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  822. Assert.IsTrue(actual);
  823. strippingData = new TestStrippingData();
  824. strippingData.shaderFeatures = ShaderFeatures.None;
  825. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  826. s_PassKeywords = new List<string>();
  827. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  828. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  829. Assert.IsTrue(actual);
  830. strippingData = new TestStrippingData();
  831. strippingData.shaderFeatures = ShaderFeatures.None;
  832. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  833. s_PassKeywords = new List<string>();
  834. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  835. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  836. Assert.IsTrue(actual);
  837. strippingData = new TestStrippingData();
  838. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  839. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  840. s_PassKeywords = new List<string>();
  841. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  842. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  843. Assert.IsFalse(actual);
  844. strippingData = new TestStrippingData();
  845. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  846. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  847. s_PassKeywords = new List<string>();
  848. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  849. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  850. Assert.IsTrue(actual);
  851. strippingData = new TestStrippingData();
  852. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  853. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  854. s_PassKeywords = new List<string>();
  855. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  856. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  857. Assert.IsTrue(actual);
  858. strippingData = new TestStrippingData();
  859. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  860. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  861. s_PassKeywords = new List<string>();
  862. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  863. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  864. Assert.IsTrue(actual);
  865. strippingData = new TestStrippingData();
  866. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  867. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  868. s_PassKeywords = new List<string>();
  869. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  870. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  871. Assert.IsTrue(actual);
  872. strippingData = new TestStrippingData();
  873. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  874. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  875. s_PassKeywords = new List<string>();
  876. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  877. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  878. Assert.IsTrue(actual);
  879. strippingData = new TestStrippingData();
  880. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  881. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  882. s_PassKeywords = new List<string>();
  883. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  884. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  885. Assert.IsTrue(actual);
  886. strippingData = new TestStrippingData();
  887. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  888. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  889. s_PassKeywords = new List<string>();
  890. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  891. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  892. Assert.IsTrue(actual);
  893. strippingData = new TestStrippingData();
  894. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  895. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  896. s_PassKeywords = new List<string>();
  897. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  898. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  899. Assert.IsFalse(actual);
  900. strippingData = new TestStrippingData();
  901. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  902. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  903. s_PassKeywords = new List<string>();
  904. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  905. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  906. Assert.IsTrue(actual);
  907. strippingData = new TestStrippingData();
  908. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  909. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  910. s_PassKeywords = new List<string>();
  911. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  912. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  913. Assert.IsTrue(actual);
  914. strippingData = new TestStrippingData();
  915. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  916. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  917. s_PassKeywords = new List<string>();
  918. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  919. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  920. Assert.IsTrue(actual);
  921. strippingData = new TestStrippingData();
  922. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  923. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  924. s_PassKeywords = new List<string>();
  925. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  926. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  927. Assert.IsTrue(actual);
  928. strippingData = new TestStrippingData();
  929. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  930. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  931. s_PassKeywords = new List<string>();
  932. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  933. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  934. Assert.IsTrue(actual);
  935. strippingData = new TestStrippingData();
  936. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  937. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  938. s_PassKeywords = new List<string>();
  939. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  940. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  941. Assert.IsTrue(actual);
  942. strippingData = new TestStrippingData();
  943. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  944. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  945. s_PassKeywords = new List<string>();
  946. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  947. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  948. Assert.IsTrue(actual);
  949. strippingData = new TestStrippingData();
  950. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  951. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  952. s_PassKeywords = new List<string>();
  953. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  954. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  955. Assert.IsFalse(actual);
  956. strippingData = new TestStrippingData();
  957. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  958. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  959. s_PassKeywords = new List<string>();
  960. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  961. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  962. Assert.IsTrue(actual);
  963. strippingData = new TestStrippingData();
  964. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  965. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  966. s_PassKeywords = new List<string>();
  967. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  968. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  969. Assert.IsTrue(actual);
  970. strippingData = new TestStrippingData();
  971. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  972. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  973. s_PassKeywords = new List<string>();
  974. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  975. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  976. Assert.IsTrue(actual);
  977. strippingData = new TestStrippingData();
  978. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  979. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  980. s_PassKeywords = new List<string>();
  981. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  982. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  983. Assert.IsTrue(actual);
  984. // Two features enabled
  985. strippingData = new TestStrippingData();
  986. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  987. s_EnabledKeywords = new List<string>();
  988. s_PassKeywords = new List<string>();
  989. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  990. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  991. Assert.IsFalse(actual);
  992. strippingData = new TestStrippingData();
  993. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  994. s_EnabledKeywords = new List<string>();
  995. s_PassKeywords = new List<string>();
  996. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  997. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  998. Assert.IsFalse(actual);
  999. strippingData = new TestStrippingData();
  1000. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1001. s_EnabledKeywords = new List<string>();
  1002. s_PassKeywords = new List<string>();
  1003. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1004. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1005. Assert.IsFalse(actual);
  1006. strippingData = new TestStrippingData();
  1007. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  1008. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1009. s_PassKeywords = new List<string>();
  1010. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1011. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1012. Assert.IsFalse(actual);
  1013. strippingData = new TestStrippingData();
  1014. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  1015. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1016. s_PassKeywords = new List<string>();
  1017. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1018. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1019. Assert.IsFalse(actual);
  1020. strippingData = new TestStrippingData();
  1021. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1022. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1023. s_PassKeywords = new List<string>();
  1024. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1025. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1026. Assert.IsTrue(actual);
  1027. strippingData = new TestStrippingData();
  1028. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  1029. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1030. s_PassKeywords = new List<string>();
  1031. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1032. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1033. Assert.IsFalse(actual);
  1034. strippingData = new TestStrippingData();
  1035. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  1036. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1037. s_PassKeywords = new List<string>();
  1038. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1039. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1040. Assert.IsTrue(actual);
  1041. strippingData = new TestStrippingData();
  1042. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1043. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1044. s_PassKeywords = new List<string>();
  1045. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1046. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1047. Assert.IsFalse(actual);
  1048. strippingData = new TestStrippingData();
  1049. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  1050. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1051. s_PassKeywords = new List<string>();
  1052. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1053. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1054. Assert.IsTrue(actual);
  1055. strippingData = new TestStrippingData();
  1056. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  1057. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1058. s_PassKeywords = new List<string>();
  1059. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1060. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1061. Assert.IsFalse(actual);
  1062. strippingData = new TestStrippingData();
  1063. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1064. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1065. s_PassKeywords = new List<string>();
  1066. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1067. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1068. Assert.IsFalse(actual);
  1069. // All features enabled
  1070. strippingData = new TestStrippingData();
  1071. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1072. s_EnabledKeywords = new List<string>();
  1073. s_PassKeywords = new List<string>();
  1074. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1075. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1076. Assert.IsFalse(actual);
  1077. strippingData = new TestStrippingData();
  1078. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1079. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1080. s_PassKeywords = new List<string>();
  1081. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1082. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1083. Assert.IsFalse(actual);
  1084. strippingData = new TestStrippingData();
  1085. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1086. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1087. s_PassKeywords = new List<string>();
  1088. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1089. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1090. Assert.IsFalse(actual);
  1091. strippingData = new TestStrippingData();
  1092. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1093. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1094. s_PassKeywords = new List<string>();
  1095. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1096. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1097. Assert.IsFalse(actual);
  1098. strippingData = new TestStrippingData();
  1099. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1100. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  1101. s_PassKeywords = new List<string>();
  1102. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1103. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1104. Assert.IsFalse(actual);
  1105. strippingData = new TestStrippingData();
  1106. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1107. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  1108. s_PassKeywords = new List<string>();
  1109. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1110. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1111. Assert.IsFalse(actual);
  1112. strippingData = new TestStrippingData();
  1113. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1114. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1115. s_PassKeywords = new List<string>();
  1116. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1117. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1118. Assert.IsFalse(actual);
  1119. strippingData = new TestStrippingData();
  1120. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1121. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1122. s_PassKeywords = new List<string>();
  1123. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1124. actual = stripTool.StripMultiCompileKeepOffVariant(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1125. Assert.IsFalse(actual);
  1126. }
  1127. [Test]
  1128. public void TestStripMultiCompile3()
  1129. {
  1130. s_PassKeywords = new List<string>();
  1131. s_EnabledKeywords = new List<string>();
  1132. ShaderStripTool<ShaderFeatures> stripTool;
  1133. IShaderScriptableStrippingData strippingData;
  1134. LocalKeyword kw1 = new (Shader.Find("Universal Render Pipeline/Lit"), ShaderKeywordStrings.MainLightShadows);
  1135. LocalKeyword kw2 = new (Shader.Find("Universal Render Pipeline/Lit"), ShaderKeywordStrings.MainLightShadowCascades);
  1136. LocalKeyword kw3 = new (Shader.Find("Universal Render Pipeline/Lit"), ShaderKeywordStrings.MainLightShadowScreen);
  1137. bool actual;
  1138. /////////////////////////////////////
  1139. /// Strip Unused Variants Disabled
  1140. /////////////////////////////////////
  1141. // All keywords disabled
  1142. strippingData = new TestStrippingData();
  1143. strippingData.stripUnusedVariants = false;
  1144. strippingData.shaderFeatures = ShaderFeatures.None;
  1145. s_EnabledKeywords = new List<string>();
  1146. s_PassKeywords = new List<string>();
  1147. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1148. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1149. Assert.IsFalse(actual);
  1150. strippingData = new TestStrippingData();
  1151. strippingData.stripUnusedVariants = false;
  1152. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1153. s_EnabledKeywords = new List<string>();
  1154. s_PassKeywords = new List<string>();
  1155. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1156. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1157. Assert.IsFalse(actual);
  1158. strippingData = new TestStrippingData();
  1159. strippingData.stripUnusedVariants = false;
  1160. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1161. s_EnabledKeywords = new List<string>();
  1162. s_PassKeywords = new List<string>();
  1163. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1164. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1165. Assert.IsFalse(actual);
  1166. strippingData = new TestStrippingData();
  1167. strippingData.stripUnusedVariants = false;
  1168. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  1169. s_EnabledKeywords = new List<string>();
  1170. s_PassKeywords = new List<string>();
  1171. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1172. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1173. Assert.IsFalse(actual);
  1174. strippingData = new TestStrippingData();
  1175. strippingData.stripUnusedVariants = false;
  1176. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  1177. s_EnabledKeywords = new List<string>();
  1178. s_PassKeywords = new List<string>();
  1179. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1180. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1181. Assert.IsFalse(actual);
  1182. strippingData = new TestStrippingData();
  1183. strippingData.stripUnusedVariants = false;
  1184. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  1185. s_EnabledKeywords = new List<string>();
  1186. s_PassKeywords = new List<string>();
  1187. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1188. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1189. Assert.IsFalse(actual);
  1190. strippingData = new TestStrippingData();
  1191. strippingData.stripUnusedVariants = false;
  1192. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1193. s_EnabledKeywords = new List<string>();
  1194. s_PassKeywords = new List<string>();
  1195. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1196. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1197. Assert.IsFalse(actual);
  1198. strippingData = new TestStrippingData();
  1199. strippingData.stripUnusedVariants = false;
  1200. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1201. s_EnabledKeywords = new List<string>();
  1202. s_PassKeywords = new List<string>();
  1203. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1204. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1205. Assert.IsFalse(actual);
  1206. // With enabled keywords
  1207. strippingData = new TestStrippingData();
  1208. strippingData.stripUnusedVariants = false;
  1209. strippingData.shaderFeatures = ShaderFeatures.None;
  1210. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1211. s_PassKeywords = new List<string>();
  1212. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1213. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1214. Assert.IsTrue(actual);
  1215. strippingData = new TestStrippingData();
  1216. strippingData.stripUnusedVariants = false;
  1217. strippingData.shaderFeatures = ShaderFeatures.None;
  1218. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1219. s_PassKeywords = new List<string>();
  1220. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1221. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1222. Assert.IsTrue(actual);
  1223. strippingData = new TestStrippingData();
  1224. strippingData.stripUnusedVariants = false;
  1225. strippingData.shaderFeatures = ShaderFeatures.None;
  1226. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1227. s_PassKeywords = new List<string>();
  1228. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1229. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1230. Assert.IsTrue(actual);
  1231. strippingData = new TestStrippingData();
  1232. strippingData.stripUnusedVariants = false;
  1233. strippingData.shaderFeatures = ShaderFeatures.None;
  1234. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  1235. s_PassKeywords = new List<string>();
  1236. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1237. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1238. Assert.IsTrue(actual);
  1239. strippingData = new TestStrippingData();
  1240. strippingData.stripUnusedVariants = false;
  1241. strippingData.shaderFeatures = ShaderFeatures.None;
  1242. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  1243. s_PassKeywords = new List<string>();
  1244. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1245. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1246. Assert.IsTrue(actual);
  1247. strippingData = new TestStrippingData();
  1248. strippingData.stripUnusedVariants = false;
  1249. strippingData.shaderFeatures = ShaderFeatures.None;
  1250. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1251. s_PassKeywords = new List<string>();
  1252. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1253. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1254. Assert.IsTrue(actual);
  1255. strippingData = new TestStrippingData();
  1256. strippingData.stripUnusedVariants = false;
  1257. strippingData.shaderFeatures = ShaderFeatures.None;
  1258. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1259. s_PassKeywords = new List<string>();
  1260. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1261. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1262. Assert.IsTrue(actual);
  1263. strippingData = new TestStrippingData();
  1264. strippingData.stripUnusedVariants = false;
  1265. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1266. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1267. s_PassKeywords = new List<string>();
  1268. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1269. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1270. Assert.IsFalse(actual);
  1271. strippingData = new TestStrippingData();
  1272. strippingData.stripUnusedVariants = false;
  1273. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1274. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1275. s_PassKeywords = new List<string>();
  1276. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1277. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1278. Assert.IsTrue(actual);
  1279. strippingData = new TestStrippingData();
  1280. strippingData.stripUnusedVariants = false;
  1281. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1282. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1283. s_PassKeywords = new List<string>();
  1284. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1285. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1286. Assert.IsTrue(actual);
  1287. strippingData = new TestStrippingData();
  1288. strippingData.stripUnusedVariants = false;
  1289. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1290. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  1291. s_PassKeywords = new List<string>();
  1292. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1293. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1294. Assert.IsTrue(actual);
  1295. strippingData = new TestStrippingData();
  1296. strippingData.stripUnusedVariants = false;
  1297. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1298. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  1299. s_PassKeywords = new List<string>();
  1300. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1301. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1302. Assert.IsTrue(actual);
  1303. strippingData = new TestStrippingData();
  1304. strippingData.stripUnusedVariants = false;
  1305. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1306. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1307. s_PassKeywords = new List<string>();
  1308. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1309. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1310. Assert.IsTrue(actual);
  1311. strippingData = new TestStrippingData();
  1312. strippingData.stripUnusedVariants = false;
  1313. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1314. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1315. s_PassKeywords = new List<string>();
  1316. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1317. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1318. Assert.IsTrue(actual);
  1319. strippingData = new TestStrippingData();
  1320. strippingData.stripUnusedVariants = false;
  1321. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1322. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1323. s_PassKeywords = new List<string>();
  1324. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1325. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1326. Assert.IsTrue(actual);
  1327. strippingData = new TestStrippingData();
  1328. strippingData.stripUnusedVariants = false;
  1329. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1330. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1331. s_PassKeywords = new List<string>();
  1332. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1333. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1334. Assert.IsFalse(actual);
  1335. strippingData = new TestStrippingData();
  1336. strippingData.stripUnusedVariants = false;
  1337. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1338. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1339. s_PassKeywords = new List<string>();
  1340. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1341. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1342. Assert.IsTrue(actual);
  1343. strippingData = new TestStrippingData();
  1344. strippingData.stripUnusedVariants = false;
  1345. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1346. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  1347. s_PassKeywords = new List<string>();
  1348. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1349. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1350. Assert.IsTrue(actual);
  1351. strippingData = new TestStrippingData();
  1352. strippingData.stripUnusedVariants = false;
  1353. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1354. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  1355. s_PassKeywords = new List<string>();
  1356. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1357. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1358. Assert.IsTrue(actual);
  1359. strippingData = new TestStrippingData();
  1360. strippingData.stripUnusedVariants = false;
  1361. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1362. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1363. s_PassKeywords = new List<string>();
  1364. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1365. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1366. Assert.IsTrue(actual);
  1367. strippingData = new TestStrippingData();
  1368. strippingData.stripUnusedVariants = false;
  1369. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1370. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1371. s_PassKeywords = new List<string>();
  1372. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1373. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1374. Assert.IsTrue(actual);
  1375. strippingData = new TestStrippingData();
  1376. strippingData.stripUnusedVariants = false;
  1377. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  1378. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1379. s_PassKeywords = new List<string>();
  1380. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1381. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1382. Assert.IsTrue(actual);
  1383. strippingData = new TestStrippingData();
  1384. strippingData.stripUnusedVariants = false;
  1385. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  1386. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1387. s_PassKeywords = new List<string>();
  1388. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1389. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1390. Assert.IsTrue(actual);
  1391. strippingData = new TestStrippingData();
  1392. strippingData.stripUnusedVariants = false;
  1393. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  1394. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1395. s_PassKeywords = new List<string>();
  1396. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1397. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1398. Assert.IsFalse(actual);
  1399. strippingData = new TestStrippingData();
  1400. strippingData.stripUnusedVariants = false;
  1401. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  1402. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  1403. s_PassKeywords = new List<string>();
  1404. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1405. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1406. Assert.IsTrue(actual);
  1407. strippingData = new TestStrippingData();
  1408. strippingData.stripUnusedVariants = false;
  1409. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  1410. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  1411. s_PassKeywords = new List<string>();
  1412. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1413. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1414. Assert.IsTrue(actual);
  1415. strippingData = new TestStrippingData();
  1416. strippingData.stripUnusedVariants = false;
  1417. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  1418. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1419. s_PassKeywords = new List<string>();
  1420. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1421. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1422. Assert.IsTrue(actual);
  1423. strippingData = new TestStrippingData();
  1424. strippingData.stripUnusedVariants = false;
  1425. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  1426. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1427. s_PassKeywords = new List<string>();
  1428. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1429. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1430. Assert.IsTrue(actual);
  1431. // Two features enabled
  1432. strippingData = new TestStrippingData();
  1433. strippingData.stripUnusedVariants = false;
  1434. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  1435. s_EnabledKeywords = new List<string>();
  1436. s_PassKeywords = new List<string>();
  1437. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1438. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1439. Assert.IsFalse(actual);
  1440. strippingData = new TestStrippingData();
  1441. strippingData.stripUnusedVariants = false;
  1442. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  1443. s_EnabledKeywords = new List<string>();
  1444. s_PassKeywords = new List<string>();
  1445. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1446. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1447. Assert.IsFalse(actual);
  1448. strippingData = new TestStrippingData();
  1449. strippingData.stripUnusedVariants = false;
  1450. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1451. s_EnabledKeywords = new List<string>();
  1452. s_PassKeywords = new List<string>();
  1453. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1454. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1455. Assert.IsFalse(actual);
  1456. strippingData = new TestStrippingData();
  1457. strippingData.stripUnusedVariants = false;
  1458. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  1459. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1460. s_PassKeywords = new List<string>();
  1461. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1462. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1463. Assert.IsFalse(actual);
  1464. strippingData = new TestStrippingData();
  1465. strippingData.stripUnusedVariants = false;
  1466. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  1467. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1468. s_PassKeywords = new List<string>();
  1469. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1470. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1471. Assert.IsFalse(actual);
  1472. strippingData = new TestStrippingData();
  1473. strippingData.stripUnusedVariants = false;
  1474. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1475. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1476. s_PassKeywords = new List<string>();
  1477. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1478. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1479. Assert.IsTrue(actual);
  1480. strippingData = new TestStrippingData();
  1481. strippingData.stripUnusedVariants = false;
  1482. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  1483. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1484. s_PassKeywords = new List<string>();
  1485. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1486. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1487. Assert.IsFalse(actual);
  1488. strippingData = new TestStrippingData();
  1489. strippingData.stripUnusedVariants = false;
  1490. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  1491. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1492. s_PassKeywords = new List<string>();
  1493. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1494. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1495. Assert.IsTrue(actual);
  1496. strippingData = new TestStrippingData();
  1497. strippingData.stripUnusedVariants = false;
  1498. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1499. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1500. s_PassKeywords = new List<string>();
  1501. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1502. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1503. Assert.IsFalse(actual);
  1504. strippingData = new TestStrippingData();
  1505. strippingData.stripUnusedVariants = false;
  1506. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  1507. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1508. s_PassKeywords = new List<string>();
  1509. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1510. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1511. Assert.IsTrue(actual);
  1512. strippingData = new TestStrippingData();
  1513. strippingData.stripUnusedVariants = false;
  1514. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  1515. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1516. s_PassKeywords = new List<string>();
  1517. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1518. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1519. Assert.IsFalse(actual);
  1520. strippingData = new TestStrippingData();
  1521. strippingData.stripUnusedVariants = false;
  1522. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1523. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1524. s_PassKeywords = new List<string>();
  1525. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1526. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1527. Assert.IsFalse(actual);
  1528. // All features enabled
  1529. strippingData = new TestStrippingData();
  1530. strippingData.stripUnusedVariants = false;
  1531. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1532. s_EnabledKeywords = new List<string>();
  1533. s_PassKeywords = new List<string>();
  1534. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1535. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1536. Assert.IsFalse(actual);
  1537. strippingData = new TestStrippingData();
  1538. strippingData.stripUnusedVariants = false;
  1539. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1540. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1541. s_PassKeywords = new List<string>();
  1542. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1543. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1544. Assert.IsFalse(actual);
  1545. strippingData = new TestStrippingData();
  1546. strippingData.stripUnusedVariants = false;
  1547. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1548. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1549. s_PassKeywords = new List<string>();
  1550. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1551. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1552. Assert.IsFalse(actual);
  1553. strippingData = new TestStrippingData();
  1554. strippingData.stripUnusedVariants = false;
  1555. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1556. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1557. s_PassKeywords = new List<string>();
  1558. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1559. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1560. Assert.IsFalse(actual);
  1561. strippingData = new TestStrippingData();
  1562. strippingData.stripUnusedVariants = false;
  1563. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1564. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  1565. s_PassKeywords = new List<string>();
  1566. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1567. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1568. Assert.IsFalse(actual);
  1569. strippingData = new TestStrippingData();
  1570. strippingData.stripUnusedVariants = false;
  1571. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1572. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  1573. s_PassKeywords = new List<string>();
  1574. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1575. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1576. Assert.IsFalse(actual);
  1577. strippingData = new TestStrippingData();
  1578. strippingData.stripUnusedVariants = false;
  1579. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1580. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1581. s_PassKeywords = new List<string>();
  1582. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1583. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1584. Assert.IsFalse(actual);
  1585. strippingData = new TestStrippingData();
  1586. strippingData.stripUnusedVariants = false;
  1587. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1588. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1589. s_PassKeywords = new List<string>();
  1590. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1591. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1592. Assert.IsFalse(actual);
  1593. /////////////////////////////////////
  1594. /// Strip Unused Variants Enabled
  1595. /////////////////////////////////////
  1596. // All keywords disabled
  1597. strippingData = new TestStrippingData();
  1598. strippingData.stripUnusedVariants = true;
  1599. strippingData.shaderFeatures = ShaderFeatures.None;
  1600. s_EnabledKeywords = new List<string>();
  1601. s_PassKeywords = new List<string>();
  1602. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1603. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1604. Assert.IsFalse(actual);
  1605. strippingData = new TestStrippingData();
  1606. strippingData.stripUnusedVariants = true;
  1607. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1608. s_EnabledKeywords = new List<string>();
  1609. s_PassKeywords = new List<string>();
  1610. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1611. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1612. Assert.IsFalse(actual);
  1613. strippingData = new TestStrippingData();
  1614. strippingData.stripUnusedVariants = true;
  1615. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1616. s_EnabledKeywords = new List<string>();
  1617. s_PassKeywords = new List<string>();
  1618. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1619. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1620. Assert.IsFalse(actual);
  1621. strippingData = new TestStrippingData();
  1622. strippingData.stripUnusedVariants = true;
  1623. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  1624. s_EnabledKeywords = new List<string>();
  1625. s_PassKeywords = new List<string>();
  1626. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1627. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1628. Assert.IsFalse(actual);
  1629. strippingData = new TestStrippingData();
  1630. strippingData.stripUnusedVariants = true;
  1631. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  1632. s_EnabledKeywords = new List<string>();
  1633. s_PassKeywords = new List<string>();
  1634. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1635. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1636. Assert.IsFalse(actual);
  1637. strippingData = new TestStrippingData();
  1638. strippingData.stripUnusedVariants = true;
  1639. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  1640. s_EnabledKeywords = new List<string>();
  1641. s_PassKeywords = new List<string>();
  1642. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1643. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1644. Assert.IsFalse(actual);
  1645. strippingData = new TestStrippingData();
  1646. strippingData.stripUnusedVariants = true;
  1647. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1648. s_EnabledKeywords = new List<string>();
  1649. s_PassKeywords = new List<string>();
  1650. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1651. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1652. Assert.IsFalse(actual);
  1653. strippingData = new TestStrippingData();
  1654. strippingData.stripUnusedVariants = true;
  1655. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  1656. s_EnabledKeywords = new List<string>();
  1657. s_PassKeywords = new List<string>();
  1658. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1659. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1660. Assert.IsFalse(actual);
  1661. // With enabled keywords
  1662. strippingData = new TestStrippingData();
  1663. strippingData.stripUnusedVariants = true;
  1664. strippingData.shaderFeatures = ShaderFeatures.None;
  1665. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1666. s_PassKeywords = new List<string>();
  1667. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1668. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1669. Assert.IsTrue(actual);
  1670. strippingData = new TestStrippingData();
  1671. strippingData.stripUnusedVariants = true;
  1672. strippingData.shaderFeatures = ShaderFeatures.None;
  1673. s_EnabledKeywords = new List<string>();
  1674. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1675. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1676. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1677. Assert.IsFalse(actual);
  1678. strippingData = new TestStrippingData();
  1679. strippingData.stripUnusedVariants = true;
  1680. strippingData.shaderFeatures = ShaderFeatures.None;
  1681. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1682. s_PassKeywords = new List<string>();
  1683. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1684. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1685. Assert.IsTrue(actual);
  1686. strippingData = new TestStrippingData();
  1687. strippingData.stripUnusedVariants = true;
  1688. strippingData.shaderFeatures = ShaderFeatures.None;
  1689. s_EnabledKeywords = new List<string>();
  1690. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1691. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1692. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1693. Assert.IsFalse(actual);
  1694. strippingData = new TestStrippingData();
  1695. strippingData.stripUnusedVariants = true;
  1696. strippingData.shaderFeatures = ShaderFeatures.None;
  1697. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1698. s_PassKeywords = new List<string>();
  1699. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1700. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1701. Assert.IsTrue(actual);
  1702. strippingData = new TestStrippingData();
  1703. strippingData.stripUnusedVariants = true;
  1704. strippingData.shaderFeatures = ShaderFeatures.None;
  1705. s_EnabledKeywords = new List<string>();
  1706. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1707. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1708. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1709. Assert.IsFalse(actual);
  1710. strippingData = new TestStrippingData();
  1711. strippingData.stripUnusedVariants = true;
  1712. strippingData.shaderFeatures = ShaderFeatures.None;
  1713. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  1714. s_PassKeywords = new List<string>();
  1715. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1716. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1717. Assert.IsTrue(actual);
  1718. strippingData = new TestStrippingData();
  1719. strippingData.stripUnusedVariants = true;
  1720. strippingData.shaderFeatures = ShaderFeatures.None;
  1721. s_EnabledKeywords = new List<string>();
  1722. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  1723. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1724. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1725. Assert.IsFalse(actual);
  1726. strippingData = new TestStrippingData();
  1727. strippingData.stripUnusedVariants = true;
  1728. strippingData.shaderFeatures = ShaderFeatures.None;
  1729. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  1730. s_PassKeywords = new List<string>();
  1731. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1732. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1733. Assert.IsTrue(actual);
  1734. strippingData = new TestStrippingData();
  1735. strippingData.stripUnusedVariants = true;
  1736. strippingData.shaderFeatures = ShaderFeatures.None;
  1737. s_EnabledKeywords = new List<string>();
  1738. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  1739. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1740. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1741. Assert.IsFalse(actual);
  1742. strippingData = new TestStrippingData();
  1743. strippingData.stripUnusedVariants = true;
  1744. strippingData.shaderFeatures = ShaderFeatures.None;
  1745. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1746. s_PassKeywords = new List<string>();
  1747. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1748. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1749. Assert.IsTrue(actual);
  1750. strippingData = new TestStrippingData();
  1751. strippingData.stripUnusedVariants = true;
  1752. strippingData.shaderFeatures = ShaderFeatures.None;
  1753. s_EnabledKeywords = new List<string>();
  1754. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1755. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1756. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1757. Assert.IsFalse(actual);
  1758. strippingData = new TestStrippingData();
  1759. strippingData.stripUnusedVariants = true;
  1760. strippingData.shaderFeatures = ShaderFeatures.None;
  1761. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1762. s_PassKeywords = new List<string>();
  1763. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1764. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1765. Assert.IsTrue(actual);
  1766. strippingData = new TestStrippingData();
  1767. strippingData.stripUnusedVariants = true;
  1768. strippingData.shaderFeatures = ShaderFeatures.None;
  1769. s_EnabledKeywords = new List<string>();
  1770. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1771. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1772. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1773. Assert.IsFalse(actual);
  1774. strippingData = new TestStrippingData();
  1775. strippingData.stripUnusedVariants = true;
  1776. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1777. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1778. s_PassKeywords = new List<string>();
  1779. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1780. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1781. Assert.IsFalse(actual);
  1782. strippingData = new TestStrippingData();
  1783. strippingData.stripUnusedVariants = true;
  1784. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1785. s_EnabledKeywords = new List<string>();
  1786. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1787. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1788. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1789. Assert.IsFalse(actual);
  1790. strippingData = new TestStrippingData();
  1791. strippingData.stripUnusedVariants = true;
  1792. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1793. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1794. s_PassKeywords = new List<string>();
  1795. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1796. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1797. Assert.IsTrue(actual);
  1798. strippingData = new TestStrippingData();
  1799. strippingData.stripUnusedVariants = true;
  1800. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1801. s_EnabledKeywords = new List<string>();
  1802. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1803. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1804. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1805. Assert.IsFalse(actual);
  1806. strippingData = new TestStrippingData();
  1807. strippingData.stripUnusedVariants = true;
  1808. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1809. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1810. s_PassKeywords = new List<string>();
  1811. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1812. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1813. Assert.IsTrue(actual);
  1814. strippingData = new TestStrippingData();
  1815. strippingData.stripUnusedVariants = true;
  1816. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1817. s_EnabledKeywords = new List<string>();
  1818. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1819. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1820. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1821. Assert.IsFalse(actual);
  1822. strippingData = new TestStrippingData();
  1823. strippingData.stripUnusedVariants = true;
  1824. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1825. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  1826. s_PassKeywords = new List<string>();
  1827. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1828. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1829. Assert.IsTrue(actual);
  1830. strippingData = new TestStrippingData();
  1831. strippingData.stripUnusedVariants = true;
  1832. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1833. s_EnabledKeywords = new List<string>();
  1834. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  1835. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1836. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1837. Assert.IsFalse(actual);
  1838. strippingData = new TestStrippingData();
  1839. strippingData.stripUnusedVariants = true;
  1840. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1841. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  1842. s_PassKeywords = new List<string>();
  1843. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1844. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1845. Assert.IsTrue(actual);
  1846. strippingData = new TestStrippingData();
  1847. strippingData.stripUnusedVariants = true;
  1848. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1849. s_EnabledKeywords = new List<string>();
  1850. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  1851. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1852. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1853. Assert.IsFalse(actual);
  1854. strippingData = new TestStrippingData();
  1855. strippingData.stripUnusedVariants = true;
  1856. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1857. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1858. s_PassKeywords = new List<string>();
  1859. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1860. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1861. Assert.IsTrue(actual);
  1862. strippingData = new TestStrippingData();
  1863. strippingData.stripUnusedVariants = true;
  1864. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1865. s_EnabledKeywords = new List<string>();
  1866. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1867. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1868. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1869. Assert.IsFalse(actual);
  1870. strippingData = new TestStrippingData();
  1871. strippingData.stripUnusedVariants = true;
  1872. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1873. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1874. s_PassKeywords = new List<string>();
  1875. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1876. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1877. Assert.IsTrue(actual);
  1878. strippingData = new TestStrippingData();
  1879. strippingData.stripUnusedVariants = true;
  1880. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows;
  1881. s_EnabledKeywords = new List<string>();
  1882. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1883. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1884. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1885. Assert.IsTrue(actual);
  1886. strippingData = new TestStrippingData();
  1887. strippingData.stripUnusedVariants = true;
  1888. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1889. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1890. s_PassKeywords = new List<string>();
  1891. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1892. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1893. Assert.IsTrue(actual);
  1894. strippingData = new TestStrippingData();
  1895. strippingData.stripUnusedVariants = true;
  1896. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1897. s_EnabledKeywords = new List<string>();
  1898. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  1899. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1900. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1901. Assert.IsFalse(actual);
  1902. strippingData = new TestStrippingData();
  1903. strippingData.stripUnusedVariants = true;
  1904. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1905. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1906. s_PassKeywords = new List<string>();
  1907. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1908. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1909. Assert.IsFalse(actual);
  1910. strippingData = new TestStrippingData();
  1911. strippingData.stripUnusedVariants = true;
  1912. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1913. s_EnabledKeywords = new List<string>();
  1914. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  1915. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1916. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1917. Assert.IsFalse(actual);
  1918. strippingData = new TestStrippingData();
  1919. strippingData.stripUnusedVariants = true;
  1920. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1921. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1922. s_PassKeywords = new List<string>();
  1923. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1924. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1925. Assert.IsTrue(actual);
  1926. strippingData = new TestStrippingData();
  1927. strippingData.stripUnusedVariants = true;
  1928. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1929. s_EnabledKeywords = new List<string>();
  1930. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  1931. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1932. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1933. Assert.IsFalse(actual);
  1934. strippingData = new TestStrippingData();
  1935. strippingData.stripUnusedVariants = true;
  1936. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1937. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  1938. s_PassKeywords = new List<string>();
  1939. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1940. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1941. Assert.IsTrue(actual);
  1942. strippingData = new TestStrippingData();
  1943. strippingData.stripUnusedVariants = true;
  1944. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1945. s_EnabledKeywords = new List<string>();
  1946. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  1947. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1948. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1949. Assert.IsFalse(actual);
  1950. strippingData = new TestStrippingData();
  1951. strippingData.stripUnusedVariants = true;
  1952. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1953. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  1954. s_PassKeywords = new List<string>();
  1955. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1956. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1957. Assert.IsTrue(actual);
  1958. strippingData = new TestStrippingData();
  1959. strippingData.stripUnusedVariants = true;
  1960. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1961. s_EnabledKeywords = new List<string>();
  1962. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  1963. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1964. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1965. Assert.IsFalse(actual);
  1966. strippingData = new TestStrippingData();
  1967. strippingData.stripUnusedVariants = true;
  1968. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1969. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1970. s_PassKeywords = new List<string>();
  1971. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1972. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1973. Assert.IsTrue(actual);
  1974. strippingData = new TestStrippingData();
  1975. strippingData.stripUnusedVariants = true;
  1976. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1977. s_EnabledKeywords = new List<string>();
  1978. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1979. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1980. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1981. Assert.IsFalse(actual);
  1982. strippingData = new TestStrippingData();
  1983. strippingData.stripUnusedVariants = true;
  1984. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1985. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1986. s_PassKeywords = new List<string>();
  1987. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1988. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1989. Assert.IsTrue(actual);
  1990. strippingData = new TestStrippingData();
  1991. strippingData.stripUnusedVariants = true;
  1992. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade;
  1993. s_EnabledKeywords = new List<string>();
  1994. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  1995. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  1996. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  1997. Assert.IsTrue(actual);
  1998. strippingData = new TestStrippingData();
  1999. strippingData.stripUnusedVariants = true;
  2000. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  2001. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  2002. s_PassKeywords = new List<string>();
  2003. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2004. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2005. Assert.IsTrue(actual);
  2006. strippingData = new TestStrippingData();
  2007. strippingData.stripUnusedVariants = true;
  2008. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  2009. s_EnabledKeywords = new List<string>();
  2010. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  2011. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2012. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2013. Assert.IsFalse(actual);
  2014. strippingData = new TestStrippingData();
  2015. strippingData.stripUnusedVariants = true;
  2016. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  2017. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  2018. s_PassKeywords = new List<string>();
  2019. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2020. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2021. Assert.IsTrue(actual);
  2022. strippingData = new TestStrippingData();
  2023. strippingData.stripUnusedVariants = true;
  2024. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  2025. s_EnabledKeywords = new List<string>();
  2026. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  2027. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2028. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2029. Assert.IsFalse(actual);
  2030. strippingData = new TestStrippingData();
  2031. strippingData.stripUnusedVariants = true;
  2032. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  2033. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  2034. s_PassKeywords = new List<string>();
  2035. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2036. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2037. Assert.IsFalse(actual);
  2038. strippingData = new TestStrippingData();
  2039. strippingData.stripUnusedVariants = true;
  2040. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  2041. s_EnabledKeywords = new List<string>();
  2042. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  2043. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2044. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2045. Assert.IsFalse(actual);
  2046. strippingData = new TestStrippingData();
  2047. strippingData.stripUnusedVariants = true;
  2048. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  2049. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  2050. s_PassKeywords = new List<string>();
  2051. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2052. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2053. Assert.IsTrue(actual);
  2054. strippingData = new TestStrippingData();
  2055. strippingData.stripUnusedVariants = true;
  2056. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  2057. s_EnabledKeywords = new List<string>();
  2058. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  2059. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2060. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2061. Assert.IsFalse(actual);
  2062. strippingData = new TestStrippingData();
  2063. strippingData.stripUnusedVariants = true;
  2064. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  2065. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  2066. s_PassKeywords = new List<string>();
  2067. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2068. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2069. Assert.IsTrue(actual);
  2070. strippingData = new TestStrippingData();
  2071. strippingData.stripUnusedVariants = true;
  2072. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  2073. s_EnabledKeywords = new List<string>();
  2074. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  2075. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2076. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2077. Assert.IsFalse(actual);
  2078. strippingData = new TestStrippingData();
  2079. strippingData.stripUnusedVariants = true;
  2080. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  2081. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  2082. s_PassKeywords = new List<string>();
  2083. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2084. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2085. Assert.IsTrue(actual);
  2086. strippingData = new TestStrippingData();
  2087. strippingData.stripUnusedVariants = true;
  2088. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  2089. s_EnabledKeywords = new List<string>();
  2090. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  2091. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2092. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2093. Assert.IsFalse(actual);
  2094. strippingData = new TestStrippingData();
  2095. strippingData.stripUnusedVariants = true;
  2096. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  2097. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  2098. s_PassKeywords = new List<string>();
  2099. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2100. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2101. Assert.IsTrue(actual);
  2102. strippingData = new TestStrippingData();
  2103. strippingData.stripUnusedVariants = true;
  2104. strippingData.shaderFeatures = ShaderFeatures.ScreenSpaceShadows;
  2105. s_EnabledKeywords = new List<string>();
  2106. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  2107. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2108. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2109. Assert.IsTrue(actual);
  2110. // Two features enabled
  2111. strippingData = new TestStrippingData();
  2112. strippingData.stripUnusedVariants = true;
  2113. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  2114. s_EnabledKeywords = new List<string>();
  2115. s_PassKeywords = new List<string>();
  2116. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2117. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2118. Assert.IsFalse(actual);
  2119. strippingData = new TestStrippingData();
  2120. strippingData.stripUnusedVariants = true;
  2121. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  2122. s_EnabledKeywords = new List<string>();
  2123. s_PassKeywords = new List<string>();
  2124. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2125. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2126. Assert.IsFalse(actual);
  2127. strippingData = new TestStrippingData();
  2128. strippingData.stripUnusedVariants = true;
  2129. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2130. s_EnabledKeywords = new List<string>();
  2131. s_PassKeywords = new List<string>();
  2132. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2133. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2134. Assert.IsFalse(actual);
  2135. strippingData = new TestStrippingData();
  2136. strippingData.stripUnusedVariants = true;
  2137. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  2138. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  2139. s_PassKeywords = new List<string>();
  2140. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2141. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2142. Assert.IsFalse(actual);
  2143. strippingData = new TestStrippingData();
  2144. strippingData.stripUnusedVariants = true;
  2145. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  2146. s_EnabledKeywords = new List<string>();
  2147. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  2148. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2149. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2150. Assert.IsFalse(actual);
  2151. strippingData = new TestStrippingData();
  2152. strippingData.stripUnusedVariants = true;
  2153. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  2154. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  2155. s_PassKeywords = new List<string>();
  2156. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2157. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2158. Assert.IsFalse(actual);
  2159. strippingData = new TestStrippingData();
  2160. strippingData.stripUnusedVariants = true;
  2161. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  2162. s_EnabledKeywords = new List<string>();
  2163. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  2164. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2165. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2166. Assert.IsFalse(actual);
  2167. strippingData = new TestStrippingData();
  2168. strippingData.stripUnusedVariants = true;
  2169. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2170. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  2171. s_PassKeywords = new List<string>();
  2172. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2173. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2174. Assert.IsTrue(actual);
  2175. strippingData = new TestStrippingData();
  2176. strippingData.stripUnusedVariants = true;
  2177. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2178. s_EnabledKeywords = new List<string>();
  2179. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  2180. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2181. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2182. Assert.IsFalse(actual);
  2183. strippingData = new TestStrippingData();
  2184. strippingData.stripUnusedVariants = true;
  2185. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  2186. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  2187. s_PassKeywords = new List<string>();
  2188. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2189. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2190. Assert.IsFalse(actual);
  2191. strippingData = new TestStrippingData();
  2192. strippingData.stripUnusedVariants = true;
  2193. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  2194. s_EnabledKeywords = new List<string>();
  2195. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  2196. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2197. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2198. Assert.IsFalse(actual);
  2199. strippingData = new TestStrippingData();
  2200. strippingData.stripUnusedVariants = true;
  2201. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  2202. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  2203. s_PassKeywords = new List<string>();
  2204. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2205. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2206. Assert.IsTrue(actual);
  2207. strippingData = new TestStrippingData();
  2208. strippingData.stripUnusedVariants = true;
  2209. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  2210. s_EnabledKeywords = new List<string>();
  2211. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  2212. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2213. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2214. Assert.IsFalse(actual);
  2215. strippingData = new TestStrippingData();
  2216. strippingData.stripUnusedVariants = true;
  2217. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2218. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  2219. s_PassKeywords = new List<string>();
  2220. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2221. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2222. Assert.IsFalse(actual);
  2223. strippingData = new TestStrippingData();
  2224. strippingData.stripUnusedVariants = true;
  2225. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2226. s_EnabledKeywords = new List<string>();
  2227. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  2228. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2229. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2230. Assert.IsFalse(actual);
  2231. strippingData = new TestStrippingData();
  2232. strippingData.stripUnusedVariants = true;
  2233. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  2234. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  2235. s_PassKeywords = new List<string>();
  2236. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2237. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2238. Assert.IsTrue(actual);
  2239. strippingData = new TestStrippingData();
  2240. strippingData.stripUnusedVariants = true;
  2241. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade;
  2242. s_EnabledKeywords = new List<string>();
  2243. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  2244. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2245. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2246. Assert.IsFalse(actual);
  2247. strippingData = new TestStrippingData();
  2248. strippingData.stripUnusedVariants = true;
  2249. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  2250. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  2251. s_PassKeywords = new List<string>();
  2252. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2253. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2254. Assert.IsFalse(actual);
  2255. strippingData = new TestStrippingData();
  2256. strippingData.stripUnusedVariants = true;
  2257. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.ScreenSpaceShadows;
  2258. s_EnabledKeywords = new List<string>();
  2259. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  2260. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2261. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2262. Assert.IsFalse(actual);
  2263. strippingData = new TestStrippingData();
  2264. strippingData.stripUnusedVariants = true;
  2265. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2266. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  2267. s_PassKeywords = new List<string>();
  2268. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2269. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2270. Assert.IsFalse(actual);
  2271. strippingData = new TestStrippingData();
  2272. strippingData.stripUnusedVariants = true;
  2273. strippingData.shaderFeatures = ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2274. s_EnabledKeywords = new List<string>();
  2275. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  2276. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2277. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2278. Assert.IsFalse(actual);
  2279. // All features enabled
  2280. strippingData = new TestStrippingData();
  2281. strippingData.stripUnusedVariants = true;
  2282. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2283. s_EnabledKeywords = new List<string>();
  2284. s_PassKeywords = new List<string>();
  2285. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2286. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2287. Assert.IsFalse(actual);
  2288. strippingData = new TestStrippingData();
  2289. strippingData.stripUnusedVariants = true;
  2290. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2291. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  2292. s_PassKeywords = new List<string>();
  2293. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2294. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2295. Assert.IsFalse(actual);
  2296. strippingData = new TestStrippingData();
  2297. strippingData.stripUnusedVariants = true;
  2298. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2299. s_EnabledKeywords = new List<string>();
  2300. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows };
  2301. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2302. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2303. Assert.IsFalse(actual);
  2304. strippingData = new TestStrippingData();
  2305. strippingData.stripUnusedVariants = true;
  2306. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2307. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  2308. s_PassKeywords = new List<string>();
  2309. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2310. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2311. Assert.IsFalse(actual);
  2312. strippingData = new TestStrippingData();
  2313. strippingData.stripUnusedVariants = true;
  2314. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2315. s_EnabledKeywords = new List<string>();
  2316. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades };
  2317. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2318. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2319. Assert.IsFalse(actual);
  2320. strippingData = new TestStrippingData();
  2321. strippingData.stripUnusedVariants = true;
  2322. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2323. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  2324. s_PassKeywords = new List<string>();
  2325. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2326. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2327. Assert.IsFalse(actual);
  2328. strippingData = new TestStrippingData();
  2329. strippingData.stripUnusedVariants = true;
  2330. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2331. s_EnabledKeywords = new List<string>();
  2332. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowScreen };
  2333. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2334. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2335. Assert.IsFalse(actual);
  2336. strippingData = new TestStrippingData();
  2337. strippingData.stripUnusedVariants = true;
  2338. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2339. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  2340. s_PassKeywords = new List<string>();
  2341. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2342. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2343. Assert.IsFalse(actual);
  2344. strippingData = new TestStrippingData();
  2345. strippingData.stripUnusedVariants = true;
  2346. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2347. s_EnabledKeywords = new List<string>();
  2348. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowCascades };
  2349. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2350. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2351. Assert.IsFalse(actual);
  2352. strippingData = new TestStrippingData();
  2353. strippingData.stripUnusedVariants = true;
  2354. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2355. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  2356. s_PassKeywords = new List<string>();
  2357. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2358. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2359. Assert.IsFalse(actual);
  2360. strippingData = new TestStrippingData();
  2361. strippingData.stripUnusedVariants = true;
  2362. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2363. s_EnabledKeywords = new List<string>();
  2364. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadows, ShaderKeywordStrings.MainLightShadowScreen };
  2365. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2366. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2367. Assert.IsFalse(actual);
  2368. strippingData = new TestStrippingData();
  2369. strippingData.stripUnusedVariants = true;
  2370. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2371. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  2372. s_PassKeywords = new List<string>();
  2373. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2374. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2375. Assert.IsFalse(actual);
  2376. strippingData = new TestStrippingData();
  2377. strippingData.stripUnusedVariants = true;
  2378. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2379. s_EnabledKeywords = new List<string>();
  2380. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  2381. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2382. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2383. Assert.IsFalse(actual);
  2384. strippingData = new TestStrippingData();
  2385. strippingData.stripUnusedVariants = true;
  2386. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2387. s_EnabledKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  2388. s_PassKeywords = new List<string>();
  2389. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2390. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2391. Assert.IsFalse(actual);
  2392. strippingData = new TestStrippingData();
  2393. strippingData.stripUnusedVariants = true;
  2394. strippingData.shaderFeatures = ShaderFeatures.MainLightShadows | ShaderFeatures.MainLightShadowsCascade | ShaderFeatures.ScreenSpaceShadows;
  2395. s_EnabledKeywords = new List<string>();
  2396. s_PassKeywords = new List<string>() { ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowCascades, ShaderKeywordStrings.MainLightShadowScreen };
  2397. stripTool = new ShaderStripTool<ShaderFeatures>(strippingData.shaderFeatures, ref strippingData);
  2398. actual = stripTool.StripMultiCompile(kw1, ShaderFeatures.MainLightShadows, kw2, ShaderFeatures.MainLightShadowsCascade, kw3, ShaderFeatures.ScreenSpaceShadows);
  2399. Assert.IsFalse(actual);
  2400. }
  2401. }
  2402. }