Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

090-Vectors-Exceptions.cs 700B

12345678910111213141516171819202122232425
  1. using System;
  2. using Unity.Burst;
  3. using Unity.Mathematics;
  4. namespace Burst.Compiler.IL.Tests
  5. {
  6. internal partial class VectorsExceptions
  7. {
  8. [TestCompiler(1.0f, ExpectedDiagnosticId = DiagnosticId.WRN_ExceptionThrownInNonSafetyCheckGuardedFunction)]
  9. public static float Float4WithException(float a)
  10. {
  11. return GetFloat4(a).x;
  12. }
  13. private static float4 GetFloat4(float value)
  14. {
  15. if (value < 0)
  16. {
  17. throw new ArgumentException();
  18. // Here the generated code should have a burst.abort + a return zero float4 (SIMD type)
  19. }
  20. return new float4(value);
  21. }
  22. }
  23. }