-
Notifications
You must be signed in to change notification settings - Fork 345
Description
Now that we agreed that compute and graphics work should be started and ended explicitly, an open question is whether resource bindings can be bound outside of "compute / render passes" and inherited inside these passes.
D3D12
D3D12 doesn't have explicit bounds for graphics / compute work so be default root signature tables/descriptors/values are persistent. There are two root signatures, one for graphics and one for compute. Also the root signature is invalidated on a call to SetGraphicsRootSignature that changes the layout.
Overall when setting resource bindings outside of passes, we don't know if they should be put in the compute and graphics root signature, and they will in most cases be invalidated by a change to the root signature layout at the beginning of the pass. @kvark pointed out that in Vulkan (and all APIs) the functions binding resources know whether we bind to graphics or compute.
Metal
Bindings are set inside of the MTLComputeCommandEncoder and MTLRenderCommandEncoder and do not propagate outside of them.
Vulkan
Supports inheritance from outside render passes to inside.
Proposal
Given that both D3D12 and Metal do not support inheritance, and given that vkCmdBindDescriptorSet is usually multiple order of magnitudes cheaper than vkCmdBeginRenderPass, it sounds ok to not have inheritance and ask the app to all the bindings inside the passes.