Skip to content

Conversation

@JMS55
Copy link
Contributor

@JMS55 JMS55 commented Dec 13, 2025

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 samples after #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.

@JMS55 JMS55 added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels Dec 13, 2025
@JMS55 JMS55 added this to the 0.18 milestone Dec 13, 2025
@JMS55 JMS55 changed the title Solari: Dobule buffer prepass textures Solari: Double buffer prepass textures Dec 13, 2025
camera_commands.remove::<DeferredPrepass>();
}

if depth_prepass_double_buffer {
Copy link
Member

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();
Copy link
Member

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,
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@pablo-lua pablo-lua added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Dec 13, 2025
fn package_double_buffered_texture(
texture1: Option<CachedTexture>,
texture2: Option<CachedTexture>,
frame_count: u32,
Copy link
Contributor

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.

@ecoskey ecoskey added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants