szeged / webrender

A GPU-based renderer for the web
https://doc.servo.org/webrender/
Mozilla Public License 2.0
45 stars 7 forks source link

Refactor descriptor set usage #291

Closed zakorgy closed 5 years ago

zakorgy commented 5 years ago

This is the first step to make the descriptor creation more transparent. Also this makes the pipeline layout creation more straightforward. Now that we have well defined DescriptorSetLayout's, as a follow up we can start use rendy-descriptor, and drop the descriptor module. This PR adds some validation layer errors because it's in a transition state: for pipeline_layouts we use DescriptorSetLayouts from the code, but for descriptor sets we still use the ones from the ron file which is generated by the build script. After we move to rendy-descriptor this will be fixed.

zakorgy commented 5 years ago

@kvark I have added combined image samplers and immutable samplers. Also added rendy-descriptor, and applied the descriptor reuse logic to all descriptor group. What is left I think is moving the PrevPass textures in a different set.

zakorgy commented 5 years ago

@kvark I think I have addressed most of your comments, and added a few TODO where work needs to be done, but it's outside of the scope of the current PR. Eventually we ended up with one descriptor set less, I moved the samplers from the sampler descriptor set into the per draw set. I still want to keep the Locals in a separate descriptor set, since it's optional, we only use it if we can't use push constants.

kvark commented 5 years ago

I haven't gone through the new code in detail. Let me know if there is a particular spot to review. We don't want too much churn on a PR and should move forward, addressing the non-critical concerns in follow-ups.