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

Remove all the uniforms #345

Closed kvark closed 4 years ago

kvark commented 4 years ago

Currently, WebRender upstream has two uniforms that are lazily updated per program. We use push constants on some platforms and falling back to a separate descriptor set on Intel Linux, where push constants reveal a driver issue. I believe we can get away without using push constants completely.

u_projection - vertex transformation matrix. WebRender has it associated with the target, so we can safely move it into a constant buffer within the per-target descriptor set.

u_mode - the mode of operation, used mainly for text rendering. This is typically changed together with the blend mode. This means, we are doing bind_pipeline call. We might, therefore, just turn u_mode into a specialization constant for the pipelines. It may by itself improve performance.

With these removed, we are going to be left with no uniforms, so no need for push constants and their workarounds. Also, lighter draw calls :rocket:

kvark commented 4 years ago

Gecko cleanup - https://bugzilla.mozilla.org/show_bug.cgi?id=1608875

kvark commented 4 years ago

Fixed by #346