mapbox / mapbox-unity-sdk

Mapbox Unity SDK - https://www.mapbox.com/unity/
Other
725 stars 210 forks source link

Unity 6000.0.23f1 breaks the abstract map #1927

Closed liquidbuddha closed 1 month ago

liquidbuddha commented 1 month ago

Migrating from 2022.3.42f1 to Unity 6000.0.23f1 breaks the abstract map. Unable to render map tiles in the editor preview or during playback. Console stack trace is below.

Enabling the editor map preview or during runtime results in the following exceptions in each tile rendering.

Note that the material used (working In 2022.3.42f1) is URP / Lit.

Stack trace 1:

UnityException: Failed to create texture because of invalid parameters. UnityEngine.Texture2D.Internal_Create (UnityEngine.Texture2D mono, System.Int32 w, System.Int32 h, System.Int32 mipCount, UnityEngine.Experimental.Rendering.GraphicsFormat format, UnityEngine.TextureColorSpace colorSpace, UnityEngine.Experimental.Rendering.TextureCreationFlags flags, System.IntPtr nativeTex, System.Boolean ignoreMipmapLimit, System.String mipmapLimitGroupName) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Graphics/Texture.bindings.cs:245) UnityEngine.Texture2D..ctor (System.Int32 width, System.Int32 height, UnityEngine.TextureFormat textureFormat, System.Int32 mipCount, System.Boolean linear, System.IntPtr nativeTex, System.Boolean createUninitialized, UnityEngine.MipmapLimitDescriptor mipmapLimitDescriptor) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Graphics/Texture.cs:864) UnityEngine.Texture2D..ctor (System.Int32 width, System.Int32 height, UnityEngine.TextureFormat textureFormat, System.Boolean mipChain) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Graphics/Texture.cs:901) Mapbox.Unity.MeshGeneration.Data.UnityTile.SetRasterData (System.Byte[] data, System.Boolean useMipMap, System.Boolean useCompression) (at Assets/Mapbox/Unity/MeshGeneration/Data/UnityTile.cs:294) Mapbox.Unity.MeshGeneration.Factories.MapImageFactory.OnImageRecieved (Mapbox.Unity.MeshGeneration.Data.UnityTile tile, Mapbox.Map.RasterTile rasterTile) (at Assets/Mapbox/Unity/MeshGeneration/Factories/MapImageFactory.cs:71) ImageDataFetcher+<>c__DisplayClass2_0.b__0 () (at Assets/Mapbox/Unity/MeshGeneration/Factories/ImageDataFetcher.cs:49) Mapbox.Map.Tile.HandleTileResponse (Mapbox.Platform.Response response) (at Assets/Mapbox/Core/mapbox-sdk-cs/Map/Tile.cs:244) Mapbox.Platform.Cache.CachingWebFileSource.Request (System.String uri, System.Action1[T] callback, System.Int32 timeout, Mapbox.Map.CanonicalTileId tileId, System.String tilesetId) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/CachingWebFileSource.cs:166) Mapbox.Unity.MapboxAccess.Request (System.String url, System.Action1[T] callback, System.Int32 timeout, Mapbox.Map.CanonicalTileId tileId, System.String tilesetId) (at Assets/Mapbox/Unity/MapboxAccess.cs:234) Mapbox.Map.Tile.Initialize (Mapbox.Platform.IFileSource fileSource, Mapbox.Map.CanonicalTileId canonicalTileId, System.String tilesetId, System.Action p) (at Assets/Mapbox/Core/mapbox-sdk-cs/Map/Tile.cs:144) ImageDataFetcher.FetchData (DataFetcherParameters parameters) (at Assets/Mapbox/Unity/MeshGeneration/Factories/ImageDataFetcher.cs:35) Mapbox.Unity.MeshGeneration.Factories.MapImageFactory.OnRegistered (Mapbox.Unity.MeshGeneration.Data.UnityTile tile) (at Assets/Mapbox/Unity/MeshGeneration/Factories/MapImageFactory.cs:127) Mapbox.Unity.MeshGeneration.Factories.AbstractTileFactory.Register (Mapbox.Unity.MeshGeneration.Data.UnityTile tile) (at Assets/Mapbox/Unity/MeshGeneration/Factories/AbstractTileFactory.cs:71) Mapbox.Unity.Map.AbstractMapVisualizer.LoadTile (Mapbox.Map.UnwrappedTileId tileId) (at Assets/Mapbox/Unity/Map/AbstractMapVisualizer.cs:270) Mapbox.Unity.Map.AbstractMap.TileProvider_OnTileAdded (Mapbox.Map.UnwrappedTileId tileId) (at Assets/Mapbox/Unity/Map/AbstractMap.cs:657) Mapbox.Unity.Map.AbstractMap.TriggerTileRedrawForExtent (Mapbox.Unity.Map.TileProviders.ExtentArgs currentExtent) (at Assets/Mapbox/Unity/Map/AbstractMap.cs:936) Mapbox.Unity.Map.AbstractMap.OnMapExtentChanged (System.Object sender, Mapbox.Unity.Map.TileProviders.ExtentArgs currentExtent) (at Assets/Mapbox/Unity/Map/AbstractMap.cs:943) Mapbox.Unity.Map.TileProviders.AbstractTileProvider.OnExtentChanged () (at Assets/Mapbox/Unity/Map/TileProviders/AbstractTileProvider.cs:41) Mapbox.Unity.Map.TileProviders.RangeAroundTransformTileProvider.UpdateTileExtent () (at Assets/Mapbox/Unity/Map/TileProviders/RangeAroundTransformTileProvider.cs:54) Mapbox.Unity.Map.TileProviders.RangeAroundTransformTileProvider.UpdateTileProvider () (at Assets/Mapbox/Unity/Map/TileProviders/RangeAroundTransformTileProvider.cs:69) Mapbox.Unity.Map.AbstractMap.Update () (at Assets/Mapbox/Unity/Map/AbstractMap.cs:334)

Stack Trace 2:

Texture must have width greater than 0.

0 PlatformStacktrace::GetStacktrace(int)

1 DebugStringToFile(DebugStringToFileData const&)

2 Texture2D::InitTexture(int, int, GraphicsFormat, TextureColorSpace, TextureAssetCompression, TextureCreationFlags, int, int, long, TextureDimension, unsigned long, bool)

3 Texture2DScripting::Create(ScriptingObjectOfType, int, int, int, GraphicsFormat, TextureColorSpace, TextureCreationFlags, void*, bool, core::basic_string<char, core::StringStorageDefault> const&)

4 Texture2D_CUSTOM_Internal_CreateImpl(ScriptingBackendNativeObjectPtrOpaque, int, int, int, GraphicsFormat, TextureColorSpace, TextureCreationFlags, void, unsigned char, BindingsManagedSpan*)

5 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Texture2D:Internal_CreateImpl_Injected (UnityEngine.Texture2D,int,int,int,UnityEngine.Experimental.Rendering.GraphicsFormat,UnityEngine.TextureColorSpace,UnityEngine.Experimental.Rendering.TextureCreationFlags,intptr,bool,UnityEngine.Bindings.ManagedSpanWrapper&)

6 (Mono JIT Code) UnityEngine.Texture2D:Internal_CreateImpl (UnityEngine.Texture2D,int,int,int,UnityEngine.Experimental.Rendering.GraphicsFormat,UnityEngine.TextureColorSpace,UnityEngine.Experimental.Rendering.TextureCreationFlags,intptr,bool,string)

7 (Mono JIT Code) [Texture.bindings.cs:244] UnityEngine.Texture2D:Internal_Create (UnityEngine.Texture2D,int,int,int,UnityEngine.Experimental.Rendering.GraphicsFormat,UnityEngine.TextureColorSpace,UnityEngine.Experimental.Rendering.TextureCreationFlags,intptr,bool,string)

8 (Mono JIT Code) [Texture.cs:864] UnityEngine.Texture2D:.ctor (int,int,UnityEngine.TextureFormat,int,bool,intptr,bool,UnityEngine.MipmapLimitDescriptor)

9 (Mono JIT Code) [Texture.cs:901] UnityEngine.Texture2D:.ctor (int,int,UnityEngine.TextureFormat,bool)

10 (Mono JIT Code) [UnityTile.cs:294] Mapbox.Unity.MeshGeneration.Data.UnityTile:SetRasterData (byte[],bool,bool)

11 (Mono JIT Code) [MapImageFactory.cs:71] Mapbox.Unity.MeshGeneration.Factories.MapImageFactory:OnImageRecieved (Mapbox.Unity.MeshGeneration.Data.UnityTile,Mapbox.Map.RasterTile)

12 (Mono JIT Code) (wrapper delegate-invoke) System.Action`2<T1_REF, T2_REF>:invoke_void_T1_T2 (T1_REF,T2_REF)

13 (Mono JIT Code) [ImageDataFetcher.cs:49] ImageDataFetcher/<>c__DisplayClass2_0:b__0 ()

14 (Mono JIT Code) [Tile.cs:244] Mapbox.Map.Tile:HandleTileResponse (Mapbox.Platform.Response)

15 (Mono JIT Code) [CachingWebFileSource.cs:166] Mapbox.Platform.Cache.CachingWebFileSource:Request (string,System.Action`1,int,Mapbox.Map.CanonicalTileId,string)

16 (Mono JIT Code) [MapboxAccess.cs:234] Mapbox.Unity.MapboxAccess:Request (string,System.Action`1,int,Mapbox.Map.CanonicalTileId,string)

17 (Mono JIT Code) [Tile.cs:144] Mapbox.Map.Tile:Initialize (Mapbox.Platform.IFileSource,Mapbox.Map.CanonicalTileId,string,System.Action)

18 (Mono JIT Code) [ImageDataFetcher.cs:35] ImageDataFetcher:FetchData (DataFetcherParameters)

19 (Mono JIT Code) [MapImageFactory.cs:127] Mapbox.Unity.MeshGeneration.Factories.MapImageFactory:OnRegistered (Mapbox.Unity.MeshGeneration.Data.UnityTile)

20 (Mono JIT Code) [AbstractTileFactory.cs:71] Mapbox.Unity.MeshGeneration.Factories.AbstractTileFactory:Register (Mapbox.Unity.MeshGeneration.Data.UnityTile)

21 (Mono JIT Code) [AbstractMapVisualizer.cs:270] Mapbox.Unity.Map.AbstractMapVisualizer:LoadTile (Mapbox.Map.UnwrappedTileId)

22 (Mono JIT Code) [AbstractMap.cs:657] Mapbox.Unity.Map.AbstractMap:TileProvider_OnTileAdded (Mapbox.Map.UnwrappedTileId)

23 (Mono JIT Code) [AbstractMap.cs:936] Mapbox.Unity.Map.AbstractMap:TriggerTileRedrawForExtent (Mapbox.Unity.Map.TileProviders.ExtentArgs)

24 (Mono JIT Code) [AbstractMap.cs:943] Mapbox.Unity.Map.AbstractMap:OnMapExtentChanged (object,Mapbox.Unity.Map.TileProviders.ExtentArgs)

25 (Mono JIT Code) [AbstractTileProvider.cs:41] Mapbox.Unity.Map.TileProviders.AbstractTileProvider:OnExtentChanged ()

26 (Mono JIT Code) [RangeAroundTransformTileProvider.cs:54] Mapbox.Unity.Map.TileProviders.RangeAroundTransformTileProvider:UpdateTileExtent ()

27 (Mono JIT Code) [RangeAroundTransformTileProvider.cs:69] Mapbox.Unity.Map.TileProviders.RangeAroundTransformTileProvider:UpdateTileProvider ()

28 (Mono JIT Code) [AbstractMap.cs:334] Mapbox.Unity.Map.AbstractMap:Update ()

29 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_voidthis (object,intptr,intptr,intptr)

30 mono_jit_runtime_invoke

31 do_runtime_invoke

32 mono_runtime_invoke

33 scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)

34 ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)

35 MonoBehaviour::CallMethodIfAvailable(int)

36 MonoBehaviour::CallUpdateMethod(int)

37 void BaseBehaviourManager::CommonUpdate()

38 BehaviourManager::Update()

39 InitPlayerLoopCallbacks()::UpdateScriptRunBehaviourUpdateRegistrator::Forward()

40 ExecutePlayerLoop(NativePlayerLoopSystem*)

41 ExecutePlayerLoop(NativePlayerLoopSystem*)

42 PlayerLoop()

43 EditorPlayerLoop::Execute()

44 PlayerLoopController::InternalUpdateScene(bool, bool)

45 PlayerLoopController::UpdateSceneIfNeededFromMainLoop()

46 Application::TickTimer()

47 -[EditorApplication onEditorUpdatesTickTimer]

48 __NSFireTimer

49 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION

50 __CFRunLoopDoTimer

51 __CFRunLoopDoTimers

52 __CFRunLoopRun

53 CFRunLoopRunSpecific

54 RunCurrentEventLoopInMode

55 ReceiveNextEventCommon

56 _BlockUntilNextEventMatchingListInModeWithFilter

57 _DPSNextEvent

58 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]

59 -[NSApplication run]

60 NSApplicationMain

61 EditorMain(int, char const**)

62 main

63 start

liquidbuddha commented 1 month ago

Looks like this is a duplicate Issue case. Closing.