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

set metal resource labels - sokol_gfx.h #889

Closed
danielchasehooper opened this issue Sep 16, 2023 · 5 comments · Fixed by #890
Closed

set metal resource labels - sokol_gfx.h #889

danielchasehooper opened this issue Sep 16, 2023 · 5 comments · Fixed by #890

Comments

@danielchasehooper
Copy link
Contributor

It would be useful if all the .label strings were passed on to the underlying MTLResource's label property, for easier debugging in the Metal Debugger.

@floooh
Copy link
Owner

floooh commented Sep 17, 2023

Yes good idea, question is: only in debug mode, or also for release? I tend towards 'only in debug mode'.

@floooh
Copy link
Owner

floooh commented Sep 17, 2023

Ok, I'll only do it in debug mode. I also implemented sg_push/pop_debug_group(), but only inside a render pass (because these are MTLCommandEncoder methods in Metal).

In some cases I'm adding a post-fix to the label (where sokol-gfx may create multiple Metal objects for a single sokol-gfx object). For the texcube-sapp it looks like this:

Screenshot 2023-09-17 at 16 26 48

PS: also make sure to run your sokol-gfx frame inside an @autoreleasepool, not sure if I have mentioned that anywhere (sokol_app.h does this automatically).

I'll put the changes into a PR and close this ticket when merged.

@floooh
Copy link
Owner

floooh commented Sep 17, 2023

PR: #890

@floooh
Copy link
Owner

floooh commented Sep 17, 2023

Ok, fixed in a4d1119

@danielchasehooper
Copy link
Contributor Author

Awesome! Thank you! I was also thinking only in debug mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants