You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is another unsound aspect of today's HAL that would be great to fix.
In begin_render_pass we receive an iterator over clear values. It's semantics currently matches Vulkan - a value per attachment, but not necessarily enough for all attachment, and some values are ignored. This is rather sad from the API standpoint, and we should fix it.
Perhaps, we could say that the iterator has to only contain the values for cleared attachments? Given that framebuffer/renderpass creation is rare, we could have the portability layer building a mask of cleared attachments, and then filter the given clear value slice based on that. Shouldn't introduce any visible overhead.
The text was updated successfully, but these errors were encountered:
My idea would be to have a key-value pair list, something like a Vec<(u32, ClearValueRaw)>, but it can be also a struct. The key would be the index of the attachment. This way you could build the VkRenderPassBeginInfo.pClearValues array without knowing the render pass. In my opinion it would be more explicit.
@kocsis1david that would certainly ease the life of gfx-portability a bit, at the cost of making the API a bit more verbose, but the user should already know these attachment indices, so it sounds like a good compromise.
2535: Attachment clear order API changes r=msiglreith a=kvark
Fixes#2248
PR checklist:
- [x] `make` succeeds (on *nix)
- [x] `make reftests` succeeds (after #2534)
- [ ] tested examples with the following backends: vulkan
- [ ] `rustfmt` run on changed code
Interestingly, DX11/12 backends were already treating the clear color iterator as specified for cleared attachments only (presumably because I implemented that and I was confused in the first place).
@msiglreith comments are welcome! I don't feel super strong either way, just want to make the semantics stronger.
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
This is another unsound aspect of today's HAL that would be great to fix.
In
begin_render_pass
we receive an iterator over clear values. It's semantics currently matches Vulkan - a value per attachment, but not necessarily enough for all attachment, and some values are ignored. This is rather sad from the API standpoint, and we should fix it.Perhaps, we could say that the iterator has to only contain the values for cleared attachments? Given that framebuffer/renderpass creation is rare, we could have the portability layer building a mask of cleared attachments, and then filter the given clear value slice based on that. Shouldn't introduce any visible overhead.
The text was updated successfully, but these errors were encountered: