VFXData.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using UnityEngine;
  6. using UnityEditor.VFX;
  7. using UnityEngine.VFX;
  8. namespace UnityEditor.VFX
  9. {
  10. // TODO Move this
  11. // Must match enum in C++
  12. enum VFXCoordinateSpace
  13. {
  14. Local = 0,
  15. World = 1,
  16. }
  17. // TODO Move this
  18. interface ISpaceable
  19. {
  20. VFXCoordinateSpace space { get; set; }
  21. }
  22. abstract class VFXData : VFXModel
  23. {
  24. public abstract VFXDataType type { get; }
  25. public virtual uint staticSourceCount
  26. {
  27. get
  28. {
  29. return 0u;
  30. }
  31. }
  32. public IEnumerable<VFXContext> owners
  33. {
  34. get { return m_Owners; }
  35. }
  36. public IEnumerable<VFXContext> compilableOwners
  37. {
  38. get { return owners.Where(o => o.CanBeCompiled()); }
  39. }
  40. public string title;
  41. public virtual IEnumerable<string> additionalHeaders
  42. {
  43. get { return Enumerable.Empty<string>(); }
  44. }
  45. public static VFXData CreateDataType(VFXGraph graph, VFXDataType type)
  46. {
  47. VFXData newVFXData;
  48. switch (type)
  49. {
  50. case VFXDataType.Particle:
  51. case VFXDataType.ParticleStrip:
  52. newVFXData = ScriptableObject.CreateInstance<VFXDataParticle>();
  53. break;
  54. case VFXDataType.Mesh:
  55. newVFXData = ScriptableObject.CreateInstance<VFXDataMesh>();
  56. break;
  57. case VFXDataType.SpawnEvent:
  58. newVFXData = ScriptableObject.CreateInstance<VFXDataSpawner>();
  59. break;
  60. case VFXDataType.OutputEvent:
  61. newVFXData = ScriptableObject.CreateInstance<VFXDataOutputEvent>();
  62. break;
  63. default: return null;
  64. }
  65. newVFXData.m_Parent = graph;
  66. return newVFXData;
  67. }
  68. public override void OnEnable()
  69. {
  70. base.OnEnable();
  71. if (m_Owners == null)
  72. m_Owners = new List<VFXContext>();
  73. else
  74. {
  75. // Remove bad references if any
  76. // The code below was replaced because it caused some strange crashes for unknown reasons
  77. //int nbRemoved = m_Owners.RemoveAll(o => o == null);
  78. int nbRemoved = 0;
  79. for (int i = 0; i < m_Owners.Count; ++i)
  80. if (m_Owners[i] == null)
  81. {
  82. m_Owners.RemoveAt(i--);
  83. ++nbRemoved;
  84. }
  85. if (nbRemoved > 0)
  86. Debug.LogWarning(String.Format("Remove {0} owners that couldnt be deserialized from {1} of type {2}", nbRemoved, name, GetType()));
  87. }
  88. }
  89. protected internal override void Invalidate(VFXModel model, InvalidationCause cause)
  90. {
  91. base.Invalidate(model, cause);
  92. if (cause == InvalidationCause.kSettingChanged) // As data settings are supposed to be implicitely context settings at the same time, throw an invalidate for each contexts
  93. foreach (VFXContext owner in owners)
  94. owner.Invalidate(owner, cause);
  95. }
  96. public override void Sanitize(int version)
  97. {
  98. base.Sanitize(version);
  99. if (m_Parent == null)
  100. {
  101. string assetPath = AssetDatabase.GetAssetPath(this);
  102. m_Parent = VisualEffectResource.GetResourceAtPath(assetPath).GetOrCreateGraph();
  103. }
  104. }
  105. public abstract void CopySettings<T>(T dst) where T : VFXData;
  106. public virtual bool CanBeCompiled()
  107. {
  108. return true;
  109. }
  110. public virtual void FillDescs(
  111. VFXCompileErrorReporter reporter,
  112. List<VFXGPUBufferDesc> outBufferDescs,
  113. List<VFXTemporaryGPUBufferDesc> outTemporaryBufferDescs,
  114. List<VFXEditorSystemDesc> outSystemDescs,
  115. VFXExpressionGraph expressionGraph,
  116. Dictionary<VFXContext, VFXContextCompiledData> contextToCompiledData,
  117. Dictionary<VFXContext, int> contextSpawnToBufferIndex,
  118. VFXDependentBuffersData dependentBuffers,
  119. Dictionary<VFXContext, List<VFXContextLink>[]> effectiveFlowInputLinks,
  120. VFXSystemNames systemNames = null)
  121. {
  122. // Empty implementation by default
  123. }
  124. // Never call this directly ! Only context must call this through SetData
  125. public void OnContextAdded(VFXContext context)
  126. {
  127. if (context == null)
  128. throw new ArgumentNullException();
  129. if (m_Owners.Contains(context))
  130. throw new ArgumentException(string.Format("{0} is already in the owner list of {1}", context, this));
  131. m_Owners.Add(context);
  132. }
  133. // Never call this directly ! Only context must call this through SetData
  134. public void OnContextRemoved(VFXContext context)
  135. {
  136. if (!m_Owners.Remove(context))
  137. throw new ArgumentException(string.Format("{0} is not in the owner list of {1}", context, this));
  138. }
  139. public bool IsCurrentAttributeRead(VFXAttribute attrib) { return (GetAttributeMode(attrib) & VFXAttributeMode.Read) != 0; }
  140. public bool IsCurrentAttributeWritten(VFXAttribute attrib) { return (GetAttributeMode(attrib) & VFXAttributeMode.Write) != 0; }
  141. public bool IsCurrentAttributeRead(VFXAttribute attrib, VFXContext context) { return (GetAttributeMode(attrib, context) & VFXAttributeMode.Read) != 0; }
  142. public bool IsCurrentAttributeWritten(VFXAttribute attrib, VFXContext context) { return (GetAttributeMode(attrib, context) & VFXAttributeMode.Write) != 0; }
  143. public bool IsAttributeUsed(VFXAttribute attrib) { return GetAttributeMode(attrib) != VFXAttributeMode.None; }
  144. public bool IsAttributeUsed(VFXAttribute attrib, VFXContext context) { return GetAttributeMode(attrib, context) != VFXAttributeMode.None; }
  145. public bool IsCurrentAttributeUsed(VFXAttribute attrib) { return (GetAttributeMode(attrib) & VFXAttributeMode.ReadWrite) != 0; }
  146. public bool IsCurrentAttributeUsed(VFXAttribute attrib, VFXContext context) { return (GetAttributeMode(attrib, context) & VFXAttributeMode.ReadWrite) != 0; }
  147. public bool IsSourceAttributeUsed(VFXAttribute attrib) { return (GetAttributeMode(attrib) & VFXAttributeMode.ReadSource) != 0; }
  148. public bool IsSourceAttributeUsed(VFXAttribute attrib, VFXContext context) { return (GetAttributeMode(attrib, context) & VFXAttributeMode.ReadSource) != 0; }
  149. public bool IsAttributeLocal(VFXAttribute attrib) { return m_LocalCurrentAttributes.Contains(attrib); }
  150. public bool IsAttributeStored(VFXAttribute attrib) { return m_StoredCurrentAttributes.ContainsKey(attrib); }
  151. public VFXAttributeMode GetAttributeMode(VFXAttribute attrib, VFXContext context)
  152. {
  153. Dictionary<VFXContext, VFXAttributeMode> contexts;
  154. if (m_AttributesToContexts.TryGetValue(attrib, out contexts))
  155. {
  156. foreach (var c in contexts)
  157. if (c.Key == context)
  158. return c.Value;
  159. }
  160. return VFXAttributeMode.None;
  161. }
  162. public VFXAttributeMode GetAttributeMode(VFXAttribute attrib)
  163. {
  164. VFXAttributeMode mode = VFXAttributeMode.None;
  165. Dictionary<VFXContext, VFXAttributeMode> contexts;
  166. if (m_AttributesToContexts.TryGetValue(attrib, out contexts))
  167. {
  168. foreach (var context in contexts)
  169. mode |= context.Value;
  170. }
  171. return mode;
  172. }
  173. public int GetNbAttributes()
  174. {
  175. return m_AttributesToContexts.Count;
  176. }
  177. public IEnumerable<VFXAttributeInfo> GetAttributes()
  178. {
  179. foreach (var attrib in m_AttributesToContexts)
  180. {
  181. VFXAttributeInfo info;
  182. info.attrib = attrib.Key;
  183. info.mode = VFXAttributeMode.None;
  184. foreach (var context in attrib.Value)
  185. info.mode |= context.Value;
  186. yield return info;
  187. }
  188. }
  189. public IEnumerable<VFXAttributeInfo> GetAttributesForContext(VFXContext context)
  190. {
  191. Dictionary<VFXAttribute, VFXAttributeMode> attribs;
  192. if (m_ContextsToAttributes.TryGetValue(context, out attribs))
  193. {
  194. foreach (var attrib in attribs)
  195. {
  196. VFXAttributeInfo info;
  197. info.attrib = attrib.Key;
  198. info.mode = attrib.Value;
  199. yield return info;
  200. }
  201. }
  202. else
  203. throw new ArgumentException("Context does not exist");
  204. }
  205. private struct VFXAttributeInfoContext
  206. {
  207. public VFXAttributeInfo[] attributes;
  208. public VFXContext context;
  209. }
  210. public abstract VFXDeviceTarget GetCompilationTarget(VFXContext context);
  211. // Create implicit contexts and initialize cached contexts list
  212. public virtual IEnumerable<VFXContext> InitImplicitContexts()
  213. {
  214. m_Contexts = compilableOwners.ToList();
  215. return Enumerable.Empty<VFXContext>();
  216. }
  217. public void CollectAttributes()
  218. {
  219. if (m_Contexts == null) // Context hasnt been initialized (may happen in unity tests but not during actual compilation)
  220. InitImplicitContexts();
  221. var allDepenciesIn =
  222. m_Contexts.Where(c => c.contextType == VFXContextType.Init)
  223. .SelectMany(c => c.inputContexts.Where(i => i.contextType == VFXContextType.SpawnerGPU))
  224. .SelectMany(c => c.allLinkedInputSlot)
  225. .Where(s =>
  226. {
  227. if (s.owner is VFXBlock)
  228. {
  229. VFXBlock block = (VFXBlock)(s.owner);
  230. if (block.enabled)
  231. return true;
  232. }
  233. else if (s.owner is VFXContext)
  234. {
  235. return true;
  236. }
  237. return false;
  238. })
  239. .Select(s => ((VFXModel)s.owner).GetFirstOfType<VFXContext>())
  240. .Select(c => c.GetData());
  241. m_DependenciesIn = new HashSet<VFXData>(allDepenciesIn.Where(c => c.CanBeCompiled()));
  242. m_DependenciesInNotCompilable = new HashSet<VFXData>(allDepenciesIn.Where(c => !c.CanBeCompiled()));
  243. var allDependenciesOut =
  244. owners.SelectMany(o => o.allLinkedOutputSlot)
  245. .Select(s => (VFXContext)s.owner)
  246. .SelectMany(c => c.outputContexts)
  247. .Select(c => c.GetData());
  248. m_DependenciesOut = new HashSet<VFXData>(allDependenciesOut.Where(c => c.CanBeCompiled()));
  249. m_DependenciesOutNotCompilable = new HashSet<VFXData>(allDependenciesOut.Where(c => !c.CanBeCompiled()));
  250. m_ContextsToAttributes.Clear();
  251. m_AttributesToContexts.Clear();
  252. var processedExp = new HashSet<VFXExpression>();
  253. bool changed = true;
  254. int count = 0;
  255. while (changed)
  256. {
  257. ++count;
  258. var attributeContexts = new List<VFXAttributeInfoContext>();
  259. foreach (var context in m_Contexts)
  260. {
  261. processedExp.Clear();
  262. var attributes = Enumerable.Empty<VFXAttributeInfo>();
  263. attributes = attributes.Concat(context.attributes);
  264. foreach (var block in context.activeFlattenedChildrenWithImplicit)
  265. attributes = attributes.Concat(block.attributes);
  266. var mapper = context.GetExpressionMapper(GetCompilationTarget(context));
  267. if (mapper != null)
  268. foreach (var exp in mapper.expressions)
  269. attributes = attributes.Concat(CollectInputAttributes(exp, processedExp));
  270. attributeContexts.Add(new VFXAttributeInfoContext
  271. {
  272. attributes = attributes.ToArray(),
  273. context = context
  274. });
  275. }
  276. changed = false;
  277. foreach (var context in attributeContexts)
  278. {
  279. foreach (var attribute in context.attributes)
  280. {
  281. if (AddAttribute(context.context, attribute))
  282. {
  283. changed = true;
  284. }
  285. }
  286. }
  287. }
  288. ProcessAttributes();
  289. //TMP Debug only
  290. DebugLogAttributes();
  291. }
  292. public void ProcessDependencies()
  293. {
  294. ComputeLayer();
  295. // Update attributes
  296. foreach (var childData in m_DependenciesOut)
  297. {
  298. foreach (var attrib in childData.m_ReadSourceAttributes)
  299. {
  300. if (!m_StoredCurrentAttributes.ContainsKey(attrib))
  301. {
  302. m_LocalCurrentAttributes.Remove(attrib);
  303. m_StoredCurrentAttributes.Add(attrib, 0);
  304. }
  305. }
  306. }
  307. }
  308. private static uint ComputeLayer(IEnumerable<VFXData> dependenciesIn)
  309. {
  310. if (dependenciesIn.Any())
  311. {
  312. return 1u + ComputeLayer(dependenciesIn.SelectMany(o => o.m_DependenciesIn));
  313. }
  314. return 0u;
  315. }
  316. private void ComputeLayer()
  317. {
  318. if (!m_DependenciesIn.Any() && !m_DependenciesOut.Any())
  319. {
  320. m_Layer = 0; //Independent system, choose layer 0 anyway.
  321. }
  322. else
  323. {
  324. m_Layer = ComputeLayer(m_DependenciesIn);
  325. }
  326. }
  327. protected bool HasImplicitInit(VFXAttribute attrib)
  328. {
  329. return attrib.Equals(VFXAttribute.Seed)
  330. || attrib.Equals(VFXAttribute.ParticleId)
  331. || attrib.Equals(VFXAttribute.SpawnIndex)
  332. || attrib.Equals(VFXAttribute.SpawnIndexInStrip);
  333. }
  334. private void ProcessAttributes()
  335. {
  336. m_StoredCurrentAttributes.Clear();
  337. m_LocalCurrentAttributes.Clear();
  338. m_ReadSourceAttributes.Clear();
  339. int contextCount = m_Contexts.Count;
  340. if (contextCount > 16)
  341. throw new InvalidOperationException(string.Format("Too many contexts that use particle data {0} > 16", contextCount));
  342. foreach (var kvp in m_AttributesToContexts)
  343. {
  344. bool local = false;
  345. var attribute = kvp.Key;
  346. int key = 0;
  347. bool onlyInit = true;
  348. bool onlyOutput = true;
  349. bool onlyUpdateRead = true;
  350. bool onlyUpdateWrite = true;
  351. bool needsSpecialInit = HasImplicitInit(attribute);
  352. bool writtenInInit = needsSpecialInit;
  353. bool readSourceInInit = false;
  354. foreach (var kvp2 in kvp.Value)
  355. {
  356. var context = kvp2.Key;
  357. if (context.contextType == VFXContextType.Init
  358. && (kvp2.Value & VFXAttributeMode.ReadSource) != 0)
  359. {
  360. readSourceInInit = true;
  361. }
  362. if (kvp2.Value == VFXAttributeMode.None)
  363. {
  364. throw new InvalidOperationException("Unexpected attribute mode : " + attribute);
  365. }
  366. if (kvp2.Value == VFXAttributeMode.ReadSource)
  367. {
  368. continue;
  369. }
  370. if (context.contextType != VFXContextType.Init)
  371. onlyInit = false;
  372. if (context.contextType != VFXContextType.Output && context.contextType != VFXContextType.Filter)
  373. onlyOutput = false;
  374. if (context.contextType != VFXContextType.Update)
  375. {
  376. onlyUpdateRead = false;
  377. onlyUpdateWrite = false;
  378. }
  379. else
  380. {
  381. if ((kvp2.Value & VFXAttributeMode.Read) != 0)
  382. onlyUpdateWrite = false;
  383. if ((kvp2.Value & VFXAttributeMode.Write) != 0)
  384. onlyUpdateRead = false;
  385. }
  386. if (context.contextType != VFXContextType.Init) // Init isnt taken into account for key computation
  387. {
  388. int shift = m_Contexts.IndexOf(context) << 1;
  389. int value = 0;
  390. if ((kvp2.Value & VFXAttributeMode.Read) != 0)
  391. value |= 0x01;
  392. if (((kvp2.Value & VFXAttributeMode.Write) != 0) && context.contextType == VFXContextType.Update)
  393. value |= 0x02;
  394. key |= (value << shift);
  395. }
  396. else if ((kvp2.Value & VFXAttributeMode.Write) != 0)
  397. writtenInInit = true;
  398. }
  399. if ((key & ~0xAAAAAAAA) == 0) // no read
  400. local = true;
  401. if (onlyUpdateWrite || onlyInit || (!needsSpecialInit && (onlyUpdateRead || onlyOutput))) // no shared atributes
  402. local = true;
  403. if (!writtenInInit && (key & 0xAAAAAAAA) == 0) // no write mask
  404. local = true;
  405. if (VFXAttribute.AllAttributeLocalOnly.Contains(attribute))
  406. local = true;
  407. if (local)
  408. m_LocalCurrentAttributes.Add(attribute);
  409. else
  410. m_StoredCurrentAttributes.Add(attribute, key);
  411. if (readSourceInInit)
  412. m_ReadSourceAttributes.Add(attribute);
  413. }
  414. }
  415. public abstract void GenerateAttributeLayout(Dictionary<VFXContext, List<VFXContextLink>[]> effectiveFlowInputLinks);
  416. public abstract string GetAttributeDataDeclaration(VFXAttributeMode mode);
  417. public abstract string GetLoadAttributeCode(VFXAttribute attrib, VFXAttributeLocation location);
  418. public abstract string GetStoreAttributeCode(VFXAttribute attrib, string value);
  419. private bool AddAttribute(VFXContext context, VFXAttributeInfo attribInfo)
  420. {
  421. if (attribInfo.mode == VFXAttributeMode.None)
  422. throw new ArgumentException("Cannot add an attribute without mode");
  423. Dictionary<VFXAttribute, VFXAttributeMode> attribs;
  424. if (!m_ContextsToAttributes.TryGetValue(context, out attribs))
  425. {
  426. attribs = new Dictionary<VFXAttribute, VFXAttributeMode>();
  427. m_ContextsToAttributes.Add(context, attribs);
  428. }
  429. var attrib = attribInfo.attrib;
  430. var mode = attribInfo.mode;
  431. bool hasChanged = false;
  432. if (attribs.ContainsKey(attrib))
  433. {
  434. var oldMode = attribs[attrib];
  435. mode |= attribs[attrib];
  436. if (mode != oldMode)
  437. {
  438. attribs[attrib] = mode;
  439. hasChanged = true;
  440. }
  441. }
  442. else
  443. {
  444. attribs[attrib] = mode;
  445. hasChanged = true;
  446. }
  447. if (hasChanged)
  448. {
  449. Dictionary<VFXContext, VFXAttributeMode> contexts;
  450. if (!m_AttributesToContexts.TryGetValue(attrib, out contexts))
  451. {
  452. contexts = new Dictionary<VFXContext, VFXAttributeMode>();
  453. m_AttributesToContexts.Add(attrib, contexts);
  454. }
  455. contexts[context] = mode;
  456. }
  457. return hasChanged;
  458. }
  459. // Collect attribute expressions recursively
  460. private IEnumerable<VFXAttributeInfo> CollectInputAttributes(VFXExpression exp, HashSet<VFXExpression> processed)
  461. {
  462. if (!processed.Contains(exp) && exp.Is(VFXExpression.Flags.PerElement)) // Testing per element allows to early out as it is propagated
  463. {
  464. processed.Add(exp);
  465. foreach (var info in exp.GetNeededAttributes())
  466. yield return info;
  467. foreach (var parent in exp.parents)
  468. {
  469. foreach (var info in CollectInputAttributes(parent, processed))
  470. yield return info;
  471. }
  472. }
  473. }
  474. private void DebugLogAttributes()
  475. {
  476. if (!VFXViewPreference.advancedLogs)
  477. return;
  478. var builder = new StringBuilder();
  479. builder.AppendLine(string.Format("Attributes for data {0} of type {1}", GetHashCode(), GetType()));
  480. foreach (var context in m_Contexts)
  481. {
  482. Dictionary<VFXAttribute, VFXAttributeMode> attributeInfos;
  483. if (m_ContextsToAttributes.TryGetValue(context, out attributeInfos))
  484. {
  485. builder.AppendLine(string.Format("\tContext {1} {0}", context.GetHashCode(), context.contextType));
  486. foreach (var kvp in attributeInfos)
  487. builder.AppendLine(string.Format("\t\tAttribute {0} {1} {2}", kvp.Key.name, kvp.Key.type, kvp.Value));
  488. }
  489. }
  490. if (m_StoredCurrentAttributes.Count > 0)
  491. {
  492. builder.AppendLine("--- STORED CURRENT ATTRIBUTES ---");
  493. foreach (var kvp in m_StoredCurrentAttributes)
  494. builder.AppendLine(string.Format("\t\tAttribute {0} {1} {2}", kvp.Key.name, kvp.Key.type, kvp.Value));
  495. }
  496. if (m_AttributesToContexts.Count > 0)
  497. {
  498. builder.AppendLine("--- LOCAL CURRENT ATTRIBUTES ---");
  499. foreach (var attrib in m_LocalCurrentAttributes)
  500. builder.AppendLine(string.Format("\t\tAttribute {0} {1}", attrib.name, attrib.type));
  501. }
  502. Debug.Log(builder.ToString());
  503. }
  504. public uint layer
  505. {
  506. get
  507. {
  508. return m_Layer;
  509. }
  510. }
  511. //Doesn't include not comilable context
  512. public IEnumerable<VFXData> dependenciesIn
  513. {
  514. get
  515. {
  516. return m_DependenciesIn;
  517. }
  518. }
  519. public IEnumerable<VFXData> dependenciesOut
  520. {
  521. get
  522. {
  523. return m_DependenciesOut;
  524. }
  525. }
  526. public IEnumerable<VFXData> allDependenciesIncludingNotCompilable
  527. {
  528. get
  529. {
  530. var all = Enumerable.Empty<VFXData>();
  531. all = all.Concat(m_DependenciesIn);
  532. all = all.Concat(m_DependenciesOut);
  533. all = all.Concat(m_DependenciesInNotCompilable);
  534. all = all.Concat(m_DependenciesOutNotCompilable);
  535. return all;
  536. }
  537. }
  538. [SerializeField]
  539. protected List<VFXContext> m_Owners;
  540. [NonSerialized]
  541. protected List<VFXContext> m_Contexts;
  542. [NonSerialized]
  543. protected Dictionary<VFXContext, Dictionary<VFXAttribute, VFXAttributeMode>> m_ContextsToAttributes = new Dictionary<VFXContext, Dictionary<VFXAttribute, VFXAttributeMode>>();
  544. [NonSerialized]
  545. protected Dictionary<VFXAttribute, Dictionary<VFXContext, VFXAttributeMode>> m_AttributesToContexts = new Dictionary<VFXAttribute, Dictionary<VFXContext, VFXAttributeMode>>();
  546. [NonSerialized]
  547. protected Dictionary<VFXAttribute, int> m_StoredCurrentAttributes = new Dictionary<VFXAttribute, int>();
  548. [NonSerialized]
  549. protected HashSet<VFXAttribute> m_LocalCurrentAttributes = new HashSet<VFXAttribute>();
  550. [NonSerialized]
  551. protected HashSet<VFXAttribute> m_ReadSourceAttributes = new HashSet<VFXAttribute>();
  552. [NonSerialized]
  553. protected HashSet<VFXData> m_DependenciesIn = new HashSet<VFXData>();
  554. [NonSerialized]
  555. protected HashSet<VFXData> m_DependenciesInNotCompilable = new HashSet<VFXData>();
  556. [NonSerialized]
  557. protected HashSet<VFXData> m_DependenciesOut = new HashSet<VFXData>();
  558. [NonSerialized]
  559. protected HashSet<VFXData> m_DependenciesOutNotCompilable = new HashSet<VFXData>();
  560. [NonSerialized]
  561. protected uint m_Layer;
  562. }
  563. }