Clear hybrid render targets before drawing#1572
Conversation
|
I've had bug reports for rendering "undefined buffer content" in Blitz (which in practice happened to be a stale render from another unrelated window!). But don't we want to allow for explicitly not clearing so that we can so incremental renders? |
|
WebGL clears in this case. This leads to wrong output when using it with compositor layers now. |
|
Gonna defer to Taj here. |
taj-p
left a comment
There was a problem hiding this comment.
This makes the WGPU implementation consistent with WebGL, which seems like a worthwhile thing to do!
Ultimately, I think it should be user configured (either a Load/Clear/DontCare enum) - we shouldn't be deciding whether a surface is cleared or not because, as Nico suggests, you could be building an incremental renderer (and it's expensive on low tier devices!).
yep. There is a lot of API work to do across Hybrid, CPU, Classic, and Imaging to have a coherent and possibly consistent story. |
This clears the hybrid WGPU render target before normal scene rendering.
The previous behavior assumed that the target contents were either undefined or irrelevant, which is often true for fresh swapchain images. But
Renderer::renderaccepts an arbitraryTextureView, and in practice it is also used with reused offscreen targets. In that case, transparent or otherwise untouched regions can retain pixels from an earlier frame.This PR does two things:
The atlas render path is left unchanged. This fix is only for the normal user-facing render target path.