Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoadImageAsync fails to generate mipmaps #1

Closed
akioCL opened this issue Sep 22, 2021 · 6 comments
Closed

LoadImageAsync fails to generate mipmaps #1

akioCL opened this issue Sep 22, 2021 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@akioCL
Copy link

akioCL commented Sep 22, 2021

When trying to load an image using AsyncImageLoader.LoadImageAsync with default LoaderSettings, I get the following error:

"InvalidOperationException: The writeable UNKNOWN_OBJECT_TYPE FilterMipmapJob.outputMipmap is the same UNKNOWN_OBJECT_TYPE as FilterMipmapJob.inputMipmap, two containers may not be the same (aliasing)."

It seems to be related to the jobs that are creating the mipmaps.
I can workaround the issue by disabling mipmap generation.

Unity Version: 2021.2.0b4.3123 Personal

@Looooong
Copy link
Owner

I haven't tested with Unity 2021 yet. Probably, some changes with the Jobs System or Burst break filter mipmap job. I will take a look at this later.

@nickyonge
Copy link

Confirming that I'm getting this same behaviour on Unity 2020.3.1f1 Plus. Full stack trace:

InvalidOperationException: The writeable UNKNOWN_OBJECT_TYPE FilterMipmapJob.outputMipmap is the same UNKNOWN_OBJECT_TYPE as FilterMipmapJob.inputMipmap, two containers may not be the same (aliasing).
Unity.Jobs.LowLevel.Unsafe.JobsUtility.ScheduleParallelFor (Unity.Jobs.LowLevel.Unsafe.JobsUtility+JobScheduleParameters& parameters, System.Int32 arrayLength, System.Int32 innerloopBatchCount) (at <10564ed154d647e194bef4aef8878649>:0)
Unity.Jobs.IJobParallelForExtensions.Schedule[T] (T jobData, System.Int32 arrayLength, System.Int32 innerloopBatchCount, Unity.Jobs.JobHandle dependsOn) (at <10564ed154d647e194bef4aef8878649>:0)
AsyncImageLoader+ImageImporter.ProcessRawTextureData (Unity.Collections.NativeArray`1[T] rawTextureView, System.Int32 mipmapCount) (at Assets/UnityAsyncImageLoader/Runtime/ImageImporter.cs:228)
AsyncImageLoader+ImageImporter+<CreateNewTextureAsync>d__17.MoveNext () (at Assets/UnityAsyncImageLoader/Runtime/ImageImporter.cs:103)
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () (at <eae584ce26bc40229c1b1aa476bfa589>:0)
AsyncImageLoader+<CreateFromImageAsync>d__9.MoveNext () (at Assets/UnityAsyncImageLoader/Runtime/AsyncImageLoader.cs:105)
UnityEngine.Debug:LogException(Exception)
<CreateFromImageAsync>d__9:MoveNext() (at Assets/UnityAsyncImageLoader/Runtime/AsyncImageLoader.cs:108)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetException(Exception)
<CreateNewTextureAsync>d__17:MoveNext() (at Assets/UnityAsyncImageLoader/Runtime/ImageImporter.cs:106)
UnityEngine.UnitySynchronizationContext:ExecuteTasks()

@ookii-tsuki
Copy link

@Looooong was this fixed yet, because I'm still getting the same issue

@Looooong
Copy link
Owner

@Looooong was this fixed yet, because I'm still getting the same issue

Sorry, I haven't fixed this yet. PR is welcomed.

@Looooong
Copy link
Owner

@akioCL @nickyonge @ookii-tsuki I published a fix in version 0.1.2. I tested and it works in Unity 2021.2. If you are using Unity 2020 or 2021.1, can you check and see if it works for you as well?

@Looooong
Copy link
Owner

This is fixed, further improved and unit tested.

@Looooong Looooong self-assigned this Dec 15, 2022
@Looooong Looooong added the bug Something isn't working label Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants