Fix msaa writeback prevents clear color - #25634
Conversation
46a4e02 to
acff97f
Compare
stuartparmenter
left a comment
There was a problem hiding this comment.
This looks right to me. Writeback only matters when the camera has ClearColorConfig::None, my check in #25479 was doing this the complicated way. I was looking at this further after that PR, but hadn't had a chance to file an issue or PR yet --
Can you look at these 3 things?
- Don't call
mark_as_clearedon the destination in the writeback. Nothing depends on it, and it's what causes the camera's clear to turn into a load. Removing it also fixesMsaaWriteback::Always, which drops the clear color today. - Fix the examples relying on the old behavior:
first_person_view_model,loading_screen, andui_target_camera. Each has a fullscreen camera on top with a default clear color, so with this change the top camera hides everything below it. SetClearColorConfig::Noneon those cameras, and remove the comment inui_target_camerathat says only the lowest camera clears. - Add a migration guide
ce59a72 to
57186bf
Compare
|
I made MSAA writeback never run if camera is not
|
Thanks, gating on A few things left:
|
This comment was marked as resolved.
This comment was marked as resolved.
I ran loading_screen on your branch and after the level loads I get a blank grey screen instead of the fox I see on main. The UI camera doesn't read the 3D content, but it's drawn into the same main texture and then alpha-blended over the window. The default clear color is opaque, so the clear covers the scene. Setting ClearColorConfig::None on that camera brings the fox back.
Auto skipping the first camera was the behavior before #23844. It seems like that PR added the None case to Auto because a single camera with ClearColorConfig::None and MSAA was throwing away its main texture, so your change would be reverting that fix. I'd rather Auto stay correct by default and Always be the odd one out, but maybe @tychedelia has an opinion here? |
Objective
Fixes #22453, extracted from #25226
Solution
Only run msaa writeback if camera clear color config is None.
It's OK because camera with
LoadOp::Clearwill clear the entire main texture thus writeback is useless.Testing
Run the example in #22453