Missing Profiler.EndSample

Version 6000.0.23f (updated it to .34f)

I’ve built a UI in a scene and I get this message on some of my images (saved as Sprites 2D, see picture):

Non-matching Profiler.EndSample (Every EndSample call must have a preceding BeginSample call within the same frame): Gfx.UploadTexture
Previous 5 samples:
Gfx.CreateTexture
RenderLoop
Semaphore.WaitForSignal
Gfx.WaitForGfxCommandsFromMainThread
Gfx.UploadTexture
In the scope:
RenderLoop

I first thought enabling Read/Write would solve this issue but that didn’t fix it. Also strange, it doesn’t happen every time. Sometimes everything works as usual.

I never saw this error and am kinda lost. Does anyone know why this happens?

This is an internal bug and has nothing to do with your settings. Only if this is from your script, it’s your issue.
Please update Unity

1 Like

I’ve updated from 6000.0.23f to 6000.0.34f (the latest) and the problem still exists. Are you sure this is a bug?

No, I have no scripts that handle any Texture or Sprite settings. Just Ressource.Load for image path in my editor script

This isn’t a 2D or XR thing, this profiler marker is related to the GFX device stuff (looks like it’s used in a GFX worker thread) when it’s processing a GFX command uploading a texture. Not my area though so I cannot advise further but it’s definately a bug in the profiler/GFX stuff.

I’d say report it as a bug and in the very least, add the callstack you’re seeing.

2 Likes

I think this is an internal Unity bug. I am also seeing this on the latest version of Unity 6 (6000.0.34)

File a bug report and report the ID here.
Not sure if OP reported it, so link this thread in the report so QA can check

My project is very large and not suitable to upload for bug reproduction, but I will try to create a project with the bare essentials to reproduce the bug.

Have you searched all C# scripts in your project to make sure you don’t have something calling Profiler.BeginSample() without a matching call to Profiler.EndSample()?

This was fixed as of 6000.0.35f1

1 Like