Skip to content

Commit 0758f7c

Browse files
[VFX] 7.4 fixes backports (#499)
1 parent 0be932d commit 0758f7c

File tree

245 files changed

+9242
-8982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+9242
-8982
lines changed

TestProjects/VisualEffectGraph/Assets/AllTests/Editor/Tests/VFXComponentTest.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public IEnumerator CreateComponent_And_Graph_Modify_It_To_Generate_Expected_Exce
231231
var graph = CreateGraph_And_System();
232232

233233
yield return null;
234-
234+
235235
while (m_mainObject.GetComponent<VisualEffect>() != null)
236236
{
237237
UnityEngine.Object.DestroyImmediate(m_mainObject.GetComponent<VisualEffect>());
@@ -241,14 +241,14 @@ public IEnumerator CreateComponent_And_Graph_Modify_It_To_Generate_Expected_Exce
241241
Assert.DoesNotThrow(() => VisualEffectUtility.GetSpawnerState(vfxComponent, 0));
242242

243243
yield return null;
244-
244+
245245
//Plug a GPU instruction on bounds, excepting an exception while recompiling
246246
var getPositionDesc = VFXLibrary.GetOperators().FirstOrDefault(o => o.modelType == typeof(VFXAttributeParameter) && o.name.Contains(VFXAttribute.Position.name));
247247
var getPosition = getPositionDesc.CreateInstance();
248248
graph.AddChild(getPosition);
249249
var initializeContext = graph.children.OfType<VFXBasicInitialize>().FirstOrDefault();
250250
Assert.AreEqual(VFXValueType.Float3, initializeContext.inputSlots[0][0].valueType);
251-
251+
252252
getPosition.outputSlots[0].Link(initializeContext.inputSlots[0][0]);
253253

254254
//LogAssert.Expect(LogType.Error, new System.Text.RegularExpressions.Regex("Exception while compiling expression graph:*")); < Incorrect with our katana configuration
@@ -312,9 +312,9 @@ public IEnumerator CreateComponent_And_VerifyRenderBounds()
312312
vfx.visualEffectAsset = asset;
313313

314314
int maxFrame = 512;
315-
while (( vfx.culled
315+
while ((vfx.culled
316316
|| currentObject.GetComponent<VFXRenderer>().bounds.extents.x == 0.0f)
317-
&& --maxFrame > 0)
317+
&& --maxFrame > 0)
318318
{
319319
yield return null;
320320
}

TestProjects/VisualEffectGraph/Assets/AllTests/Editor/Tests/VFXControllerTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ public void UndoRedoChangeSpace()
346346
Undo.PerformUndo(); //Should go back to local
347347
Assert.AreEqual((inlineOperatorController.model as VFXInlineOperator).inputSlots[0].space, VFXCoordinateSpace.Local);
348348
Assert.AreEqual((inlineOperatorController.model as VFXInlineOperator).inputSlots[0].GetSpaceTransformationType(), SpaceableType.Position);
349-
350349
}
351350

352351
[Test]

TestProjects/VisualEffectGraph/Assets/AllTests/Editor/Tests/VFXConverterTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ public void FailingConvertTest([ValueSource("failingConversions")] Conversion co
184184
LogAssert.Expect(LogType.Error, string.Format("Cannot cast from {0} to {1}", conversion.value.GetType(), conversion.targetType));
185185
Assert.IsNull(VFXConverter.ConvertTo(conversion.value, conversion.targetType));
186186
}
187+
187188
#endif
188189

189190
[Test]

TestProjects/VisualEffectGraph/Assets/AllTests/Editor/Tests/VFXCopyPastGlobalTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ public override string ToString()
6060

6161
private static CutBefore[] cutBeforeSource = new CutBefore[]
6262
{
63-
new CutBefore() { taskType = VFXTaskType.Spawner },
64-
new CutBefore() { taskType = VFXTaskType.Initialize },
65-
new CutBefore() { taskType = VFXTaskType.Update },
66-
new CutBefore() { taskType = VFXTaskType.Output },
63+
new CutBefore() { taskType = VFXTaskType.Spawner },
64+
new CutBefore() { taskType = VFXTaskType.Initialize },
65+
new CutBefore() { taskType = VFXTaskType.Update },
66+
new CutBefore() { taskType = VFXTaskType.Output },
6767
};
6868
[UnityTest]
6969
public IEnumerator CopyPast_Context_And_Relink([ValueSource("cutBeforeSource")] CutBefore cutBeforeEncapsultor)

TestProjects/VisualEffectGraph/Assets/AllTests/Editor/Tests/VFXCopyPasteTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public void CopyPasteSpacableOperator()
195195
var inlineOperatorDesc = VFXLibrary.GetOperators().Where(t => t.modelType == typeof(VFXInlineOperator)).First();
196196

197197
var newOperator = m_ViewController.AddVFXOperator(new Vector2(100, 100), inlineOperatorDesc);
198-
newOperator.SetSettingValue("m_Type",new SerializableType(typeof(DirectionType)));
198+
newOperator.SetSettingValue("m_Type", new SerializableType(typeof(DirectionType)));
199199

200200
m_ViewController.ApplyChanges();
201201
var operatorController = m_ViewController.allChildren.OfType<VFXOperatorController>().First();

TestProjects/VisualEffectGraph/Assets/AllTests/Editor/Tests/VFXDataTests.cs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !UNITY_EDITOR_OSX || MAC_FORCE_TESTS
1+
#if !UNITY_EDITOR_OSX || MAC_FORCE_TESTS
22
using System;
33
using NUnit.Framework;
44
using UnityEngine;
@@ -161,6 +161,34 @@ public void CheckAttributes()
161161
Assert.IsFalse(data.IsCurrentAttributeWritten(attrib3));
162162
Assert.IsTrue(data.IsCurrentAttributeWritten(attrib4));
163163
}
164+
165+
[Test]
166+
public void CheckCapacityCannotBeZero()
167+
{
168+
var init = ScriptableObject.CreateInstance<ContextTestInit>();
169+
var data = init.GetData();
170+
data.SetSettingValue("capacity", 0u);
171+
uint capacity = (uint)data.GetSettingValue("capacity");
172+
Assert.NotZero(capacity);
173+
}
174+
175+
[Test]
176+
public void CheckStripCapacityCannotBeZero()
177+
{
178+
var init = ScriptableObject.CreateInstance<ContextTestInit>();
179+
var data = init.GetData();
180+
data.SetSettingValue("dataType", VFXDataParticle.DataType.ParticleStrip);
181+
data.SetSettingValue("stripCapacity", 0u);
182+
data.SetSettingValue("particlePerStripCount", 0u);
183+
184+
uint capacity = (uint)data.GetSettingValue("capacity");
185+
uint stripCapacity = (uint)data.GetSettingValue("stripCapacity");
186+
uint particlePerStripCount = (uint)data.GetSettingValue("particlePerStripCount");
187+
188+
Assert.NotZero(capacity);
189+
Assert.NotZero(stripCapacity);
190+
Assert.NotZero(particlePerStripCount);
191+
}
164192
}
165193
}
166194
#endif

TestProjects/VisualEffectGraph/Assets/AllTests/Editor/Tests/VFXDebugExpressionTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ public IEnumerator CreateAsset_And_Check_Exception_On_Invalid_Graph()
226226

227227
yield return null;
228228
}
229+
229230
#endif
230231
}
231232
}

TestProjects/VisualEffectGraph/Assets/AllTests/Editor/Tests/VFXExpressionColorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !UNITY_EDITOR_OSX || MAC_FORCE_TESTS
1+
#if !UNITY_EDITOR_OSX || MAC_FORCE_TESTS
22
using NUnit.Framework;
33
using System;
44
using System.Collections.Generic;

TestProjects/VisualEffectGraph/Assets/AllTests/Editor/Tests/VFXExpressionGraphTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !UNITY_EDITOR_OSX || MAC_FORCE_TESTS
1+
#if !UNITY_EDITOR_OSX || MAC_FORCE_TESTS
22
using NUnit.Framework;
33
using System;
44
using System.Linq;

TestProjects/VisualEffectGraph/Assets/AllTests/Editor/Tests/VFXExpressionMathTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ public void ProcessVanDerCorputSequence()
333333
}
334334
}
335335

336-
337336
public struct Min_Max_Expression_Folding_TestCase
338337
{
339338
internal string name;
@@ -347,7 +346,7 @@ public override string ToString()
347346
};
348347

349348
static private string[] k_Min_Max_Expression_Folding_TestCase_Names = Generate_Min_Max_Expression_Folding_TestCase().Select(o => o.name).ToArray();
350-
349+
351350
static private IEnumerable<Min_Max_Expression_Folding_TestCase> Generate_Min_Max_Expression_Folding_TestCase()
352351
{
353352
var x = VFXBuiltInExpression.TotalTime;
@@ -370,7 +369,7 @@ static private IEnumerable<Min_Max_Expression_Folding_TestCase> Generate_Min_Max
370369
yield return new Min_Max_Expression_Folding_TestCase() { name = "max(min(x, 0), 1)", expression = new VFXExpressionMax(new VFXExpressionMin(x, zero), one), saturateExpected = false };
371370
yield return new Min_Max_Expression_Folding_TestCase() { name = "max(1, min(x, 0))", expression = new VFXExpressionMax(one, new VFXExpressionMin(x, zero)), saturateExpected = false };
372371

373-
//Exotic cases
372+
//Exotic cases
374373
yield return new Min_Max_Expression_Folding_TestCase() { name = "min(min(x, 1), 0)", expression = new VFXExpressionMin(new VFXExpressionMin(x, one), zero), saturateExpected = false };
375374
yield return new Min_Max_Expression_Folding_TestCase() { name = "max(max(x, 1), 0)", expression = new VFXExpressionMax(new VFXExpressionMax(x, one), zero), saturateExpected = false };
376375
yield return new Min_Max_Expression_Folding_TestCase() { name = "max(add(x, 1), 0)", expression = new VFXExpressionMax(new VFXExpressionAdd(x, one), zero), saturateExpected = false };

0 commit comments

Comments
 (0)