-
Notifications
You must be signed in to change notification settings - Fork 542
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
[Reminder]: expose Metal's render pass store action in public API? #563
Comments
Hmm, I wouldn't recommend this with any backend, two default passes in one frame is basically "undefined behaviour", it might work in some situations (or backends) but not in others. I think the reason why you're seeing a blank surface is the Line 10627 in 89b1b6b
You could try to replace this with With offscreen passes there's probably fewer problems (but I think the MSAA case still won't work because of the Metal store action that's used). I don't want to always do Ah PS: of course replacing this |
Ah nice! Thanks for the explanation. I used your tip (MTLStoreActionMultisampleResolve) and modified here at line 10680 instead of the spot you mentioned (that one was for offscreen rendering): bool is_msaa = _sg.desc.context.sample_count > 1;
pass_desc.colorAttachments[0].loadAction = _sg_mtl_load_action(action->colors[0].action);
pass_desc.colorAttachments[0].storeAction = is_msaa ? MTLStoreActionStoreAndMultisampleResolve :
MTLStoreActionStore; It is now fixed and behaves like no msaa mode and other graphics backends. And I checked, as far as I understood, you are discarding the drawable in |
Ah yeah right. I'll keep the ticket open as reminder (and change the title). I think it's better to give the API user more control over the store action, but I need to think about this a bit more. |
Sure thing, thanks for your support. |
Fixed via: #834 |
Is it possible to do two default passes with
sampleCount > 1
on Metal device ?I'm using
SG_ACTION_LOAD
for the second pass, but after the second one, drawable contents gets wiped with purple color. This behavior does not happen with other APIs (d3d11+GL).This is for example what I'm doing with sokol-triangle sample (with sampleCount = 4):
The text was updated successfully, but these errors were encountered: