HS: Calculate descriptor sets to publish
This still doesn't actually pass them to the publisher, but it's the next part. The type is right now.
There are some parts here where I did some quite klunky stopgaps. If it's OK I'd like to merge them now and then decide what they ought to look like. I hope @nickm will be able to advise.
Branch is on top of !1550 (merged)