-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Solari: Double buffer prepass textures #22102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| camera_commands.remove::<DeferredPrepass>(); | ||
| } | ||
|
|
||
| if depth_prepass_double_buffer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i hate that we still have to do this whole dance T_T
| let mut normal_textures = <HashMap<_, _>>::default(); | ||
| let mut deferred_textures = <HashMap<_, _>>::default(); | ||
| let mut deferred_textures1: HashMap<_, _> = <HashMap<_, _>>::default(); | ||
| let mut deferred_textures2: HashMap<_, _> = <HashMap<_, _>>::default(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a problem for this particular pr but kinda a bummer in render graph we can't easily reuse allocations via locals
| fn package_double_buffered_texture( | ||
| texture1: Option<CachedTexture>, | ||
| texture2: Option<CachedTexture>, | ||
| frame_count: u32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kinda minor, but i would prefer if this were just an atomic on the node rather than requiring a dependency on diagnostics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I suppose I can use a Local counter here... Technically it could get out of sync with FrameCount which other systems rely on for temporal stuff, but, should be fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do other people think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a user enables double-buffering on an odd frame, would there be a desync? Maybe worth keeping a separate counter in that case but might not be a problem at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be an issue idt. The order doesn't really matter.
I was more worried about what if we start running schedules at different rates, and different systems start thinking there's different frame counts.
| fn package_double_buffered_texture( | ||
| texture1: Option<CachedTexture>, | ||
| texture2: Option<CachedTexture>, | ||
| frame_count: u32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a user enables double-buffering on an odd frame, would there be a desync? Maybe worth keeping a separate counter in that case but might not be a problem at all.
Fixes Solari crashing with
Partial copy of 0..1600 on X dimension with size 3200 is not supported for the Source texture format Depth32Float with 1 samplesafter #21746.Also slightly better performance by avoiding the copy.
Code is extremely cludgy though, we're just piling hacks upon hacks for the prepass texture stuff.