-
Notifications
You must be signed in to change notification settings - Fork 2.1k
vk: fix update after bind (wrt descriptor set) validation error #9251
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
base: main
Are you sure you want to change the base?
Conversation
|
but if the image changed its colorspace, wouldnt that mean we got a new texture called with setParameter (not in the stream) which implies the frontend will create a new descriptor set? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, but pretty unfamliar with this code.
| mPipelineState.bindInDraw.first = false; | ||
| } | ||
| mDescriptorSetCache.commit(mCurrentRenderPass.commandBuffer, mPipelineState.pipelineLayout, | ||
| mDescriptorSetCache.commit(bufferHolder, mPipelineState.pipelineLayout, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a way this could behind a very fast "if unlikely"? I feel like commit is pretty heavy.
In filament, once a descriptor set is bound, we no longer make updates to it. However, this guarrantee was broken in the external sampler/image because a colorspace change might necessitate a layout change, and thereby a new descriptor needs to be generated with the appropriate externally sampled image updated in the new set. Another use case is the Stream API, where each frame we might be getting a different AHardwareBuffer, meaning we need to update one or multiple sampler bindings in a set that might have been bound in a previous frame. In this change, we always create a new set when there's a change in the image currently bound to an existing set (while accounting for whether we need to use a new externally sampled layout or not).
aef3d1d to
77b9913
Compare
| fvkmemory::resource_ptr<VulkanDescriptorSetLayout> layout, | ||
| OnRecycle&& onRecycleFn, VkDescriptorSet vkSet); | ||
|
|
||
| // NOLINTNEXTLINE(bugprone-exception-escape) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for this anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last time there was more validation errors, then before. We need to make sure those are fixed before merging this
In filament, once a descriptor set is bound, we no longer make updates
to it. However, this guarrantee was broken in the external sampler/image
because a colorspace change might necessitate a layout change, and
thereby a new descriptor needs to be generated with the appropriate
externally sampled image updated in the new set.
Another use case is the Stream API, where each frame we might be
getting a different AHardwareBuffer, meaning we need to update one
or multiple sampler bindings in a set that might have been bound in
a previous frame.
In this change, we always create a new set when there's a change
in the image currently bound to an existing set (while accounting for
whether we need to use a new externally sampled layout or not).