-
Notifications
You must be signed in to change notification settings - Fork 527
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
_sg_mtl_begin_pass: explicit store action for depth and stencil attachments (MTLStoreActionStore) #815
Conversation
This topic is coming up from time to time, and I think a better solution is to change the public API to better align with Metal and WebGPU, e.g. have separate load and store actions, e.g. see #563 |
I completely agree that it's much better to set pass store actions directly (and will be glad to implement it for #563 a bit later, if you don't mind :) ) but right now the behavior is different for OpenGL and Metal, it seems like a bug, is the behavior of such passes undefined in the current API version? |
Yeah, you're right, change of plans :) I would prefer however, if only offscreen render passes would need to store the depth/stencil buffer result. (e.g. only the first half of your PR, would this work for your case)? (PS: argh hit 'Send' too early) PPS: I wrote another ticket for how to revamp this whole area: #816 |
33886ea
to
66cac7b
Compare
…hments (MTLStoreActionStore) (non-default pass only)
66cac7b
to
7a07260
Compare
@floooh I guess the first half is perfectly fine, especially if two calls of default pass is undefined behavior :) Thank you for your attention :) |
I have committed your fix for offscreen render targets only here: e56c596 ...oops, I messed up the commit message, should be "performance point of view" :D As for the 'proper cleanup', I'll try to tackle this before coming back to finish the WebGPU backend (that's the next big thing on my list because it looks like WebGPu is now actually close to release). |
(ah sorry, I wasn't aware that you also fixed the PR) |
@floooh It's OK, you already mentioned me a couple of times, and also I'll be glad to do anything else later :) |
Sometimes two passes with different color attachments must share a depth or/and stencil buffers.
The default Metal action is "don't care" so that the buffers could be invalidated (and it happens on some iOS versions)
I suggest setting the default action to "store" to provide support of such passes.