Hi there. I just updated from 2021.1.23f1 to 2021.2.0b15 and found the deferred feature. I was happy, that finally the lighting was working for me (using Hybrid Renderer V2).
But also every frame i get some errors, and i can’t figure out what it is. It looks like a timing issue to me, it cannot find a endsample than its missing it…
Any ideas? (when starting the scene)
Update: it seems just happening when the Profiler-Window is open. Closing it will not cause the errors… But still this is not good
Ah, perfect. Thanks for the fast response
Anyway i got a bad exception due to burst compile error, with no explains when trying to compile. So I downgraded already
The bugfix landed before those versions so what you are seeing must be a separate bug with the same symptoms. For us to be able to fix that, we’ll need a new bugreport, possibly even 2, one from each of you, in case those are separate issues. We do not have any details that would point us at what else is still broken here.
@Haapavuo as mentioned in a comment on the issue tracker page, the fix landed on 2021.2.12f1, so your version does not yet contain the fix. If you upgrade and still experience the same issue, a new bug report would also be needed from you for us to be able to fix the issue.
Also, thank you for bringing it up that there is still more here that needs fixing
To be clear, every instance where this error log resurfaces after being fixed is most definitely a new bug with a new source. It’s not like we don’t fix the same issue properly over and over, it’s a bug in the usage of the ProfilerMarker API that needs to be fixed whereever that API was used in the wrong way. That could be C# Editor or Engine code, or a package, or User code.
So if you checked that this is not happening due to something inyour code, please always file a new bug report for it, so that the respective team can fix the faulty usage.
Something that we do need to fix systematically is adding support for ProfilerMarker API to be able to span a scope over a call to async await. That would currently trigger this log.
Missing Profiler.EndSample (Every BeginSample call must have a subsequent EndSample call within the same frame): Gfx.UploadTexture
Previous 5 samples:
Gfx.UploadTexture
RenderLoop
Semaphore.WaitForSignal
Gfx.WaitForGfxCommandsFromMainThread
AsyncUploadManager.ScheduleAsyncCommands
In the scope:
Gfx.UploadTexture
RenderLoop
Non-matching Profiler.EndSample (Every EndSample call must have a preceding BeginSample call within the same frame): Gfx.UploadTexture
Previous 5 samples:
RenderLoop
Semaphore.WaitForSignal
Gfx.WaitForGfxCommandsFromMainThread
Gfx.UploadTexture
RenderLoop
In the scope:
RenderLoop
Missing Profiler.EndSample (Every BeginSample call must have a subsequent EndSample call within the same frame): Gfx.UploadTexture
Previous 5 samples:
Gfx.UploadTexture
RenderLoop
Semaphore.WaitForSignal
Gfx.WaitForGfxCommandsFromMainThread
Gfx.UploadTexture
In the scope:
Gfx.UploadTexture
RenderLoop
I had a very similar error (beginning with Non-matching Profiler.EndSample (Every EndSample call must have a preceding BeginSample call within the same frame)) while having the profiler open.
I was doing
context.Submit();```
inside my
```using (new ProfilingScope(cmd, profilingSampler))```
in
```Execute()```
and removing
```context.Submit();```
got rid of the error and did not impact anything visually.
I think you’re expecting this to allow some kind measurements that is async to the profiling scopes it happens within (and Update is auto instrumented but even if it was started in Update and ended in a non Auto-Instrumented function called from within Update, it would still mismatch on turning on Deep Profiling) like a stopwatch, but it isn’t. You need to close your profiling scopes in the same function where you started them, as you’re just adding your sample to a stack of samples.