Firstborn/Library/PackageCache/com.unity.burst@1.8.4/Tests/Runtime/Shared/090-Vectors-Exceptions.cs
Schaken-Mods 9092858a58 updated to the latest editor
I updated everything to the latest Unity Editor. Also realized I had the wrong shaders on my hairs, those are fixed and the hairs look MUCH better!
2023-05-07 17:43:11 -05:00

25 lines
700 B
C#

using System;
using Unity.Burst;
using Unity.Mathematics;
namespace Burst.Compiler.IL.Tests
{
internal partial class VectorsExceptions
{
[TestCompiler(1.0f, ExpectedDiagnosticId = DiagnosticId.WRN_ExceptionThrownInNonSafetyCheckGuardedFunction)]
public static float Float4WithException(float a)
{
return GetFloat4(a).x;
}
private static float4 GetFloat4(float value)
{
if (value < 0)
{
throw new ArgumentException();
// Here the generated code should have a burst.abort + a return zero float4 (SIMD type)
}
return new float4(value);
}
}
}