diff --git a/.yamato/upm-ci.yml b/.yamato/upm-ci.yml index 7abddb97..9335ec46 100644 --- a/.yamato/upm-ci.yml +++ b/.yamato/upm-ci.yml @@ -1,69 +1,48 @@ build_platforms: - name: windows type: Unity::VM - image: sdet/burst-devimage:stable + image: package-ci/win10:v4 flavor: b1.large - name: linux - image: package-ci/ubuntu:stable + image: package-ci/ubuntu-22.04:v4 type: Unity::VM flavor: b1.large - name: macOS - image: burst/burst_mac:stable + image: package-ci/macos-13:v4 type: Unity::VM::osx flavor: b1.large upmci_platforms: - name: windows type: Unity::VM - image: package-ci/win10:stable + image: package-ci/win10:v4 flavor: b1.large - name: linux - image: package-ci/ubuntu:stable + image: package-ci/ubuntu-22.04:v4 type: Unity::VM flavor: b1.large - name: macOS - image: package-ci/mac:stable + image: package-ci/macos-13:v4 type: Unity::VM::osx flavor: b1.large validate_editor_versions: - - version: "2018.4" - display_name: "2018.4" - - version: "2019.4" - display_name: "2019.4" - - version: "2020.3" - display_name: "2020.3" - - version: "2021.1" - display_name: "2021.1" - - version: "2021.2" - display_name: "2021.2" - - version: "2022.1" - display_name: "2022.1" - - version: "2020.3/partner/staging" - display_name: "2020.3_partner_staging" + - version: "2021.3" + display_name: "2021.3" + - version: "2022.3" + display_name: "2022.3" + - version: "2023.1" + display_name: "2023.1" - version: "trunk" display_name: "trunk" package_tests_editor_versions: - # 2018.3 shows up here but not under validate_editor_versions because package validation is no longer - # supported on 2018.3 but Mathematics still supports it so we need to be able to test it. CI jobs - # from this list will run package tests only instead of the full validation suite. - - version: "2018.3" - display_name: "2018.3" - - version: "2018.4" - display_name: "2018.4" - - version: "2019.4" - display_name: "2019.4" - - version: "2020.3" - display_name: "2020.3" - - version: "2021.1" - display_name: "2021.1" - - version: "2021.2" - display_name: "2021.2" - - version: "2022.1" - display_name: "2022.1" - - version: "2020.3/partner/staging" - display_name: "2020.3_partner_staging" + - version: "2021.3" + display_name: "2021.3" + - version: "2022.3" + display_name: "2022.3" + - version: "2023.1" + display_name: "2023.1" - version: "trunk" display_name: "trunk" --- @@ -100,19 +79,19 @@ package_tests_minimal: name: Package tests minimal dependencies: {% for platform in upmci_platforms %} - - .yamato/upm-ci.yml#package_tests_{{platform.name}}_2018.3 + - .yamato/upm-ci.yml#package_tests_{{platform.name}}_2021.3 {% endfor %} validate_package_minimal: name: Validate Package Linux Minimal agent: - image: package-ci/ubuntu:stable + image: package-ci/ubuntu-22.04:v4 type: Unity::VM flavor: b1.large commands: - npm install upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm -g - upm-ci package pack --package-path src/ - - upm-ci package test --package-path src/ --unity-version 2019.4 + - upm-ci package test --package-path src/ --unity-version 2021.3 artifacts: packages: paths: @@ -156,7 +135,7 @@ publish: name: Publish agent: type: Unity::VM - image: package-ci/win10:stable + image: package-ci/win10:v4 flavor: b1.large variables: UPMCI_ENABLE_PACKAGE_SIGNING: 1 @@ -179,7 +158,7 @@ promote: name: Promote agent: type: Unity::VM - image: package-ci/win10:stable + image: package-ci/win10:v4 flavor: b1.large variables: UPMCI_PROMOTION: 1 diff --git a/LICENSE.md b/LICENSE.md index a95cdfbe..0c7f3fac 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -com.unity.mathematics copyright © 2022 Unity Technologies ApS +com.unity.mathematics copyright © 2023 Unity Technologies ApS Licensed under the Unity Companion License for Unity-dependent projects (see https://unity3d.com/legal/licenses/unity_companion_license). -Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions. \ No newline at end of file +Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions. diff --git a/Unity.Mathematics.TestProject/Assets/Scenes/SampleScene.unity b/Unity.Mathematics.TestProject/Assets/Scenes/SampleScene.unity index 7cdec2a0..b819a102 100644 --- a/Unity.Mathematics.TestProject/Assets/Scenes/SampleScene.unity +++ b/Unity.Mathematics.TestProject/Assets/Scenes/SampleScene.unity @@ -38,24 +38,23 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 705507994} - m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_IndirectSpecularColor: {r: 0.44402242, g: 0.49316543, b: 0.5722324, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 11 + serializedVersion: 12 m_GIWorkflowMode: 0 m_GISettings: serializedVersion: 2 m_BounceScale: 1 m_IndirectOutputScale: 1 m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 m_EnvironmentLightingMode: 0 m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 10 + serializedVersion: 12 m_Resolution: 2 m_BakeResolution: 40 m_AtlasSize: 1024 @@ -63,6 +62,7 @@ LightmapSettings: m_AOMaxDistance: 1 m_CompAOExponent: 1 m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 m_Padding: 2 m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 @@ -77,10 +77,16 @@ LightmapSettings: m_PVRDirectSampleCount: 32 m_PVRSampleCount: 500 m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 m_PVRFilterTypeDirect: 0 m_PVRFilterTypeIndirect: 0 m_PVRFilterTypeAO: 0 - m_PVRFilteringMode: 1 + m_PVREnvironmentMIS: 0 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 m_PVRFilteringGaussRadiusIndirect: 5 @@ -88,15 +94,18 @@ LightmapSettings: m_PVRFilteringAtrousPositionSigmaDirect: 0.5 m_PVRFilteringAtrousPositionSigmaIndirect: 2 m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ShowResolutionOverlay: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 1 + m_LightingSettings: {fileID: 4890085278179872738, guid: 20c8488ac153b4f45944c2d7c85a094e, + type: 2} --- !u!196 &4 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -109,15 +118,49 @@ NavMeshSettings: cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &206998647 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 206998649} + m_Layer: 0 + m_Name: GameObject + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &206998649 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 206998647} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &705507993 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 705507995} @@ -133,15 +176,18 @@ GameObject: Light: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 705507993} m_Enabled: 1 - serializedVersion: 8 + serializedVersion: 10 m_Type: 1 + m_Shape: 0 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 m_Range: 10 m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 m_CookieSize: 10 m_Shadows: m_Type: 2 @@ -151,6 +197,24 @@ Light: m_Bias: 0.05 m_NormalBias: 0.4 m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -158,32 +222,39 @@ Light: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 + m_RenderingLayerMask: 1 m_Lightmapping: 1 m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!4 &705507995 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 705507993} + serializedVersion: 2 m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} --- !u!1 &963194225 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 963194228} @@ -200,24 +271,35 @@ GameObject: AudioListener: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 963194225} m_Enabled: 1 --- !u!20 &963194227 Camera: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 963194225} m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} m_projectionMatrixMode: 1 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 @@ -248,12 +330,21 @@ Camera: Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 963194225} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 1, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 963194228} + - {fileID: 705507995} + - {fileID: 206998649} diff --git a/Unity.Mathematics.TestProject/Assets/Scenes/SampleSceneSettings.lighting b/Unity.Mathematics.TestProject/Assets/Scenes/SampleSceneSettings.lighting new file mode 100644 index 00000000..e595ed65 --- /dev/null +++ b/Unity.Mathematics.TestProject/Assets/Scenes/SampleSceneSettings.lighting @@ -0,0 +1,66 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!850595691 &4890085278179872738 +LightingSettings: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SampleSceneSettings + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_RealtimeEnvironmentLighting: 1 + m_BounceScale: 1 + m_AlbedoBoost: 1 + m_IndirectOutputScale: 1 + m_UsingShadowmask: 1 + m_BakeBackend: 1 + m_LightmapMaxSize: 1024 + m_BakeResolution: 40 + m_Padding: 2 + m_LightmapCompression: 3 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAO: 0 + m_MixedBakeMode: 2 + m_LightmapsBakeMode: 1 + m_FilterMode: 1 + m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_RealtimeResolution: 2 + m_ForceWhiteAlbedo: 0 + m_ForceUpdates: 0 + m_FinalGather: 0 + m_FinalGatherRayCount: 256 + m_FinalGatherFiltering: 1 + m_PVRCulling: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVREnvironmentSampleCount: 512 + m_PVREnvironmentReferencePointCount: 2048 + m_LightProbeSampleCountMultiplier: 4 + m_PVRBounces: 2 + m_PVRMinBounces: 2 + m_PVREnvironmentImportanceSampling: 0 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_PVRTiledBaking: 0 + m_NumRaysToShootPerTexel: -1 + m_RespectSceneVisibilityWhenBakingGI: 0 diff --git a/Unity.Mathematics.TestProject/Assets/Scenes/SampleSceneSettings.lighting.meta b/Unity.Mathematics.TestProject/Assets/Scenes/SampleSceneSettings.lighting.meta new file mode 100644 index 00000000..daa2a351 --- /dev/null +++ b/Unity.Mathematics.TestProject/Assets/Scenes/SampleSceneSettings.lighting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 20c8488ac153b4f45944c2d7c85a094e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 4890085278179872738 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity.Mathematics.TestProject/Packages/manifest.json b/Unity.Mathematics.TestProject/Packages/manifest.json index 5b27463f..932cc93d 100644 --- a/Unity.Mathematics.TestProject/Packages/manifest.json +++ b/Unity.Mathematics.TestProject/Packages/manifest.json @@ -1,13 +1,15 @@ { "dependencies": { - "com.unity.burst": "1.2.3", - "com.unity.ide.rider": "1.1.4", - "com.unity.ide.vscode": "1.1.4", + "com.unity.ai.navigation": "2.0.0", + "com.unity.burst": "1.8.11", + "com.unity.ide.rider": "3.0.27", + "com.unity.ide.visualstudio": "2.0.22", "com.unity.mathematics": "file:../../src", - "com.unity.package-validation-suite": "0.8.1-preview", - "com.unity.properties": "0.10.4-preview", - "com.unity.test-framework": "1.1.11", - "com.unity.test-framework.performance": "2.8.0-preview" + "com.unity.package-validation-suite": "0.62.0-preview", + "com.unity.properties": "2.1.0-exp.3", + "com.unity.test-framework": "1.3.9", + "com.unity.test-framework.performance": "3.0.3", + "com.unity.modules.accessibility": "1.0.0" }, "testables": [ "com.unity.mathematics" diff --git a/Unity.Mathematics.TestProject/ProjectSettings/EditorBuildSettings.asset b/Unity.Mathematics.TestProject/ProjectSettings/EditorBuildSettings.asset index 0147887e..40917b05 100644 --- a/Unity.Mathematics.TestProject/ProjectSettings/EditorBuildSettings.asset +++ b/Unity.Mathematics.TestProject/ProjectSettings/EditorBuildSettings.asset @@ -4,5 +4,8 @@ EditorBuildSettings: m_ObjectHideFlags: 0 serializedVersion: 2 - m_Scenes: [] + m_Scenes: + - enabled: 1 + path: Assets/Scenes/SampleScene.unity + guid: 9fc0d4010bbf28b4594072e72b8655ab m_configObjects: {} diff --git a/Unity.Mathematics.TestProject/ProjectSettings/GraphicsSettings.asset b/Unity.Mathematics.TestProject/ProjectSettings/GraphicsSettings.asset index 35a0fa7f..bea55798 100644 --- a/Unity.Mathematics.TestProject/ProjectSettings/GraphicsSettings.asset +++ b/Unity.Mathematics.TestProject/ProjectSettings/GraphicsSettings.asset @@ -36,6 +36,10 @@ GraphicsSettings: - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16003, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} m_PreloadedShaders: [] m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} diff --git a/Unity.Mathematics.TestProject/ProjectSettings/ProjectSettings.asset b/Unity.Mathematics.TestProject/ProjectSettings/ProjectSettings.asset index f8345c9f..9eb3e0b5 100644 --- a/Unity.Mathematics.TestProject/ProjectSettings/ProjectSettings.asset +++ b/Unity.Mathematics.TestProject/ProjectSettings/ProjectSettings.asset @@ -3,7 +3,7 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 20 + serializedVersion: 26 productGUID: 50c0163089a174a7ab9f46f0020a809f AndroidProfiler: 0 AndroidFilterTouchesWhenObscured: 0 @@ -48,12 +48,15 @@ PlayerSettings: defaultScreenHeightWeb: 600 m_StereoRenderingPath: 0 m_ActiveColorSpace: 0 + m_SpriteBatchVertexThreshold: 300 m_MTRendering: 1 + mipStripping: 0 + numberOfMipsStripped: 0 + numberOfMipsStrippedPerMipmapLimitGroup: {} m_StackTraceTypes: 010000000100000001000000010000000100000001000000 iosShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1 iosUseCustomAppBackgroundBehavior: 0 - iosAllowHTTPDownload: 1 allowedAutorotateToPortrait: 1 allowedAutorotateToPortraitUpsideDown: 1 allowedAutorotateToLandscapeRight: 1 @@ -66,6 +69,12 @@ PlayerSettings: androidRenderOutsideSafeArea: 1 androidUseSwappy: 0 androidBlitType: 0 + androidResizableWindow: 0 + androidDefaultWindowWidth: 1920 + androidDefaultWindowHeight: 1080 + androidMinimumWindowWidth: 400 + androidMinimumWindowHeight: 300 + androidFullscreenMode: 1 defaultIsNativeResolution: 1 macRetinaSupport: 1 runInBackground: 1 @@ -103,6 +112,7 @@ PlayerSettings: xboxOneMonoLoggingLevel: 0 xboxOneLoggingLevel: 1 xboxOneDisableEsram: 0 + xboxOneEnableTypeOptimization: 0 xboxOnePresentImmediateThreshold: 0 switchQueueCommandMemory: 0 switchQueueControlMemory: 16384 @@ -110,14 +120,19 @@ PlayerSettings: switchNVNShaderPoolsGranularity: 33554432 switchNVNDefaultPoolsGranularity: 16777216 switchNVNOtherPoolsGranularity: 16777216 + switchGpuScratchPoolGranularity: 2097152 + switchAllowGpuScratchShrinking: 0 + switchNVNMaxPublicTextureIDCount: 0 + switchNVNMaxPublicSamplerIDCount: 0 + switchNVNGraphicsFirmwareMemory: 32 + stadiaPresentMode: 0 + stadiaTargetFramerate: 0 vulkanNumSwapchainBuffers: 3 vulkanEnableSetSRGBWrite: 0 - m_SupportedAspectRatios: - 4:3: 1 - 5:4: 1 - 16:10: 1 - 16:9: 1 - Others: 1 + vulkanEnablePreTransform: 0 + vulkanEnableLateAcquireNextImage: 0 + vulkanEnableCommandBufferRecycling: 1 + loadStoreDebugModeEnabled: 0 bundleVersion: 0.1 preloadedAssets: [] metroInputSource: 0 @@ -126,45 +141,28 @@ PlayerSettings: xboxOneDisableKinectGpuReservation: 0 xboxOneEnable7thCore: 0 vrSettings: - cardboard: - depthFormat: 0 - enableTransitionView: 0 - daydream: - depthFormat: 0 - useSustainedPerformanceMode: 0 - enableVideoLayer: 0 - useProtectedVideoMemory: 0 - minimumSupportedHeadTracking: 0 - maximumSupportedHeadTracking: 1 - hololens: - depthFormat: 1 - depthBufferSharingEnabled: 0 - lumin: - depthFormat: 0 - frameTiming: 2 - enableGLCache: 0 - glCacheMaxBlobSize: 524288 - glCacheMaxFileSize: 8388608 - oculus: - sharedDepthBuffer: 1 - dashSupport: 1 - lowOverheadMode: 0 - protectedContext: 0 - v2Signing: 1 enable360StereoCapture: 0 isWsaHolographicRemotingEnabled: 0 enableFrameTimingStats: 0 + enableOpenGLProfilerGPURecorders: 1 useHDRDisplay: 0 - D3DHDRBitDepth: 0 + hdrBitDepth: 0 m_ColorGamuts: 00000000 targetPixelDensity: 30 resolutionScalingMode: 0 + resetResolutionOnWindowResize: 0 androidSupportedAspectRatio: 1 androidMaxAspectRatio: 2.1 - applicationIdentifier: {} - buildNumber: {} + applicationIdentifier: + Android: com.UnityTestRunner.UnityTestRunner + buildNumber: + Standalone: 0 + VisionOS: 0 + iPhone: 0 + tvOS: 0 + overrideDefaultApplicationIdentifier: 1 AndroidBundleVersionCode: 1 - AndroidMinSdkVersion: 19 + AndroidMinSdkVersion: 22 AndroidTargetSdkVersion: 0 AndroidPreferredInstallLocation: 1 aotOptions: @@ -177,34 +175,21 @@ PlayerSettings: APKExpansionFiles: 0 keepLoadedShadersAlive: 0 StripUnusedMeshComponents: 1 + strictShaderVariantMatching: 0 VertexChannelCompressionMask: 4054 iPhoneSdkVersion: 988 - iOSTargetOSVersionString: 10.0 + iOSTargetOSVersionString: 12.0 tvOSSdkVersion: 0 tvOSRequireExtendedGameController: 0 - tvOSTargetOSVersionString: 10.0 + tvOSTargetOSVersionString: 12.0 + VisionOSSdkVersion: 0 + VisionOSTargetOSVersionString: 1.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 uIRequiresFullScreen: 1 uIStatusBarHidden: 1 uIExitOnSuspend: 0 uIStatusBarStyle: 0 - iPhoneSplashScreen: {fileID: 0} - iPhoneHighResSplashScreen: {fileID: 0} - iPhoneTallHighResSplashScreen: {fileID: 0} - iPhone47inSplashScreen: {fileID: 0} - iPhone55inPortraitSplashScreen: {fileID: 0} - iPhone55inLandscapeSplashScreen: {fileID: 0} - iPhone58inPortraitSplashScreen: {fileID: 0} - iPhone58inLandscapeSplashScreen: {fileID: 0} - iPadPortraitSplashScreen: {fileID: 0} - iPadHighResPortraitSplashScreen: {fileID: 0} - iPadLandscapeSplashScreen: {fileID: 0} - iPadHighResLandscapeSplashScreen: {fileID: 0} - iPhone65inPortraitSplashScreen: {fileID: 0} - iPhone65inLandscapeSplashScreen: {fileID: 0} - iPhone61inPortraitSplashScreen: {fileID: 0} - iPhone61inLandscapeSplashScreen: {fileID: 0} appleTVSplashScreen: {fileID: 0} appleTVSplashScreen2x: {fileID: 0} tvOSSmallIconLayers: [] @@ -232,32 +217,47 @@ PlayerSettings: iOSLaunchScreeniPadFillPct: 100 iOSLaunchScreeniPadSize: 100 iOSLaunchScreeniPadCustomXibPath: - iOSUseLaunchScreenStoryboard: 0 iOSLaunchScreenCustomStoryboardPath: + iOSLaunchScreeniPadCustomStoryboardPath: iOSDeviceRequirements: [] iOSURLSchemes: [] + macOSURLSchemes: [] iOSBackgroundModes: 0 iOSMetalForceHardShadows: 0 metalEditorSupport: 1 metalAPIValidation: 1 iOSRenderExtraFrameOnPause: 0 + iosCopyPluginsCodeInsteadOfSymlink: 0 appleDeveloperTeamID: iOSManualSigningProvisioningProfileID: tvOSManualSigningProvisioningProfileID: + VisionOSManualSigningProvisioningProfileID: iOSManualSigningProvisioningProfileType: 0 tvOSManualSigningProvisioningProfileType: 0 + VisionOSManualSigningProvisioningProfileType: 0 appleEnableAutomaticSigning: 0 iOSRequireARKit: 0 iOSAutomaticallyDetectAndAddCapabilities: 1 appleEnableProMotion: 0 + shaderPrecisionModel: 0 clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea templatePackageId: com.unity.template.3d@1.0.11 templateDefaultScene: Assets/Scenes/SampleScene.unity + useCustomMainManifest: 0 + useCustomLauncherManifest: 0 + useCustomMainGradleTemplate: 0 + useCustomLauncherGradleManifest: 0 + useCustomBaseGradleTemplate: 0 + useCustomGradlePropertiesTemplate: 0 + useCustomGradleSettingsTemplate: 0 + useCustomProguardFile: 0 AndroidTargetArchitectures: 1 + AndroidTargetDevices: 0 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} AndroidKeystoreName: '{inproject}: ' AndroidKeyaliasName: + AndroidEnableArmv9SecurityFeatures: 0 AndroidBuildApkPerCpuArchitecture: 0 AndroidTVCompatibility: 0 AndroidIsGame: 1 @@ -270,10 +270,105 @@ PlayerSettings: height: 180 banner: {fileID: 0} androidGamepadSupportLevel: 0 + chromeosInputEmulation: 1 + AndroidMinifyRelease: 0 + AndroidMinifyDebug: 0 AndroidValidateAppBundleSize: 1 AndroidAppBundleSizeToValidate: 100 m_BuildTargetIcons: [] - m_BuildTargetPlatformIcons: [] + m_BuildTargetPlatformIcons: + - m_BuildTarget: Android + m_Icons: + - m_Textures: [] + m_Width: 432 + m_Height: 432 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 324 + m_Height: 324 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 216 + m_Height: 216 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 162 + m_Height: 162 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 108 + m_Height: 108 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 81 + m_Height: 81 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 1 + m_SubKind: m_BuildTargetBatching: - m_BuildTarget: Standalone m_StaticBatching: 1 @@ -290,6 +385,7 @@ PlayerSettings: - m_BuildTarget: WebGL m_StaticBatching: 0 m_DynamicBatching: 0 + m_BuildTargetShaderSettings: [] m_BuildTargetGraphicsJobs: - m_BuildTarget: MacStandaloneSupport m_GraphicsJobs: 0 @@ -325,13 +421,13 @@ PlayerSettings: m_BuildTargetGraphicsAPIs: - m_BuildTarget: AndroidPlayer m_APIs: 150000000b000000 - m_Automatic: 0 + m_Automatic: 1 - m_BuildTarget: iOSSupport m_APIs: 10000000 m_Automatic: 1 - m_BuildTarget: AppleTVSupport m_APIs: 10000000 - m_Automatic: 0 + m_Automatic: 1 - m_BuildTarget: WebGLSupport m_APIs: 0b000000 m_Automatic: 1 @@ -341,6 +437,8 @@ PlayerSettings: m_Devices: - Oculus - OpenVR + m_DefaultShaderChunkSizeInMB: 16 + m_DefaultShaderChunkCount: 0 openGLRequireES31: 0 openGLRequireES31AEP: 0 openGLRequireES32: 0 @@ -350,7 +448,11 @@ PlayerSettings: iPhone: 1 tvOS: 1 m_BuildTargetGroupLightmapEncodingQuality: [] + m_BuildTargetGroupHDRCubemapEncodingQuality: [] m_BuildTargetGroupLightmapSettings: [] + m_BuildTargetGroupLoadStoreDebugModeSettings: [] + m_BuildTargetNormalMapEncoding: [] + m_BuildTargetDefaultTextureCompressionFormat: [] playModeTestRunnerEnabled: 0 runPlayModeTestAsEditModeTest: 0 actionOnDotNetUnhandledException: 1 @@ -360,14 +462,20 @@ PlayerSettings: cameraUsageDescription: locationUsageDescription: microphoneUsageDescription: + bluetoothUsageDescription: + macOSTargetOSVersion: 10.13.0 + switchNMETAOverride: switchNetLibKey: switchSocketMemoryPoolSize: 6144 switchSocketAllocatorPoolSize: 128 switchSocketConcurrencyLimit: 14 switchScreenResolutionBehavior: 2 switchUseCPUProfiler: 0 + switchUseGOLDLinker: 0 + switchLTOSetting: 0 switchApplicationID: 0x01004b9000490000 switchNSODependencies: + switchCompilerFlags: switchTitleNames_0: switchTitleNames_1: switchTitleNames_2: @@ -383,6 +491,7 @@ PlayerSettings: switchTitleNames_12: switchTitleNames_13: switchTitleNames_14: + switchTitleNames_15: switchPublisherNames_0: switchPublisherNames_1: switchPublisherNames_2: @@ -398,6 +507,7 @@ PlayerSettings: switchPublisherNames_12: switchPublisherNames_13: switchPublisherNames_14: + switchPublisherNames_15: switchIcons_0: {fileID: 0} switchIcons_1: {fileID: 0} switchIcons_2: {fileID: 0} @@ -413,6 +523,7 @@ PlayerSettings: switchIcons_12: {fileID: 0} switchIcons_13: {fileID: 0} switchIcons_14: {fileID: 0} + switchIcons_15: {fileID: 0} switchSmallIcons_0: {fileID: 0} switchSmallIcons_1: {fileID: 0} switchSmallIcons_2: {fileID: 0} @@ -428,6 +539,7 @@ PlayerSettings: switchSmallIcons_12: {fileID: 0} switchSmallIcons_13: {fileID: 0} switchSmallIcons_14: {fileID: 0} + switchSmallIcons_15: {fileID: 0} switchManualHTML: switchAccessibleURLs: switchLegalInformation: @@ -437,7 +549,6 @@ PlayerSettings: switchReleaseVersion: 0 switchDisplayVersion: 1.0.0 switchStartupUserAccount: 0 - switchTouchScreenUsage: 0 switchSupportedLanguagesMask: 0 switchLogoType: 0 switchApplicationErrorCodeCategory: @@ -479,6 +590,7 @@ PlayerSettings: switchNativeFsCacheSize: 32 switchIsHoldTypeHorizontal: 0 switchSupportedNpadCount: 8 + switchEnableTouchScreen: 1 switchSocketConfigEnabled: 0 switchTcpInitialSendBufferSize: 32 switchTcpInitialReceiveBufferSize: 64 @@ -490,6 +602,12 @@ PlayerSettings: switchSocketInitializeEnabled: 1 switchNetworkInterfaceManagerInitializeEnabled: 1 switchPlayerConnectionEnabled: 1 + switchUseNewStyleFilepaths: 1 + switchUseLegacyFmodPriorities: 0 + switchUseMicroSleepForYield: 1 + switchEnableRamDiskSupport: 0 + switchMicroSleepForYieldTime: 25 + switchRamDiskSpaceSize: 12 ps4NPAgeRating: 12 ps4NPTitleSecret: ps4NPTrophyPackPath: @@ -516,6 +634,7 @@ PlayerSettings: ps4ShareFilePath: ps4ShareOverlayImagePath: ps4PrivacyGuardImagePath: + ps4ExtraSceSysFile: ps4NPtitleDatPath: ps4RemotePlayKeyAssignment: -1 ps4RemotePlayKeyMappingDir: @@ -541,6 +660,7 @@ PlayerSettings: ps4UseResolutionFallback: 0 ps4ReprojectionSupport: 0 ps4UseAudio3dBackend: 0 + ps4UseLowGarlicFragmentationMode: 1 ps4SocialScreenEnabled: 0 ps4ScriptOptimizationLevel: 0 ps4Audio3dVirtualSpeakerCount: 14 @@ -557,6 +677,9 @@ PlayerSettings: ps4disableAutoHideSplash: 0 ps4videoRecordingFeaturesUsed: 0 ps4contentSearchFeaturesUsed: 0 + ps4CompatibilityPS5: 0 + ps4AllowPS5Detection: 0 + ps4GPU800MHz: 1 ps4attribEyeToEyeDistanceSettingVR: 0 ps4IncludedModules: [] ps4attribVROutputEnabled: 0 @@ -568,6 +691,7 @@ PlayerSettings: webGLMemorySize: 16 webGLExceptionSupport: 1 webGLNameFilesAsHashes: 0 + webGLShowDiagnostics: 0 webGLDataCaching: 1 webGLDebugSymbols: 0 webGLEmscriptenArgs: @@ -576,16 +700,45 @@ PlayerSettings: webGLAnalyzeBuildSize: 0 webGLUseEmbeddedResources: 0 webGLCompressionFormat: 1 + webGLWasmArithmeticExceptions: 0 webGLLinkerTarget: 1 webGLThreadsSupport: 0 - webGLWasmStreaming: 0 + webGLDecompressionFallback: 0 + webGLInitialMemorySize: 32 + webGLMaximumMemorySize: 2048 + webGLMemoryGrowthMode: 2 + webGLMemoryLinearGrowthStep: 16 + webGLMemoryGeometricGrowthStep: 0.2 + webGLMemoryGeometricGrowthCap: 96 + webGLPowerPreference: 2 scriptingDefineSymbols: {} + additionalCompilerArguments: {} platformArchitecture: {} - scriptingBackend: {} + scriptingBackend: + Android: 1 + Standalone: 1 il2cppCompilerConfiguration: {} - managedStrippingLevel: {} + il2cppCodeGeneration: {} + managedStrippingLevel: + Android: 1 + EmbeddedLinux: 1 + GameCoreScarlett: 1 + GameCoreXboxOne: 1 + Nintendo Switch: 1 + PS4: 1 + PS5: 1 + QNX: 1 + Stadia: 1 + VisionOS: 1 + WebGL: 1 + Windows Store Apps: 1 + XboxOne: 1 + iPhone: 1 + tvOS: 1 incrementalIl2cppBuild: {} - allowUnsafeCode: 0 + suppressCommonWarnings: 1 + allowUnsafeCode: 1 + useDeterministicCompilation: 1 additionalIl2CppArgs: scriptingRuntimeVersion: 1 gcIncremental: 0 @@ -620,6 +773,7 @@ PlayerSettings: metroFTAName: metroFTAFileTypes: [] metroProtocolName: + vcxProjDefaultLanguage: XboxOneProductId: XboxOneUpdateKey: XboxOneSandboxId: @@ -638,6 +792,7 @@ PlayerSettings: XboxOneCapability: [] XboxOneGameRating: {} XboxOneIsContentPackage: 0 + XboxOneEnhancedXboxCompatibilityMode: 0 XboxOneEnableGPUVariability: 0 XboxOneSockets: {} XboxOneSplashScreen: {fileID: 0} @@ -645,10 +800,8 @@ PlayerSettings: XboxOnePersistentLocalStorageSize: 0 XboxOneXTitleMemory: 8 XboxOneOverrideIdentityName: - vrEditorSettings: - daydream: - daydreamIconForeground: {fileID: 0} - daydreamIconBackground: {fileID: 0} + XboxOneOverrideIdentityPublisher: + vrEditorSettings: {} cloudServicesEnabled: UNet: 1 luminIcon: @@ -662,12 +815,22 @@ PlayerSettings: luminVersion: m_VersionCode: 1 m_VersionName: + hmiPlayerDataPath: + hmiForceSRGBBlit: 1 + embeddedLinuxEnableGamepadInput: 1 + hmiLogStartupTiming: 0 + hmiCpuConfiguration: apiCompatibilityLevel: 6 + activeInputHandler: 0 + windowsGamepadBackendHint: 0 cloudProjectId: framebufferDepthMemorylessMode: 0 + qualitySettingsNames: [] projectName: organizationId: cloudEnabled: 0 - enableNativePlatformBackendsForNewInputSystem: 0 - disableOldInputManagerSupport: 0 legacyClampBlendShapeWeights: 1 + hmiLoadingImage: {fileID: 0} + platformRequiresReadableAssets: 0 + virtualTexturingSupportEnabled: 0 + insecureHttpOption: 0 diff --git a/Unity.Mathematics.TestProject/ProjectSettings/ProjectVersion.txt b/Unity.Mathematics.TestProject/ProjectSettings/ProjectVersion.txt index 798259ba..78a77889 100644 --- a/Unity.Mathematics.TestProject/ProjectSettings/ProjectVersion.txt +++ b/Unity.Mathematics.TestProject/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2019.3.0f6 -m_EditorVersionWithRevision: 2019.3.0f6 (27ab2135bccf) +m_EditorVersion: 2022.3.7f1 +m_EditorVersionWithRevision: 2022.3.7f1 (b16b3b16c7a0) diff --git a/Unity.Mathematics.TestProject/ProjectSettings/UnityConnectSettings.asset b/Unity.Mathematics.TestProject/ProjectSettings/UnityConnectSettings.asset index fa0b1465..a88bee0f 100644 --- a/Unity.Mathematics.TestProject/ProjectSettings/UnityConnectSettings.asset +++ b/Unity.Mathematics.TestProject/ProjectSettings/UnityConnectSettings.asset @@ -9,6 +9,7 @@ UnityConnectSettings: m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events m_EventUrl: https://cdp.cloud.unity3d.com/v1/events m_ConfigUrl: https://config.uca.cloud.unity3d.com + m_DashboardUrl: https://dashboard.unity3d.com m_TestInitMode: 0 CrashReportingSettings: m_EventUrl: https://perf-events.cloud.unity3d.com @@ -22,6 +23,7 @@ UnityConnectSettings: m_Enabled: 0 m_TestMode: 0 m_InitializeOnStartup: 1 + m_PackageRequiringCoreStatsPresent: 0 UnityAdsSettings: m_Enabled: 0 m_InitializeOnStartup: 1 diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index 7e856def..f51a25d0 100755 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,6 +1,13 @@ # Changelog ## [Unreleased] + +### Fixed +* Fixed `math.hash` crash when using IL2CPP builds on Arm 32 bit devices. +* Fixed obsolete method usage warnings for `MatrixDrawer.CanCacheInspectorGUI` and `PrimitiveVectorDrawer.CanCacheInspectorGUI` in UNITY_2023_2_OR_NEWER. + +## [1.3.1] - 2023-07-12 + ### Added * Added `math.square` to compute the square (x * x). * Added `math.orthonormal_basis` to compute an orthonormal basis from a single unit length vector. @@ -13,31 +20,32 @@ * Added `math.scaleMul` to scale rows of a float3x3 with scaling coefficients in a float3. * Added `AffineTransform` type. * Added `PI2`, `PIHALF`, `TAU`, `TODEGREES` and `TORADIANS` constants. + ### Changed * `asfloat(uint)`, `asuint(float)`, `asint(float)` and other related methods are now faster in mono without Burst. Other methods which use these will see a performance improvement. * Modified `quaternion.nlerp` to be branchless. * More descriptive parameter names for many methods in `math` class. * Made `Il2CppEagerStaticClassConstructionAttribute` internal to avoid conflicts with other definitions outside of the package. -### Deprecated -### Removed -### Fixed -## [1.2.5] - 2021-11-01 -### Added +## [1.2.6] - 2022-02-11 + ### Changed -### Deprecated -### Removed +* Made Il2CppEagerStaticClassConstructionAttribute internal to avoid conflicts with other definitions outside of the package. + +## [1.2.5] - 2021-11-01 + ### Fixed * Fixed property drawing when manually drawing a property that was hidden with [HideInInspector]. ## [1.2.4] - 2021-09-22 + ### Added * Added `[Il2CppEagerStaticClassConstruction]` to Unity.Mathematics types to run static constructors at startup. This improves IL2CPP performance slightly for types that have static constructors. + ### Changed * License file updated to satisfy Unity's package validation tests. * Changed noise documentation in comments to xmldoc comments. -### Deprecated -### Removed + ### Fixed * Fixed Equals(object) override which did not check type before casting. This could cause exceptions to be thrown when the object did not match the expected type. * Fixed incorrect `math.tzcnt` documentation which mentioned leading zero counts instead of trailing zero counts. @@ -46,10 +54,6 @@ ## [1.2.1] - 2020-08-06 -### Added -### Changed -### Deprecated -### Removed ### Fixed * Fixed warnings for meta files existing even though the files they represent did not exist. @@ -73,9 +77,6 @@ * Added some performance tests which can be run from the Unity test project. * Added `Random.CreateFromIndex()` to assist in creating Random instances from loop indices. -### Changed -### Deprecated -### Removed ### Fixed * Fixed documentation bug where `quaternion.RotateX/Y/Z` referred to a `float4x4` instead of quaternion. * Fixed code generation bugs which could cause Windows and Mac to generate different test code. diff --git a/src/Documentation~/4x4-matrices.md b/src/Documentation~/4x4-matrices.md new file mode 100644 index 00000000..266ec670 --- /dev/null +++ b/src/Documentation~/4x4-matrices.md @@ -0,0 +1,48 @@ +# 4×4 matrices + +To create a 4×4 transformation matrix, use the constructors in [`float4x4`](xref:Unity.Mathematics.float4x4) to assign one value to all elements of the matrix, or individually set all 16 elements directly: + + +```c# +// Unity Mathematics example +void Build4x4UnityMathematics() +{ + var c0 = new float4(1.0f, 0.0f, 0.0f, 0.0f); + var c1 = new float4(0.0f, 1.0f, 0.0f, 0.0f); + var c2 = new float4(0.0f, 0.0f, 1.0f, 0.0f); + var c3 = new float4(0.0f, 0.0f, 0.0f, 1.0f); + var m = new float4x4(c0, c1, c2, c3); +} +``` + +## Multiplying a 4×4 matrix + +Unity Mathematics and `UnityEngine` define the `*` operator differently. The `*` operator for [`float4x4`](xref:Unity.Mathematics.float4x4) implements componentwise multiplication. If you multiply a `float4x4` of all 1s with 0.5 on the diagonal, you get back the half identity because the upper and lower triangles of the matrix are multiplied by the respective zero entries from `f4x4_HalfIdentity`: + +```c# +// Unity Mathematics example +void OperatorMultiply4x4UnityMathematics() +{ + float4x4 result = f4x4_Ones * f4x4_HalfIdentity; + // result: + // 0.5, 0.0, 0.0, 0.0, + // 0.0, 0.5, 0.0, 0.0, + // 0.0, 0.0, 0.5, 0.0, + // 0.0, 0.0, 0.0, 0.5 +} +``` + +## Multiplying a 4×4 matrix and a 4D vector + +Use the [`math.mul`](xref:Unity.Mathematics.math.mul*) method to multiply a 4×4 matrix and a 4D vector. If you supply a `float4x4` as the first parameter and a `float4` as the second, it performs a 4×4 matrix multiplication with a 4×1 column vector, which returns a 4×1 column vector as a `float4`. + +`math.mul` can also multiply a 1×4 row vector by a 4×4 matrix to produce a 1×4 row vector by taking a `float4` as the first parameter and a `float4×4` as the second. Unity Mathematics stores the row vector in a `float4` and it isn't treated as a separate type. + +```c# +// Unity Mathematics example +void Multiply4x4AndVector4UnityMathematics() +{ + float4 result1 = math.mul(f4x4, f4); // 4x4 * 4x1 = 4x1 + float4 result2 = math.mul(f4, f4x4); // 1x4 * 4x4 = 1x4 +} +``` \ No newline at end of file diff --git a/src/Documentation~/TableOfContents.md b/src/Documentation~/TableOfContents.md new file mode 100644 index 00000000..1dc7d3b2 --- /dev/null +++ b/src/Documentation~/TableOfContents.md @@ -0,0 +1,8 @@ +* [Unity Mathematics](index.md) +* [Compatibility with Mathf](compatibility.md) +* [Getting started](getting-started.md) +* Common operations + * [4×4 matrices](4x4-matrices.md) + * [Vector multiplication](vector-multiplication.md) + * [Quaternion multiplication](quaternion-multiplication.md) + * [Random numbers](random-numbers.md) diff --git a/src/Documentation~/compatibility.md b/src/Documentation~/compatibility.md new file mode 100644 index 00000000..9113e0a4 --- /dev/null +++ b/src/Documentation~/compatibility.md @@ -0,0 +1,17 @@ +# Compatibility with `UnityEngine` mathematics + +If you want to Burst-compile your project, it's best practice to use the Unity Mathematics package by default and only use `Mathf` when necessary. Unity Mathematics isn't implemented in the same way as the [`UnityEngine.Mathf`](https://docs.unity3d.com/ScriptReference/Mathf.html) struct in the core Unity engine. Because of this, if your application relies on the specific behaviors of `Mathf`, you'll have to reimplement them to get similar behavior in Unity Mathematics. + +>[!IMPORTANT] +>For performance reasons, if your project uses the Mono compiler, you should continue to use the mathematical operations in `Mathf`, rather than Unity Mathematics. + +You can use both `Mathf` and Unity Mathematics methods in your project, but it might impact on the performance of your application because the conversions between the `UnityEngine` and `Unity.Mathematics` types such as `Vector3` to `float3` and vice-versa are performance-intensive. + +## Porting `UnityEngine` code to `Unity.Mathematics` + +If you want to migrate code from `UnityEngine` to `Unity.Mathematics`, you need to make the following changes first: + +* Update `UnityEngine` types to `Unity.Mathematics` types. For example, [`Vector4`](https://docs.unity3d.com/ScriptReference/Vector4.html) to [`float4`](xref:Unity.Mathematics.float4), and [`Quaternion`](https://docs.unity3d.com/ScriptReference/Quaternion.html) to [`quaternion`](xref:Unity.Mathematics.quaternion). These examples aren't exhaustive: see the [Scripting API reference](https://docs.unity3d.com/Packages/com.unity.mathematics@latest/index.html?subfolder=/api/index.html) for the full list of Unity Mathematics types available. +* Update any operators involved in matrices or vectors. For example, the `Matrix4x4` multiplication operator implements matrix multiplication, but the `float4x4` multiplication operator implements componentwise multiplication. +* Degrees to radians +* How your code generates random numbers. `Random` in `Unity.Mathematics` works differently to [`Random`](https://docs.unity3d.com/ScriptReference/Random.html) in `UnityEngine`. You can completely control random number generation with `Random` in `Unity.Mathematics`, and it's instanced, rather than static. It's also exclusive with its upper bound, which is important to bear in mind if you want to convert `UnityEngine` code which is sensitive to the bounds. For more information, see the documentation on [Random numbers](random-numbers.md). diff --git a/src/Documentation~/getting-started.md b/src/Documentation~/getting-started.md new file mode 100644 index 00000000..7ed246e5 --- /dev/null +++ b/src/Documentation~/getting-started.md @@ -0,0 +1,29 @@ +# Getting started + +To use Unity Mathematics, add `using Unity.Mathematics` to your code: + +```C# +using static Unity.Mathematics.math; +namespace MyNamespace +{ + using Unity.Mathematics; + + ... + var v1 = float3(1,2,3); + var v2 = float3(4,5,6); + v1 = normalize(v1); + v2 = normalize(v2); + var v3 = dot(v1, v2); + ... +} +``` + +## Naming convention + +In C# `int` and `float` are built-in types. The Burst compiler extends this set of built-in types to also include vectors, matrices, and quaternions. These types are built-in because the Burst compiler already has implementations of these types, and so can use them to generate better code than for custom types. + +To signify that these types are built-in their type names are in all lower case. The operators on these built-in types in [`Unity.Mathematics.math`](xref:Unity.Mathematics.math) are intrinsics and are always in lower case. + +There are no plans to extend the set of intrinsic types beyond the current set of vectors (`typeN`), matrices (`typeNxN`) and quaternions (`quaternion`). + +This convention has the added benefit of making the library highly compatible with shader code and makes porting or sharing code between the two almost frictionless. diff --git a/src/Documentation~/index.md b/src/Documentation~/index.md new file mode 100644 index 00000000..f158d0db --- /dev/null +++ b/src/Documentation~/index.md @@ -0,0 +1,27 @@ +# Unity Mathematics + +Unity Mathematics is a C# math library that provides vector types and math functions that have a shader-like +syntax, similar to [SIMD](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data) or [HLSL](https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl). The [Burst compiler](https://docs.unity3d.com/Packages/com.unity.burst@latest) uses Unity Mathematics to compile C#/IL code into highly efficient native code. + +It implements the following vector and matrix types: + +* floatN, quaternion +* float3×3, float4×4 + +Plus elementary functions: +* min, max, fabs, etc. +* sin, cos, sqrt, normalize, dot, cross, etc. + +## Installation + +You can install the Mathematics package through Unity's Package Manager. For more information, see the Unity User Manual documentation on [Adding and removing packages](https://docs.unity3d.com/Manual/upm-ui-actions.html). + +### Editor config + +Unity Mathematics uses [editorconfig](http://editorconfig.org/) to keep files formatted for EOL and spaces. + +Your IDE should have support for `editorconfig`. If it doesn't, you can get the extension for it here: + +* [VS2015/VS2017 EditorConfig extension](https://marketplace.visualstudio.com/items?itemName=EditorConfigTeam.EditorConfig) +* [Visual Studio Code EditorConfig extension](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) +* [SublimeText EditorConfig extension](https://github.com/sindresorhus/editorconfig-sublime) diff --git a/src/Documentation~/mathematics.md b/src/Documentation~/mathematics.md deleted file mode 100644 index 992642fc..00000000 --- a/src/Documentation~/mathematics.md +++ /dev/null @@ -1,79 +0,0 @@ -# Unity.Mathematics - -A C# math library providing vector types and math functions with a shader like -syntax. Used by the Burst compiler to compile C#/IL to highly efficient -native code. - -The main goal of this library is to provide a friendly Math API familiar to SIMD and graphic/shaders developers, using the well known `float4`, `float3` types...etc. with all intrinsics functions provided by a static class `math` that can be imported easily into your C# program with `using static Unity.Mathematics.math`. - -In addition to this, the Burst compiler is able to recognize these types and provide the optimized SIMD type for the running CPU on all supported platforms (x64, ARMv7a...etc.) - -NOTICE: The API is a work in progress and we may introduce breaking changes (API and underlying behavior) - -## Usage - -You can use this library in your Unity game by using the Package Manager and referencing the package `com.unity.mathematics`. See the forum [Welcome](https://forum.unity.com/threads/welcome.522627) page for more details. - -```C# -using static Unity.Mathematics.math; -namespace MyNamespace -{ - using Unity.Mathematics; - - ... - var v1 = float3(1,2,3); - var v2 = float3(4,5,6); - v1 = normalize(v1); - v2 = normalize(v2); - var v3 = dot(v1, v2); - ... -} -``` - -## Building - -Open the `src\Unity.Mathematics.sln` under Visual Studio 2015 or MonoDevelop and compile in Debug\Release. - -## Contributing - -We don't yet accept PR on this repository. See the FAQ below. - -The project is using [editorconfig](http://editorconfig.org/) to keep files correctly formatted for EOL and spaces. - -We assume that your IDE has support for `editorconfig`, you can download the following extensions if your IDE is listed: - -- [VS2015/VS2017 EditorConfig extension](https://marketplace.visualstudio.com/items?itemName=EditorConfigTeam.EditorConfig) -- [Visual Studio Code EditorConfig extension](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) -- [SublimeText EditorConfig extension](https://github.com/sindresorhus/editorconfig-sublime) - -## Frequently Asked Question - -### Why developing another Math library instead of using existing Unity Vector3...etc.? - -After years of feedback and experience with the previous API, we believe that providing an API that is closer to the way graphics developers have been using math libraries should better help its adoption and the ease of its usage. HLSL / GLSL math library is a very well designed, well understood math library leading to greater consistency. - -### Why not using `System.Numerics.Vectors`? - -Mainly for the reason mentioned above, `System.Numerics.Vectors` is in many ways similar to our previous Vector library (more object oriented than graphics programming oriented). -Also the fact that our Burst compiler is able to recognize a lot more patterns for SIMD types and math intrinsics makes it easier to work with a dedicated API that reflects this ability. - -### Naming convention - -In C# `int` and `float` are considered builtin types. Burst extends this set of bultin types to also include vectors, matrices and quaternions. These types are bultin in the sense that Burst knows about them and is be able to generate better code using these types than what would be possible with equivalent code using custom types. - -To signify that these types are bultin their type names are in all lower case. The operators on these bultin types found in `Unity.Mathematics.math` are considered intrinsics and are thus always in lower case. - -There are no plans to extend the set of intrinsic types beyond the current set of vectors (`typeN`), matrices (`typeNxN`) and quaternions (`quaternion`). - -This convention has the added benefit of making the library highly compatible with shader code and makes porting or sharing code between the two almost frictionless. - -### Why can't we send a PR yet? - -We are working on providing a Contributor License Agreement (CLA) with a sign-over functionality and our UCL License doesn't cover this yet. - -## Licensing - -Unity Companion License (“License”) Software Copyright © 2019 Unity Technologies ApS - -For licensing details see [LICENSE.md](LICENSE.md) - diff --git a/src/Documentation~/mathematics.md.meta b/src/Documentation~/mathematics.md.meta deleted file mode 100644 index 10f22f41..00000000 --- a/src/Documentation~/mathematics.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: d177df5c52517492b85d4191425323a9 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Documentation~/quaternion-multiplication.md b/src/Documentation~/quaternion-multiplication.md new file mode 100644 index 00000000..d6f70f4d --- /dev/null +++ b/src/Documentation~/quaternion-multiplication.md @@ -0,0 +1,17 @@ +# Quaternion multiplication + +To rotate a quaternion, use the [`AxisAngle`](xref:Unity.Mathematics.quaternion.AxisAngle*) method. You need to specify the axis of rotation and the angle of rotation, in that order. All are in radians rather than degrees. `math.mul` multiplies the quaternion, just as with [matrices](4x4-matrices.md) and vectors. + +```c# +// Unity Mathematics example +void QuaternionMultiplicationUnityMathematics() +{ + var axis = new float3(0.0f, 1.0f, 0.0f); + var q = quaternion.AxisAngle(axis,math.radians(45.0f)); + var orientation = quaternion.Euler( + math.radians(45.0f), + math.radians(90.0f), + math.radians(180.0f)); + var result = math.mul(q, orientation); +} +``` diff --git a/src/Documentation~/random-numbers.md b/src/Documentation~/random-numbers.md new file mode 100644 index 00000000..5a09e9d9 --- /dev/null +++ b/src/Documentation~/random-numbers.md @@ -0,0 +1,21 @@ +## Random numbers + +To generate random numbers, you must create and manage the random number generator state yourself with the [`Random`](xref:Unity.Mathematics.Random) struct. You can control the random number generator state explicitly, which is useful if you're using parallel code, or if you want to make sure that one source of random numbers is seeded differently than another source. You can also have as many `Random` instances as you like. + +Once you set up the state, use [`NextFloat`](xref:Unity.Mathematics.Random.NextFloat) to get random floats. By default it returns random numbers between `[0, 1)`, exclusive: + +```c# +// Unity Mathematics example +void RandomNumberUnityMathematics() +{ + // Choose some non-zero seed and set up the random number generator state. + uint seed = 1; + Unity.Mathematics.Random rng = new Unity.Mathematics.Random(seed); + + // [0, 1) exclusive + float randomFloat1 = rng.NextFloat(); + + // [-5, 5) exclusive + float randomFloat2 = rng.NextFloat(-5.0f, 5.0f); +} +``` diff --git a/src/Documentation~/vector-multiplication.md b/src/Documentation~/vector-multiplication.md new file mode 100644 index 00000000..123fe6bb --- /dev/null +++ b/src/Documentation~/vector-multiplication.md @@ -0,0 +1,16 @@ +# Vector multiplication + +To multiply vectors, use the `*`: + +```c# +// Unity Mathematics example +void ComponentwiseVectorMultiplyUnityMathematics() +{ + var v0 = new float4(2.0f, 4.0f, 6.0f, 8.0f); + var v1 = new float4(1.0f, -1.0f, 1.0f, -1.0f); + var result = v0 * v1; + // result == new float4(2.0f, -4.0f, 6.0f, -8.0f). +} +``` + +This is a common way of writing [SIMD](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data) code, which applies a single instruction to multiple data elements. Other operators such as addition, subtraction, and division work in the same way. \ No newline at end of file diff --git a/src/LICENSE.md b/src/LICENSE.md index a95cdfbe..1f5c0f44 100755 --- a/src/LICENSE.md +++ b/src/LICENSE.md @@ -1,4 +1,4 @@ -com.unity.mathematics copyright © 2022 Unity Technologies ApS +com.unity.mathematics copyright © 2023 Unity Technologies ApS Licensed under the Unity Companion License for Unity-dependent projects (see https://unity3d.com/legal/licenses/unity_companion_license). Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions. \ No newline at end of file diff --git a/src/Tests/Tests/Shared/TestAffineTransform.cs b/src/Tests/Tests/Shared/TestAffineTransform.cs index 460650cd..b663fd65 100644 --- a/src/Tests/Tests/Shared/TestAffineTransform.cs +++ b/src/Tests/Tests/Shared/TestAffineTransform.cs @@ -162,5 +162,12 @@ public static void affine_transform_transform_point() float3 txPt0 = transform(tx, pt); TestUtils.AreEqual(mPt0, txPt0, 0.0001f); } + + [TestCompiler] + public static void affine_transform_zero() + { + TestUtils.AreEqual(float3x3.zero, AffineTransform.zero.rs); + TestUtils.AreEqual(float3.zero, AffineTransform.zero.t); + } } -} \ No newline at end of file +} diff --git a/src/Tests/Tests/Shared/TestBool2.gen.cs b/src/Tests/Tests/Shared/TestBool2.gen.cs index 3546ddd3..11c32ff2 100644 --- a/src/Tests/Tests/Shared/TestBool2.gen.cs +++ b/src/Tests/Tests/Shared/TestBool2.gen.cs @@ -427,7 +427,7 @@ public static void bool2_operator_logical_not() TestUtils.AreEqual(r3, !a3); } - [TestCase] + [TestCase /* For player builds */] public static void bool2_EqualsObjectOverride() { TestUtils.IsFalse(new bool2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestBool2x2.gen.cs b/src/Tests/Tests/Shared/TestBool2x2.gen.cs index dbfd2fa1..1646031c 100644 --- a/src/Tests/Tests/Shared/TestBool2x2.gen.cs +++ b/src/Tests/Tests/Shared/TestBool2x2.gen.cs @@ -395,7 +395,7 @@ public static void bool2x2_operator_logical_not() TestUtils.AreEqual(r3, !a3); } - [TestCase] + [TestCase /* For player builds */] public static void bool2x2_EqualsObjectOverride() { TestUtils.IsFalse(new bool2x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestBool2x3.gen.cs b/src/Tests/Tests/Shared/TestBool2x3.gen.cs index e0f8f2d3..8157a008 100644 --- a/src/Tests/Tests/Shared/TestBool2x3.gen.cs +++ b/src/Tests/Tests/Shared/TestBool2x3.gen.cs @@ -395,7 +395,7 @@ public static void bool2x3_operator_logical_not() TestUtils.AreEqual(r3, !a3); } - [TestCase] + [TestCase /* For player builds */] public static void bool2x3_EqualsObjectOverride() { TestUtils.IsFalse(new bool2x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestBool2x4.gen.cs b/src/Tests/Tests/Shared/TestBool2x4.gen.cs index 4200e9ee..fdfdb454 100644 --- a/src/Tests/Tests/Shared/TestBool2x4.gen.cs +++ b/src/Tests/Tests/Shared/TestBool2x4.gen.cs @@ -395,7 +395,7 @@ public static void bool2x4_operator_logical_not() TestUtils.AreEqual(r3, !a3); } - [TestCase] + [TestCase /* For player builds */] public static void bool2x4_EqualsObjectOverride() { TestUtils.IsFalse(new bool2x4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestBool3.gen.cs b/src/Tests/Tests/Shared/TestBool3.gen.cs index e6b69c43..ee345f1e 100644 --- a/src/Tests/Tests/Shared/TestBool3.gen.cs +++ b/src/Tests/Tests/Shared/TestBool3.gen.cs @@ -431,7 +431,7 @@ public static void bool3_operator_logical_not() TestUtils.AreEqual(r3, !a3); } - [TestCase] + [TestCase /* For player builds */] public static void bool3_EqualsObjectOverride() { TestUtils.IsFalse(new bool3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestBool3x2.gen.cs b/src/Tests/Tests/Shared/TestBool3x2.gen.cs index d41f918c..816c30fd 100644 --- a/src/Tests/Tests/Shared/TestBool3x2.gen.cs +++ b/src/Tests/Tests/Shared/TestBool3x2.gen.cs @@ -395,7 +395,7 @@ public static void bool3x2_operator_logical_not() TestUtils.AreEqual(r3, !a3); } - [TestCase] + [TestCase /* For player builds */] public static void bool3x2_EqualsObjectOverride() { TestUtils.IsFalse(new bool3x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestBool3x3.gen.cs b/src/Tests/Tests/Shared/TestBool3x3.gen.cs index 4a2301d9..6c5b1b9b 100644 --- a/src/Tests/Tests/Shared/TestBool3x3.gen.cs +++ b/src/Tests/Tests/Shared/TestBool3x3.gen.cs @@ -395,7 +395,7 @@ public static void bool3x3_operator_logical_not() TestUtils.AreEqual(r3, !a3); } - [TestCase] + [TestCase /* For player builds */] public static void bool3x3_EqualsObjectOverride() { TestUtils.IsFalse(new bool3x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestBool3x4.gen.cs b/src/Tests/Tests/Shared/TestBool3x4.gen.cs index c0981361..8d7d6245 100644 --- a/src/Tests/Tests/Shared/TestBool3x4.gen.cs +++ b/src/Tests/Tests/Shared/TestBool3x4.gen.cs @@ -395,7 +395,7 @@ public static void bool3x4_operator_logical_not() TestUtils.AreEqual(r3, !a3); } - [TestCase] + [TestCase /* For player builds */] public static void bool3x4_EqualsObjectOverride() { TestUtils.IsFalse(new bool3x4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestBool4.gen.cs b/src/Tests/Tests/Shared/TestBool4.gen.cs index 69e823ab..c2c8be05 100644 --- a/src/Tests/Tests/Shared/TestBool4.gen.cs +++ b/src/Tests/Tests/Shared/TestBool4.gen.cs @@ -435,7 +435,7 @@ public static void bool4_operator_logical_not() TestUtils.AreEqual(r3, !a3); } - [TestCase] + [TestCase /* For player builds */] public static void bool4_EqualsObjectOverride() { TestUtils.IsFalse(new bool4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestBool4x2.gen.cs b/src/Tests/Tests/Shared/TestBool4x2.gen.cs index 0a2a54ca..40511294 100644 --- a/src/Tests/Tests/Shared/TestBool4x2.gen.cs +++ b/src/Tests/Tests/Shared/TestBool4x2.gen.cs @@ -395,7 +395,7 @@ public static void bool4x2_operator_logical_not() TestUtils.AreEqual(r3, !a3); } - [TestCase] + [TestCase /* For player builds */] public static void bool4x2_EqualsObjectOverride() { TestUtils.IsFalse(new bool4x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestBool4x3.gen.cs b/src/Tests/Tests/Shared/TestBool4x3.gen.cs index 8be23641..ea0d9fe2 100644 --- a/src/Tests/Tests/Shared/TestBool4x3.gen.cs +++ b/src/Tests/Tests/Shared/TestBool4x3.gen.cs @@ -395,7 +395,7 @@ public static void bool4x3_operator_logical_not() TestUtils.AreEqual(r3, !a3); } - [TestCase] + [TestCase /* For player builds */] public static void bool4x3_EqualsObjectOverride() { TestUtils.IsFalse(new bool4x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestBool4x4.gen.cs b/src/Tests/Tests/Shared/TestBool4x4.gen.cs index c83c5d8d..11b5e424 100644 --- a/src/Tests/Tests/Shared/TestBool4x4.gen.cs +++ b/src/Tests/Tests/Shared/TestBool4x4.gen.cs @@ -395,7 +395,7 @@ public static void bool4x4_operator_logical_not() TestUtils.AreEqual(r3, !a3); } - [TestCase] + [TestCase /* For player builds */] public static void bool4x4_EqualsObjectOverride() { TestUtils.IsFalse(new bool4x4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestDouble2.gen.cs b/src/Tests/Tests/Shared/TestDouble2.gen.cs index cd44e120..f07b51f5 100644 --- a/src/Tests/Tests/Shared/TestDouble2.gen.cs +++ b/src/Tests/Tests/Shared/TestDouble2.gen.cs @@ -1050,7 +1050,7 @@ public static void double2_shuffle_result_4() TestUtils.AreEqual(double4(2, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); } - [TestCase] + [TestCase /* For player builds */] public static void double2_EqualsObjectOverride() { TestUtils.IsFalse(new double2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestDouble2x2.gen.cs b/src/Tests/Tests/Shared/TestDouble2x2.gen.cs index c7fc90d5..5b035267 100644 --- a/src/Tests/Tests/Shared/TestDouble2x2.gen.cs +++ b/src/Tests/Tests/Shared/TestDouble2x2.gen.cs @@ -945,7 +945,7 @@ public static void double2x2_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void double2x2_EqualsObjectOverride() { TestUtils.IsFalse(new double2x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestDouble2x3.gen.cs b/src/Tests/Tests/Shared/TestDouble2x3.gen.cs index d95bba8d..0b5cb5cf 100644 --- a/src/Tests/Tests/Shared/TestDouble2x3.gen.cs +++ b/src/Tests/Tests/Shared/TestDouble2x3.gen.cs @@ -938,7 +938,7 @@ public static void double2x3_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void double2x3_EqualsObjectOverride() { TestUtils.IsFalse(new double2x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestDouble2x4.gen.cs b/src/Tests/Tests/Shared/TestDouble2x4.gen.cs index aac05afe..c519d6f4 100644 --- a/src/Tests/Tests/Shared/TestDouble2x4.gen.cs +++ b/src/Tests/Tests/Shared/TestDouble2x4.gen.cs @@ -940,7 +940,7 @@ public static void double2x4_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void double2x4_EqualsObjectOverride() { TestUtils.IsFalse(new double2x4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestDouble3.gen.cs b/src/Tests/Tests/Shared/TestDouble3.gen.cs index cc53ddbf..59b1478b 100644 --- a/src/Tests/Tests/Shared/TestDouble3.gen.cs +++ b/src/Tests/Tests/Shared/TestDouble3.gen.cs @@ -1057,7 +1057,7 @@ public static void double3_shuffle_result_4() TestUtils.AreEqual(double4(2, 5, 0, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightY)); } - [TestCase] + [TestCase /* For player builds */] public static void double3_EqualsObjectOverride() { TestUtils.IsFalse(new double3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestDouble3x2.gen.cs b/src/Tests/Tests/Shared/TestDouble3x2.gen.cs index 382e68b6..0fd677a3 100644 --- a/src/Tests/Tests/Shared/TestDouble3x2.gen.cs +++ b/src/Tests/Tests/Shared/TestDouble3x2.gen.cs @@ -938,7 +938,7 @@ public static void double3x2_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void double3x2_EqualsObjectOverride() { TestUtils.IsFalse(new double3x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestDouble3x3.gen.cs b/src/Tests/Tests/Shared/TestDouble3x3.gen.cs index 56364618..d066be3d 100644 --- a/src/Tests/Tests/Shared/TestDouble3x3.gen.cs +++ b/src/Tests/Tests/Shared/TestDouble3x3.gen.cs @@ -955,7 +955,7 @@ public static void double3x3_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void double3x3_EqualsObjectOverride() { TestUtils.IsFalse(new double3x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestDouble3x4.gen.cs b/src/Tests/Tests/Shared/TestDouble3x4.gen.cs index c54ef5be..03ea5969 100644 --- a/src/Tests/Tests/Shared/TestDouble3x4.gen.cs +++ b/src/Tests/Tests/Shared/TestDouble3x4.gen.cs @@ -944,7 +944,7 @@ public static void double3x4_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void double3x4_EqualsObjectOverride() { TestUtils.IsFalse(new double3x4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestDouble4.gen.cs b/src/Tests/Tests/Shared/TestDouble4.gen.cs index 2d907e2a..0344dae9 100644 --- a/src/Tests/Tests/Shared/TestDouble4.gen.cs +++ b/src/Tests/Tests/Shared/TestDouble4.gen.cs @@ -1064,7 +1064,7 @@ public static void double4_shuffle_result_4() TestUtils.AreEqual(double4(3, 7, 1, 5), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.LeftY, ShuffleComponent.RightY)); } - [TestCase] + [TestCase /* For player builds */] public static void double4_EqualsObjectOverride() { TestUtils.IsFalse(new double4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestDouble4x2.gen.cs b/src/Tests/Tests/Shared/TestDouble4x2.gen.cs index 0e02dc29..80b2e856 100644 --- a/src/Tests/Tests/Shared/TestDouble4x2.gen.cs +++ b/src/Tests/Tests/Shared/TestDouble4x2.gen.cs @@ -940,7 +940,7 @@ public static void double4x2_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void double4x2_EqualsObjectOverride() { TestUtils.IsFalse(new double4x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestDouble4x3.gen.cs b/src/Tests/Tests/Shared/TestDouble4x3.gen.cs index 66d6e952..6debf3f6 100644 --- a/src/Tests/Tests/Shared/TestDouble4x3.gen.cs +++ b/src/Tests/Tests/Shared/TestDouble4x3.gen.cs @@ -944,7 +944,7 @@ public static void double4x3_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void double4x3_EqualsObjectOverride() { TestUtils.IsFalse(new double4x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestDouble4x4.gen.cs b/src/Tests/Tests/Shared/TestDouble4x4.gen.cs index bd638617..3fcaff74 100644 --- a/src/Tests/Tests/Shared/TestDouble4x4.gen.cs +++ b/src/Tests/Tests/Shared/TestDouble4x4.gen.cs @@ -969,7 +969,7 @@ public static void double4x4_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void double4x4_EqualsObjectOverride() { TestUtils.IsFalse(new double4x4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestFloat2.gen.cs b/src/Tests/Tests/Shared/TestFloat2.gen.cs index b14288cc..885cbf2c 100644 --- a/src/Tests/Tests/Shared/TestFloat2.gen.cs +++ b/src/Tests/Tests/Shared/TestFloat2.gen.cs @@ -1050,7 +1050,7 @@ public static void float2_shuffle_result_4() TestUtils.AreEqual(float4(2, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); } - [TestCase] + [TestCase /* For player builds */] public static void float2_EqualsObjectOverride() { TestUtils.IsFalse(new float2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestFloat2x2.gen.cs b/src/Tests/Tests/Shared/TestFloat2x2.gen.cs index 5b818da7..b56dd1c0 100644 --- a/src/Tests/Tests/Shared/TestFloat2x2.gen.cs +++ b/src/Tests/Tests/Shared/TestFloat2x2.gen.cs @@ -945,7 +945,7 @@ public static void float2x2_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void float2x2_EqualsObjectOverride() { TestUtils.IsFalse(new float2x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestFloat2x3.gen.cs b/src/Tests/Tests/Shared/TestFloat2x3.gen.cs index 8a93998c..ee756468 100644 --- a/src/Tests/Tests/Shared/TestFloat2x3.gen.cs +++ b/src/Tests/Tests/Shared/TestFloat2x3.gen.cs @@ -938,7 +938,7 @@ public static void float2x3_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void float2x3_EqualsObjectOverride() { TestUtils.IsFalse(new float2x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestFloat2x4.gen.cs b/src/Tests/Tests/Shared/TestFloat2x4.gen.cs index d959a802..769a761e 100644 --- a/src/Tests/Tests/Shared/TestFloat2x4.gen.cs +++ b/src/Tests/Tests/Shared/TestFloat2x4.gen.cs @@ -940,7 +940,7 @@ public static void float2x4_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void float2x4_EqualsObjectOverride() { TestUtils.IsFalse(new float2x4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestFloat3.gen.cs b/src/Tests/Tests/Shared/TestFloat3.gen.cs index 48c5b1a4..29bbf5a0 100644 --- a/src/Tests/Tests/Shared/TestFloat3.gen.cs +++ b/src/Tests/Tests/Shared/TestFloat3.gen.cs @@ -1057,7 +1057,7 @@ public static void float3_shuffle_result_4() TestUtils.AreEqual(float4(2, 5, 0, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightY)); } - [TestCase] + [TestCase /* For player builds */] public static void float3_EqualsObjectOverride() { TestUtils.IsFalse(new float3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestFloat3x2.gen.cs b/src/Tests/Tests/Shared/TestFloat3x2.gen.cs index a497e7be..a9fcca5b 100644 --- a/src/Tests/Tests/Shared/TestFloat3x2.gen.cs +++ b/src/Tests/Tests/Shared/TestFloat3x2.gen.cs @@ -938,7 +938,7 @@ public static void float3x2_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void float3x2_EqualsObjectOverride() { TestUtils.IsFalse(new float3x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestFloat3x3.gen.cs b/src/Tests/Tests/Shared/TestFloat3x3.gen.cs index 37e72288..7561ab09 100644 --- a/src/Tests/Tests/Shared/TestFloat3x3.gen.cs +++ b/src/Tests/Tests/Shared/TestFloat3x3.gen.cs @@ -955,7 +955,7 @@ public static void float3x3_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void float3x3_EqualsObjectOverride() { TestUtils.IsFalse(new float3x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestFloat3x4.gen.cs b/src/Tests/Tests/Shared/TestFloat3x4.gen.cs index 57e75392..b688cda8 100644 --- a/src/Tests/Tests/Shared/TestFloat3x4.gen.cs +++ b/src/Tests/Tests/Shared/TestFloat3x4.gen.cs @@ -944,7 +944,7 @@ public static void float3x4_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void float3x4_EqualsObjectOverride() { TestUtils.IsFalse(new float3x4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestFloat4.gen.cs b/src/Tests/Tests/Shared/TestFloat4.gen.cs index eec3bd88..1e0d3ab1 100644 --- a/src/Tests/Tests/Shared/TestFloat4.gen.cs +++ b/src/Tests/Tests/Shared/TestFloat4.gen.cs @@ -1064,7 +1064,7 @@ public static void float4_shuffle_result_4() TestUtils.AreEqual(float4(3, 7, 1, 5), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.LeftY, ShuffleComponent.RightY)); } - [TestCase] + [TestCase /* For player builds */] public static void float4_EqualsObjectOverride() { TestUtils.IsFalse(new float4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestFloat4x2.gen.cs b/src/Tests/Tests/Shared/TestFloat4x2.gen.cs index ef36f471..9b0cd505 100644 --- a/src/Tests/Tests/Shared/TestFloat4x2.gen.cs +++ b/src/Tests/Tests/Shared/TestFloat4x2.gen.cs @@ -940,7 +940,7 @@ public static void float4x2_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void float4x2_EqualsObjectOverride() { TestUtils.IsFalse(new float4x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestFloat4x3.gen.cs b/src/Tests/Tests/Shared/TestFloat4x3.gen.cs index f14618d1..f2d4f21f 100644 --- a/src/Tests/Tests/Shared/TestFloat4x3.gen.cs +++ b/src/Tests/Tests/Shared/TestFloat4x3.gen.cs @@ -944,7 +944,7 @@ public static void float4x3_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void float4x3_EqualsObjectOverride() { TestUtils.IsFalse(new float4x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestFloat4x4.gen.cs b/src/Tests/Tests/Shared/TestFloat4x4.gen.cs index cc444939..1e706448 100644 --- a/src/Tests/Tests/Shared/TestFloat4x4.gen.cs +++ b/src/Tests/Tests/Shared/TestFloat4x4.gen.cs @@ -969,7 +969,7 @@ public static void float4x4_operator_postfix_dec() TestUtils.AreEqual(r3, a3--); } - [TestCase] + [TestCase /* For player builds */] public static void float4x4_EqualsObjectOverride() { TestUtils.IsFalse(new float4x4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestInt2.gen.cs b/src/Tests/Tests/Shared/TestInt2.gen.cs index 78c07923..75f6aba0 100644 --- a/src/Tests/Tests/Shared/TestInt2.gen.cs +++ b/src/Tests/Tests/Shared/TestInt2.gen.cs @@ -1334,7 +1334,7 @@ public static void int2_shuffle_result_4() TestUtils.AreEqual(int4(2, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); } - [TestCase] + [TestCase /* For player builds */] public static void int2_EqualsObjectOverride() { TestUtils.IsFalse(new int2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestInt2x2.gen.cs b/src/Tests/Tests/Shared/TestInt2x2.gen.cs index 517c4586..754451d3 100644 --- a/src/Tests/Tests/Shared/TestInt2x2.gen.cs +++ b/src/Tests/Tests/Shared/TestInt2x2.gen.cs @@ -1229,7 +1229,7 @@ public static void int2x2_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void int2x2_EqualsObjectOverride() { TestUtils.IsFalse(new int2x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestInt2x3.gen.cs b/src/Tests/Tests/Shared/TestInt2x3.gen.cs index e6b88941..8e25e359 100644 --- a/src/Tests/Tests/Shared/TestInt2x3.gen.cs +++ b/src/Tests/Tests/Shared/TestInt2x3.gen.cs @@ -1222,7 +1222,7 @@ public static void int2x3_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void int2x3_EqualsObjectOverride() { TestUtils.IsFalse(new int2x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestInt2x4.gen.cs b/src/Tests/Tests/Shared/TestInt2x4.gen.cs index f9650035..3fd7b8b3 100644 --- a/src/Tests/Tests/Shared/TestInt2x4.gen.cs +++ b/src/Tests/Tests/Shared/TestInt2x4.gen.cs @@ -1224,7 +1224,7 @@ public static void int2x4_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void int2x4_EqualsObjectOverride() { TestUtils.IsFalse(new int2x4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestInt3.gen.cs b/src/Tests/Tests/Shared/TestInt3.gen.cs index 29f8ec66..7dac46ed 100644 --- a/src/Tests/Tests/Shared/TestInt3.gen.cs +++ b/src/Tests/Tests/Shared/TestInt3.gen.cs @@ -1341,7 +1341,7 @@ public static void int3_shuffle_result_4() TestUtils.AreEqual(int4(2, 5, 0, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightY)); } - [TestCase] + [TestCase /* For player builds */] public static void int3_EqualsObjectOverride() { TestUtils.IsFalse(new int3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestInt3x2.gen.cs b/src/Tests/Tests/Shared/TestInt3x2.gen.cs index 11b9edb4..db159df9 100644 --- a/src/Tests/Tests/Shared/TestInt3x2.gen.cs +++ b/src/Tests/Tests/Shared/TestInt3x2.gen.cs @@ -1222,7 +1222,7 @@ public static void int3x2_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void int3x2_EqualsObjectOverride() { TestUtils.IsFalse(new int3x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestInt3x3.gen.cs b/src/Tests/Tests/Shared/TestInt3x3.gen.cs index e5b804e0..5d82264a 100644 --- a/src/Tests/Tests/Shared/TestInt3x3.gen.cs +++ b/src/Tests/Tests/Shared/TestInt3x3.gen.cs @@ -1239,7 +1239,7 @@ public static void int3x3_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void int3x3_EqualsObjectOverride() { TestUtils.IsFalse(new int3x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestInt3x4.gen.cs b/src/Tests/Tests/Shared/TestInt3x4.gen.cs index 254a797c..f9b43392 100644 --- a/src/Tests/Tests/Shared/TestInt3x4.gen.cs +++ b/src/Tests/Tests/Shared/TestInt3x4.gen.cs @@ -1228,7 +1228,7 @@ public static void int3x4_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void int3x4_EqualsObjectOverride() { TestUtils.IsFalse(new int3x4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestInt4.gen.cs b/src/Tests/Tests/Shared/TestInt4.gen.cs index 065bb609..3c712b61 100644 --- a/src/Tests/Tests/Shared/TestInt4.gen.cs +++ b/src/Tests/Tests/Shared/TestInt4.gen.cs @@ -1348,7 +1348,7 @@ public static void int4_shuffle_result_4() TestUtils.AreEqual(int4(3, 7, 1, 5), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.LeftY, ShuffleComponent.RightY)); } - [TestCase] + [TestCase /* For player builds */] public static void int4_EqualsObjectOverride() { TestUtils.IsFalse(new int4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestInt4x2.gen.cs b/src/Tests/Tests/Shared/TestInt4x2.gen.cs index 564c7aa7..8eaa8828 100644 --- a/src/Tests/Tests/Shared/TestInt4x2.gen.cs +++ b/src/Tests/Tests/Shared/TestInt4x2.gen.cs @@ -1224,7 +1224,7 @@ public static void int4x2_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void int4x2_EqualsObjectOverride() { TestUtils.IsFalse(new int4x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestInt4x3.gen.cs b/src/Tests/Tests/Shared/TestInt4x3.gen.cs index 6fdd2f07..c8662413 100644 --- a/src/Tests/Tests/Shared/TestInt4x3.gen.cs +++ b/src/Tests/Tests/Shared/TestInt4x3.gen.cs @@ -1228,7 +1228,7 @@ public static void int4x3_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void int4x3_EqualsObjectOverride() { TestUtils.IsFalse(new int4x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestInt4x4.gen.cs b/src/Tests/Tests/Shared/TestInt4x4.gen.cs index 87f3887b..408529a2 100644 --- a/src/Tests/Tests/Shared/TestInt4x4.gen.cs +++ b/src/Tests/Tests/Shared/TestInt4x4.gen.cs @@ -1253,7 +1253,7 @@ public static void int4x4_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void int4x4_EqualsObjectOverride() { TestUtils.IsFalse(new int4x4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestPlane.cs b/src/Tests/Tests/Shared/TestPlane.cs index 91e60044..2fbd3251 100644 --- a/src/Tests/Tests/Shared/TestPlane.cs +++ b/src/Tests/Tests/Shared/TestPlane.cs @@ -263,4 +263,4 @@ public static void CreateFromUnitNormalAndPointInPlane() TestUtils.AreEqual(expected, p.NormalAndDistance, Tolerance); } } -} \ No newline at end of file +} diff --git a/src/Tests/Tests/Shared/TestSvd.cs b/src/Tests/Tests/Shared/TestSvd.cs index f5ae195c..e75cf04f 100644 --- a/src/Tests/Tests/Shared/TestSvd.cs +++ b/src/Tests/Tests/Shared/TestSvd.cs @@ -182,4 +182,4 @@ public static void CanExtractSVDRotationFromFloat3x3With_ZeroScaleXY() TestUtils.AreEqual(0.0f, math.length(m0.c0 - m1.c0), k_SVDTolerance); } } -} \ No newline at end of file +} diff --git a/src/Tests/Tests/Shared/TestUint2.gen.cs b/src/Tests/Tests/Shared/TestUint2.gen.cs index 67c0813b..d853e034 100644 --- a/src/Tests/Tests/Shared/TestUint2.gen.cs +++ b/src/Tests/Tests/Shared/TestUint2.gen.cs @@ -1334,7 +1334,7 @@ public static void uint2_shuffle_result_4() TestUtils.AreEqual(uint4(2, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); } - [TestCase] + [TestCase /* For player builds */] public static void uint2_EqualsObjectOverride() { TestUtils.IsFalse(new uint2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestUint2x2.gen.cs b/src/Tests/Tests/Shared/TestUint2x2.gen.cs index a5f371ec..012db8aa 100644 --- a/src/Tests/Tests/Shared/TestUint2x2.gen.cs +++ b/src/Tests/Tests/Shared/TestUint2x2.gen.cs @@ -1229,7 +1229,7 @@ public static void uint2x2_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void uint2x2_EqualsObjectOverride() { TestUtils.IsFalse(new uint2x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestUint2x3.gen.cs b/src/Tests/Tests/Shared/TestUint2x3.gen.cs index d8aa9b0a..ac053495 100644 --- a/src/Tests/Tests/Shared/TestUint2x3.gen.cs +++ b/src/Tests/Tests/Shared/TestUint2x3.gen.cs @@ -1222,7 +1222,7 @@ public static void uint2x3_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void uint2x3_EqualsObjectOverride() { TestUtils.IsFalse(new uint2x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestUint2x4.gen.cs b/src/Tests/Tests/Shared/TestUint2x4.gen.cs index 7783684e..f9a8f210 100644 --- a/src/Tests/Tests/Shared/TestUint2x4.gen.cs +++ b/src/Tests/Tests/Shared/TestUint2x4.gen.cs @@ -1224,7 +1224,7 @@ public static void uint2x4_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void uint2x4_EqualsObjectOverride() { TestUtils.IsFalse(new uint2x4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestUint3.gen.cs b/src/Tests/Tests/Shared/TestUint3.gen.cs index 6fca57ce..6443db9b 100644 --- a/src/Tests/Tests/Shared/TestUint3.gen.cs +++ b/src/Tests/Tests/Shared/TestUint3.gen.cs @@ -1341,7 +1341,7 @@ public static void uint3_shuffle_result_4() TestUtils.AreEqual(uint4(2, 5, 0, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightY)); } - [TestCase] + [TestCase /* For player builds */] public static void uint3_EqualsObjectOverride() { TestUtils.IsFalse(new uint3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestUint3x2.gen.cs b/src/Tests/Tests/Shared/TestUint3x2.gen.cs index 106b90dc..0072a061 100644 --- a/src/Tests/Tests/Shared/TestUint3x2.gen.cs +++ b/src/Tests/Tests/Shared/TestUint3x2.gen.cs @@ -1222,7 +1222,7 @@ public static void uint3x2_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void uint3x2_EqualsObjectOverride() { TestUtils.IsFalse(new uint3x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestUint3x3.gen.cs b/src/Tests/Tests/Shared/TestUint3x3.gen.cs index 5861b8a2..9e91fc32 100644 --- a/src/Tests/Tests/Shared/TestUint3x3.gen.cs +++ b/src/Tests/Tests/Shared/TestUint3x3.gen.cs @@ -1239,7 +1239,7 @@ public static void uint3x3_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void uint3x3_EqualsObjectOverride() { TestUtils.IsFalse(new uint3x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestUint3x4.gen.cs b/src/Tests/Tests/Shared/TestUint3x4.gen.cs index 9832a2a7..4768c755 100644 --- a/src/Tests/Tests/Shared/TestUint3x4.gen.cs +++ b/src/Tests/Tests/Shared/TestUint3x4.gen.cs @@ -1228,7 +1228,7 @@ public static void uint3x4_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void uint3x4_EqualsObjectOverride() { TestUtils.IsFalse(new uint3x4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestUint4.gen.cs b/src/Tests/Tests/Shared/TestUint4.gen.cs index 49e0be49..8d0b8a6b 100644 --- a/src/Tests/Tests/Shared/TestUint4.gen.cs +++ b/src/Tests/Tests/Shared/TestUint4.gen.cs @@ -1348,7 +1348,7 @@ public static void uint4_shuffle_result_4() TestUtils.AreEqual(uint4(3, 7, 1, 5), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.LeftY, ShuffleComponent.RightY)); } - [TestCase] + [TestCase /* For player builds */] public static void uint4_EqualsObjectOverride() { TestUtils.IsFalse(new uint4().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestUint4x2.gen.cs b/src/Tests/Tests/Shared/TestUint4x2.gen.cs index 4cf1fc14..7f42bc6a 100644 --- a/src/Tests/Tests/Shared/TestUint4x2.gen.cs +++ b/src/Tests/Tests/Shared/TestUint4x2.gen.cs @@ -1224,7 +1224,7 @@ public static void uint4x2_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void uint4x2_EqualsObjectOverride() { TestUtils.IsFalse(new uint4x2().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestUint4x3.gen.cs b/src/Tests/Tests/Shared/TestUint4x3.gen.cs index 0bcde5e9..f750426b 100644 --- a/src/Tests/Tests/Shared/TestUint4x3.gen.cs +++ b/src/Tests/Tests/Shared/TestUint4x3.gen.cs @@ -1228,7 +1228,7 @@ public static void uint4x3_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void uint4x3_EqualsObjectOverride() { TestUtils.IsFalse(new uint4x3().Equals((object)new int())); diff --git a/src/Tests/Tests/Shared/TestUint4x4.gen.cs b/src/Tests/Tests/Shared/TestUint4x4.gen.cs index 67f34ee1..b9fc3f5e 100644 --- a/src/Tests/Tests/Shared/TestUint4x4.gen.cs +++ b/src/Tests/Tests/Shared/TestUint4x4.gen.cs @@ -1253,7 +1253,7 @@ public static void uint4x4_operator_bitwise_not() TestUtils.AreEqual(r3, ~a3); } - [TestCase] + [TestCase /* For player builds */] public static void uint4x4_EqualsObjectOverride() { TestUtils.IsFalse(new uint4x4().Equals((object)new int())); diff --git a/src/Tests/Tests/TestMath2.cs b/src/Tests/Tests/TestMath2.cs index 09e2d3a9..02b48ddb 100644 --- a/src/Tests/Tests/TestMath2.cs +++ b/src/Tests/Tests/TestMath2.cs @@ -1,6 +1,7 @@ using NUnit.Framework; using static Unity.Mathematics.math; using Burst.Compiler.IL.Tests; +using System; namespace Unity.Mathematics.Tests { @@ -59,5 +60,71 @@ public unsafe void hash_blob() } } } + + [TestCompiler] + public unsafe void hash_blob_unaligned() + { + byte[] testData = { + 0x0d, 0x26, 0x1c, 0xeb, 0x56, 0x3a, 0x9c, 0x18, 0x93, 0xb6, + 0xc1, 0x99, 0x5e, 0x04, 0x92, 0x4f, 0x6e, 0xb7, 0x42, 0x53, + 0x23, 0xcf, 0xe3, 0xbf, 0x16, 0x64, 0x79, 0x08, 0xc1, 0x01, + 0x43, 0x89, 0x73, 0x8f, 0x76, 0x22, 0x0c, 0xee, 0x9b, 0x80, + 0x31, 0x83, 0xce, 0x33, 0x8b, 0xc7, 0x3f, 0x94, 0x33 + }; + + uint[] resultsWithZeroSeed = + { + 0x02cc5d05, 0x376a5b3f, 0x8ae13198, 0xf5b14d72, 0xcc7ddc84, + 0x763e5905, 0x58759392, 0x6bccbd00, 0x7d0f80c8, 0xef01ae48, + 0xe40aa3ad, 0x805e04ad, 0xf98a471c, 0xdd960ac1, 0x76a71750, + 0xd35e2baa, 0x0219f7da, 0xd5bd1fbd, 0x5f28c87e, 0xfe6f7995, + 0x69a43ac5, 0xec1a1a15, 0x7ae9f103, 0x8d04a688, 0xce3b35be, + 0x6b3f040c, 0xd5ea2e8c, 0x6989e79c, 0x8772f1fb, 0x0d7b7bf6, + 0x0796214b, 0x98ea65c4, 0x3884dd82, 0x59632484, 0x91c92822, + 0x72d28404, 0x167061b0, 0x32adc2ef, 0xbac3e672, 0xd39936b7, + 0x94e2c154, 0x8b4ff46c, 0x68976fd4, 0x04bee59a, 0x2ed62c69, + 0xabee69fd, 0xda11e266, 0xcebd9d38, 0x28eea5fd, 0x0210d6ee + }; + + + uint[] resultsWith_0xeb69cf40_seed = + { + 0x12c3b280, 0x9bc1f68d, 0x2f900b51, 0xdb77e20e, 0xf6e8f561, + 0x3f3f72f6, 0x15f9700f, 0x28beb671, 0xceece5e1, 0x7a9b5c81, + 0x62a84642, 0xf75666af, 0x8939f8ca, 0x6b84792b, 0x527ee836, + 0xa0782090, 0xce6b9926, 0xa608c73b, 0xa08ee6a3, 0xab77a6b2, + 0x4e174e68, 0x596f10d5, 0xa14c4d85, 0x509ab88d, 0xd14698a4, + 0xbaad2308, 0xbd04c3df, 0x5715fed1, 0x5cf23a74, 0xd4e844f9, + 0x166dcfba, 0xe3495e37, 0x1b18b2b3, 0x2e8c2aab, 0x40993321, + 0x4b84998a, 0xd062937d, 0x1b2c9f7b, 0x8a613ed3, 0x70d71291, + 0x1af38ea4, 0x460cb7e9, 0xf806e3a9, 0xec9b6b2e, 0x9972a843, + 0x1ff06d2a, 0xe8c5007b, 0x37d8fc40, 0x0dc4f639, 0x36edff4f + }; + + byte* buffer = stackalloc byte[testData.Length + 1]; + fixed (byte* p = testData) + { + UIntPtr address = (UIntPtr)p; + bool isUnaligned = ((ulong)address & 1) > 0; + byte* unalignedPtr = buffer; + + if (!isUnaligned) + { + ++unalignedPtr; + } + + Buffer.MemoryCopy(p, unalignedPtr, testData.Length + 1, testData.Length); + + for (int i = 0; i < 50; ++i) + { + TestUtils.AreEqual(hash(unalignedPtr, i, 0), resultsWithZeroSeed[i]); + } + + for (int i = 0; i < 50; ++i) + { + TestUtils.AreEqual(hash(unalignedPtr, i, 0xeb69cf40), resultsWith_0xeb69cf40_seed[i]); + } + } + } } } diff --git a/src/Tests/Unity.Mathematics.Tests.asmdef b/src/Tests/Unity.Mathematics.Tests.asmdef index 6b374c8a..29a41728 100644 --- a/src/Tests/Unity.Mathematics.Tests.asmdef +++ b/src/Tests/Unity.Mathematics.Tests.asmdef @@ -1,13 +1,21 @@ { "name": "Unity.Mathematics.Tests", - "optionalUnityReferences": [ - "TestAssemblies" - ], + "rootNamespace": "", "references": [ - "Unity.Mathematics" + "Unity.Mathematics", + "UnityEngine.TestRunner" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll" ], - "includePlatforms": [ - "Editor" + "autoReferenced": false, + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" ], - "allowUnsafeCode": true -} + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/src/Tests/Unity.Mathematics.Tests.csproj b/src/Tests/Unity.Mathematics.Tests.csproj index 89872c1c..db3c9463 100644 --- a/src/Tests/Unity.Mathematics.Tests.csproj +++ b/src/Tests/Unity.Mathematics.Tests.csproj @@ -145,4 +145,4 @@ --> - \ No newline at end of file + diff --git a/src/Unity.Mathematics.CodeGen~/VectorGenerator.cs b/src/Unity.Mathematics.CodeGen~/VectorGenerator.cs index a6c203b3..c53afabc 100644 --- a/src/Unity.Mathematics.CodeGen~/VectorGenerator.cs +++ b/src/Unity.Mathematics.CodeGen~/VectorGenerator.cs @@ -2079,7 +2079,7 @@ private void BeginTest(StringBuilder str, string name, bool testCompiler = true) } else { - str.Append("\t\t[TestCase]\n"); + str.Append("\t\t[TestCase /* For player builds */]\n"); } str.AppendFormat("\t\tpublic static void {0}()\n", name); diff --git a/src/Unity.Mathematics.Editor/MatrixDrawer.cs b/src/Unity.Mathematics.Editor/MatrixDrawer.cs index 3f31a0c7..f59d2c91 100644 --- a/src/Unity.Mathematics.Editor/MatrixDrawer.cs +++ b/src/Unity.Mathematics.Editor/MatrixDrawer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using UnityEditor; @@ -23,10 +23,12 @@ namespace Unity.Mathematics.Editor [CustomPropertyDrawer(typeof(uint4x2)), CustomPropertyDrawer(typeof(uint4x3)), CustomPropertyDrawer(typeof(uint4x4))] class MatrixDrawer : PropertyDrawer { +#if !UNITY_2023_2_OR_NEWER public override bool CanCacheInspectorGUI(SerializedProperty property) { return false; } +#endif public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { diff --git a/src/Unity.Mathematics.Editor/PostNormalizedVectorDrawer.cs b/src/Unity.Mathematics.Editor/PostNormalizedVectorDrawer.cs index d4189eda..eaa2a07d 100644 --- a/src/Unity.Mathematics.Editor/PostNormalizedVectorDrawer.cs +++ b/src/Unity.Mathematics.Editor/PostNormalizedVectorDrawer.cs @@ -12,8 +12,10 @@ class PostNormalizedVectorDrawer : PrimitiveVectorDrawer { static class Content { - public static readonly string tooltip = - L10n.Tr("Values you enter will be post-normalized. You will see the normalized result if you change selection and view the values again."); + public static readonly GUIContent Tooltip = new ( + string.Empty, + L10n.Tr("Values you enter will be post-normalized. You will see the normalized result if you " + + "change selection and view the values again.")); } class VectorPropertyGUIData @@ -181,8 +183,12 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten return; } + // Avoid polluting the passed-in GUIContent - it might be static and shared. if (string.IsNullOrEmpty(label.tooltip)) - label.tooltip = Content.tooltip; + { + Content.Tooltip.text = label.text; + label = Content.Tooltip; + } guiData.RebuildIfDirty(); guiData.ApplyPreNormalizedValues(); diff --git a/src/Unity.Mathematics.Editor/PrimitiveVectorDrawer.cs b/src/Unity.Mathematics.Editor/PrimitiveVectorDrawer.cs index 28d8f47f..5353bdcb 100644 --- a/src/Unity.Mathematics.Editor/PrimitiveVectorDrawer.cs +++ b/src/Unity.Mathematics.Editor/PrimitiveVectorDrawer.cs @@ -1,4 +1,4 @@ -using System; +using System; using UnityEditor; using UnityEngine; @@ -36,18 +36,20 @@ static class Content public static readonly string doNotNormalizeCompatibility = L10n.Tr( $"{typeof(DoNotNormalizeAttribute).Name} only works with {typeof(quaternion)} and primitive vector types." ); - public static readonly string doNotNormalizeTooltip = - L10n.Tr("This value is not normalized, which may produce unexpected results."); + public static readonly GUIContent doNotNormalizeContent = new GUIContent("", + L10n.Tr("This value is not normalized, which may produce unexpected results.")); public static readonly GUIContent[] labels2 = { new GUIContent("X"), new GUIContent("Y") }; public static readonly GUIContent[] labels3 = { new GUIContent("X"), new GUIContent("Y"), new GUIContent("Z") }; public static readonly GUIContent[] labels4 = { new GUIContent("X"), new GUIContent("Y"), new GUIContent("Z"), new GUIContent("W") }; } +#if !UNITY_2023_2_OR_NEWER public override bool CanCacheInspectorGUI(SerializedProperty property) { return false; } +#endif public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { @@ -87,8 +89,10 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten } if (attribute is DoNotNormalizeAttribute && string.IsNullOrEmpty(label.tooltip)) - label.tooltip = Content.doNotNormalizeTooltip; - + { + Content.doNotNormalizeContent.text = label.text; + label = Content.doNotNormalizeContent; + } label = EditorGUI.BeginProperty(position, label, property); var valuesIterator = property.FindPropertyRelative(startIter); MultiPropertyField(position, subLabels, valuesIterator, label); diff --git a/src/Unity.Mathematics.PerformanceTests/TestHash.cs b/src/Unity.Mathematics.PerformanceTests/TestHash.cs new file mode 100644 index 00000000..106f451f --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestHash.cs @@ -0,0 +1,58 @@ +using Unity.Burst; +using Unity.PerformanceTesting; +using NUnit.Framework; +using Unity.Collections.LowLevel.Unsafe; +using System; +using UnityEngine; + +namespace Unity.Mathematics.PerformanceTests +{ + [BurstCompile] + partial class TestHash + { + static readonly long kBufferBytes = 1024 * 1024; + static readonly long kBytesToHash = kBufferBytes - 1; + static readonly uint kExpectedHash = 1781740882; + + [Test, Performance] + public static unsafe void HashAligned() + { + Assert.AreEqual(kExpectedHash, Hash(false)); + } + + [Test, Performance] + public static unsafe void HashUnaligned() + { + Assert.AreEqual(kExpectedHash, Hash(true)); + } + + [BurstCompile(CompileSynchronously = true)] + static unsafe uint Hash(bool useUnalignedBuffer) + { + var ptr = (ulong)(UIntPtr)UnsafeUtility.Malloc(kBufferBytes, 16, Collections.Allocator.Persistent); + var ulongptr = (ulong)ptr; + uint seed = 0; + + if (useUnalignedBuffer && ((ulongptr & 1) == 0)) + { + ++ulongptr; + } + + var buffer = (void*)ulongptr; + + for (int i = 0; i < kBytesToHash; ++i) + { + ((byte*)buffer)[i] = 123; + } + + for (int i = 0; i < 100; ++i) + { + seed = math.hash(buffer, (int)kBytesToHash, seed); + } + + UnsafeUtility.Free((void*)ptr, Collections.Allocator.Persistent); + + return seed; + } + } +} \ No newline at end of file diff --git a/src/Unity.Mathematics.PerformanceTests/TestHash.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestHash.cs.meta new file mode 100644 index 00000000..fcfb809b --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestHash.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c1a8761ebc1ffa240aa484721a63ba9f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.sln b/src/Unity.Mathematics.sln index 19d5c88a..2af7740a 100644 --- a/src/Unity.Mathematics.sln +++ b/src/Unity.Mathematics.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.29806.167 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Mathematics", "Unity.Mathematics\Unity.Mathematics.csproj", "{19810344-7387-4155-935F-BDD5CC61F0BF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Mathematics.CodeGen", "Unity.Mathematics.CodeGen\Unity.Mathematics.CodeGen.csproj", "{293EBCD6-CACD-4DA8-A518-FBC629268C0F}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "General", "General", "{B11ECCE1-1A78-40B2-956F-CBE615FF5DF9}" ProjectSection(SolutionItems) = preProject CHANGELOG.md = CHANGELOG.md @@ -16,6 +14,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "General", "General", "{B11E EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Mathematics.Tests", "Tests\Unity.Mathematics.Tests.csproj", "{2E7C74D3-42F1-482F-8BB7-E199D9E3B412}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Mathematics.CodeGen", "Unity.Mathematics.CodeGen~\Unity.Mathematics.CodeGen.csproj", "{293EBCD6-CACD-4DA8-A518-FBC629268C0F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -28,28 +28,16 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x64.ActiveCfg = Debug|x64 - {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x64.Build.0 = Debug|x64 + {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x64.ActiveCfg = Debug|Any CPU + {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x64.Build.0 = Debug|Any CPU {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x86.ActiveCfg = Debug|Any CPU {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x86.Build.0 = Debug|Any CPU {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|Any CPU.ActiveCfg = Release|Any CPU {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|Any CPU.Build.0 = Release|Any CPU - {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x64.ActiveCfg = Release|x64 - {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x64.Build.0 = Release|x64 + {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x64.ActiveCfg = Release|Any CPU + {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x64.Build.0 = Release|Any CPU {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x86.ActiveCfg = Release|Any CPU {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x86.Build.0 = Release|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x64.ActiveCfg = Debug|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x64.Build.0 = Debug|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x86.ActiveCfg = Debug|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x86.Build.0 = Debug|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|Any CPU.Build.0 = Release|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x64.ActiveCfg = Release|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x64.Build.0 = Release|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x86.ActiveCfg = Release|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x86.Build.0 = Release|Any CPU {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Debug|Any CPU.Build.0 = Debug|Any CPU {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -62,6 +50,18 @@ Global {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Release|x64.Build.0 = Release|Any CPU {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Release|x86.ActiveCfg = Release|Any CPU {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Release|x86.Build.0 = Release|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x64.ActiveCfg = Debug|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x64.Build.0 = Debug|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x86.ActiveCfg = Debug|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x86.Build.0 = Debug|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|Any CPU.Build.0 = Release|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x64.ActiveCfg = Release|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x64.Build.0 = Release|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x86.ActiveCfg = Release|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Unity.Mathematics/Geometry/MinMaxAABB.cs b/src/Unity.Mathematics/Geometry/MinMaxAABB.cs index eb4a3876..6b5b666d 100644 --- a/src/Unity.Mathematics/Geometry/MinMaxAABB.cs +++ b/src/Unity.Mathematics/Geometry/MinMaxAABB.cs @@ -16,7 +16,7 @@ namespace Unity.Mathematics.Geometry /// [System.Serializable] [Il2CppEagerStaticClassConstruction] - internal struct MinMaxAABB : IEquatable + public struct MinMaxAABB : IEquatable { /// /// The minimum point contained by the AABB. @@ -213,7 +213,7 @@ public override string ToString() } } - internal static partial class Math + public static partial class Math { /// /// Transforms the AABB with the given transform. diff --git a/src/Unity.Mathematics/Geometry/Plane.cs b/src/Unity.Mathematics/Geometry/Plane.cs index 92d47c5e..5094bb94 100644 --- a/src/Unity.Mathematics/Geometry/Plane.cs +++ b/src/Unity.Mathematics/Geometry/Plane.cs @@ -15,7 +15,7 @@ namespace Unity.Mathematics.Geometry [DebuggerDisplay("{Normal}, {Distance}")] [Serializable] [Il2CppEagerStaticClassConstruction] - internal struct Plane + public struct Plane { /// /// A plane in the form Ax + By + Cz + Dw = 0. diff --git a/src/Unity.Mathematics/Properties/AssemblyInfo.cs b/src/Unity.Mathematics/Properties/AssemblyInfo.cs index c090f5b4..582cdee0 100644 --- a/src/Unity.Mathematics/Properties/AssemblyInfo.cs +++ b/src/Unity.Mathematics/Properties/AssemblyInfo.cs @@ -1,47 +1,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -#if !UNITY_DOTSPLAYER -using System.Reflection; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("Unity.Mathematics")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Unity.Mathematics")] -[assembly: AssemblyCopyright("Copyright © 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM - -[assembly: Guid("19810344-7387-4155-935F-BDD5CC61F0BF")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -#endif - [assembly: InternalsVisibleTo("Unity.Mathematics.Tests")] [assembly: InternalsVisibleTo("Unity.Mathematics.PerformanceTests")] -[assembly: InternalsVisibleTo("btests")] \ No newline at end of file diff --git a/src/Unity.Mathematics/Properties/AssemblyInfo.cs.meta b/src/Unity.Mathematics/Properties/AssemblyInfo.cs.meta index 8b36ead0..048f3093 100644 --- a/src/Unity.Mathematics/Properties/AssemblyInfo.cs.meta +++ b/src/Unity.Mathematics/Properties/AssemblyInfo.cs.meta @@ -1,11 +1,2 @@ fileFormatVersion: 2 -guid: 512db12834bb1f645a5c18af6c16e398 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +guid: fb0d7ffc71c40bd49a849e6427f80cb5 \ No newline at end of file diff --git a/src/Unity.Mathematics/Unity.Mathematics.csproj b/src/Unity.Mathematics/Unity.Mathematics.csproj index 906c6011..6a97724f 100644 --- a/src/Unity.Mathematics/Unity.Mathematics.csproj +++ b/src/Unity.Mathematics/Unity.Mathematics.csproj @@ -1,164 +1,21 @@ - - - + - Debug - AnyCPU - {19810344-7387-4155-935F-BDD5CC61F0BF} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - Properties - Unity - Unity.Mathematics - v4.7.1 - 512 - - - AnyCPU - true - full - false - ..\..\build\bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - true - - - AnyCPU - pdbonly - true - ..\..\build\bin\Release\ - TRACE - prompt - 4 - true - true - - - AnyCPU - true - full - false - ..\..\build\bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - true - - + net471 AnyCPU - pdbonly - true - ..\..\build\bin\Release\ - TRACE - prompt - 4 true - true + false + ..\..\build\bin\$(Configuration)\ + + 1.0.0.0 - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + \ No newline at end of file diff --git a/src/Unity.Mathematics/affine_transform.cs b/src/Unity.Mathematics/affine_transform.cs index 33567b92..6ba30887 100644 --- a/src/Unity.Mathematics/affine_transform.cs +++ b/src/Unity.Mathematics/affine_transform.cs @@ -25,6 +25,11 @@ public struct AffineTransform : IEquatable, IFormattable /// An AffineTransform representing the identity transform. public static readonly AffineTransform identity = new AffineTransform(float3.zero, float3x3.identity); + /// + /// An AffineTransform zero value. + /// + public static readonly AffineTransform zero; + /// Constructs an AffineTransform from a translation represented by a float3 vector and rotation represented by a unit quaternion. /// The translation vector. /// The rotation quaternion. @@ -94,11 +99,13 @@ public AffineTransform(float4x4 m) /// Implicit float3x4 cast operator. /// The AffineTransform. + /// The converted AffineTransform. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static implicit operator float3x4(AffineTransform m) { return float3x4(m.rs.c0, m.rs.c1, m.rs.c2, m.t); } /// Implicit float4x4 cast operator. /// The AffineTransform. + /// The converted AffineTransform. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static implicit operator float4x4(AffineTransform m) { return float4x4(float4(m.rs.c0, 0f), float4(m.rs.c1, 0f), float4(m.rs.c2, 0f), float4(m.t, 1f)); } @@ -265,7 +272,7 @@ public static float3 transform(AffineTransform a, float3 pos) } /// Returns the inverse of an AffineTransform. - /// The AffineTransform to invert. + /// The AffineTransform to invert. /// The inverse AffineTransform. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static AffineTransform inverse(AffineTransform a) diff --git a/src/Unity.Mathematics/math.cs b/src/Unity.Mathematics/math.cs index f2ef33b7..a1b4800d 100644 --- a/src/Unity.Mathematics/math.cs +++ b/src/Unity.Mathematics/math.cs @@ -5514,6 +5514,7 @@ public static ulong reversebits(ulong x) /// Returns the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. /// Input value. /// The smallest power of two greater than or equal to the input. [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -5529,6 +5530,7 @@ public static int ceilpow2(int x) } /// Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. /// Input value. /// The componentwise smallest power of two greater than or equal to the input. [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -5544,6 +5546,7 @@ public static int2 ceilpow2(int2 x) } /// Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. /// Input value. /// The componentwise smallest power of two greater than or equal to the input. [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -5559,6 +5562,7 @@ public static int3 ceilpow2(int3 x) } /// Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. /// Input value. /// The componentwise smallest power of two greater than or equal to the input. [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -5575,6 +5579,7 @@ public static int4 ceilpow2(int4 x) /// Returns the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. /// Input value. /// The smallest power of two greater than or equal to the input. [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -5590,6 +5595,7 @@ public static uint ceilpow2(uint x) } /// Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. /// Input value. /// The componentwise smallest power of two greater than or equal to the input. [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -5605,6 +5611,7 @@ public static uint2 ceilpow2(uint2 x) } /// Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. /// Input value. /// The componentwise smallest power of two greater than or equal to the input. [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -5620,6 +5627,7 @@ public static uint3 ceilpow2(uint3 x) } /// Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. /// Input value. /// The componentwise smallest power of two greater than or equal to the input. [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -5636,6 +5644,7 @@ public static uint4 ceilpow2(uint4 x) /// Returns the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. /// Input value. /// The smallest power of two greater than or equal to the input. [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -5653,6 +5662,7 @@ public static long ceilpow2(long x) /// Returns the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. /// Input value. /// The smallest power of two greater than or equal to the input. [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -6694,12 +6704,19 @@ public static float4 chgsign(float4 x, float4 y) return asfloat(asuint(x) ^ (asuint(y) & 0x80000000)); } - /// Returns a uint hash from a block of memory using the xxhash32 algorithm. Can only be used in an unsafe context. - /// A pointer to the beginning of the data. - /// Number of bytes to hash. - /// Starting seed value. - /// The 32 bit hash of the input data buffer. - public static unsafe uint hash(void* pBuffer, int numBytes, uint seed = 0) + /// + /// Read 32 bits of data in little endian format. + /// + /// Memory address to read from. + /// 32 bits in little endian format. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static unsafe uint read32_little_endian(void* pBuffer) + { + byte* ptr = (byte*)pBuffer; + return (uint)ptr[0] | ((uint)ptr[1] << 8) | ((uint)ptr[2] << 16) | ((uint)ptr[3] << 24); + } + + private static unsafe uint hash_with_unaligned_loads(void* pBuffer, int numBytes, uint seed) { unchecked { @@ -6752,6 +6769,74 @@ public static unsafe uint hash(void* pBuffer, int numBytes, uint seed = 0) } } + private static unsafe uint hash_without_unaligned_loads(void* pBuffer, int numBytes, uint seed) + { + unchecked + { + const uint Prime1 = 2654435761; + const uint Prime2 = 2246822519; + const uint Prime3 = 3266489917; + const uint Prime4 = 668265263; + const uint Prime5 = 374761393; + + byte* p = (byte*)pBuffer; + uint hash = seed + Prime5; + if (numBytes >= 16) + { + uint4 state = new uint4(Prime1 + Prime2, Prime2, 0, (uint)-Prime1) + seed; + + int count = numBytes >> 4; + for (int i = 0; i < count; ++i) + { + var data = new uint4(read32_little_endian(p), read32_little_endian(p + 4), read32_little_endian(p + 8), read32_little_endian(p + 12)); + state += data * Prime2; + state = rol(state, 13); + state *= Prime1; + p += 16; + } + + hash = rol(state.x, 1) + rol(state.y, 7) + rol(state.z, 12) + rol(state.w, 18); + } + + hash += (uint)numBytes; + + for (int i = 0; i < ((numBytes >> 2) & 3); ++i) + { + hash += read32_little_endian(p) * Prime3; + hash = rol(hash, 17) * Prime4; + p += 4; + } + + for (int i = 0; i < ((numBytes) & 3); ++i) + { + hash += (*p++) * Prime5; + hash = rol(hash, 11) * Prime1; + } + + hash ^= hash >> 15; + hash *= Prime2; + hash ^= hash >> 13; + hash *= Prime3; + hash ^= hash >> 16; + + return hash; + } + } + + /// Returns a uint hash from a block of memory using the xxhash32 algorithm. Can only be used in an unsafe context. + /// A pointer to the beginning of the data. + /// Number of bytes to hash. + /// Starting seed value. + /// The 32 bit hash of the input data buffer. + public static unsafe uint hash(void* pBuffer, int numBytes, uint seed = 0) + { +#if !UNITY_64 && UNITY_ANDROID + return hash_without_unaligned_loads(pBuffer, numBytes, seed); +#else + return hash_with_unaligned_loads(pBuffer, numBytes, seed); +#endif + } + /// /// Unity's up axis (0, 1, 0). /// diff --git a/src/Unity.Mathematics/svd.cs b/src/Unity.Mathematics/svd.cs index b0a32112..d57e748a 100644 --- a/src/Unity.Mathematics/svd.cs +++ b/src/Unity.Mathematics/svd.cs @@ -7,7 +7,7 @@ namespace Unity.Mathematics // Computing the singular value decomposition of 3x3 matrices with minimal branching and elementary floating point operations, // A.McAdams, A.Selle, R.Tamstorf, J.Teran and E.Sifakis, University of Wisconsin - Madison technical report TR1690, May 2011 [Il2CppEagerStaticClassConstruction] - static class svd + static public class svd { [MethodImpl(MethodImplOptions.AggressiveInlining)] static void condSwap(bool c, ref float x, ref float y) @@ -151,7 +151,7 @@ static float3 rcpsafe(float3 x, float epsilon = k_EpsilonRCP) => math.select(math.rcp(x), float3.zero, math.abs(x) < epsilon); [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static float3x3 svdInverse(float3x3 a) + public static float3x3 svdInverse(float3x3 a) { var e = singularValuesDecomposition(a, out var u, out var v); var um = math.float3x3(u); @@ -161,7 +161,7 @@ internal static float3x3 svdInverse(float3x3 a) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static quaternion svdRotation(float3x3 a) + public static quaternion svdRotation(float3x3 a) { singularValuesDecomposition(a, out var u, out var v); return math.mul(u, math.conjugate(v)); diff --git a/src/package.json b/src/package.json index f99d7f78..5e0509b2 100755 --- a/src/package.json +++ b/src/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.mathematics", "displayName": "Mathematics", - "version": "1.2.5", + "version": "1.3.1", "unity": "2018.3", "description": "Unity's C# SIMD math library providing vector types and math functions with a shader like syntax.", "keywords": [