-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Fix meshlet interactions with regular shading passes #13816
Conversation
@@ -162,7 +162,7 @@ impl ViewNode for PrepassNode { | |||
pass_span.end(&mut render_pass); | |||
drop(render_pass); | |||
|
|||
// Copy prepass depth to the main depth texture if deferred isn't going to | |||
// After rendering to the view depth texture, copy it to the prepass depth texture if deferred isn't going to |
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.
The comment makes sense for what the code does, but I'm not sure I understand when that would ever happen. If you use deferred + prepass, then you're using deferred so it will do the copy. If you just use the prepass without deferred, it should run before the main pass so I don't get why we would want to copy the view depth to the prepass depth. Shouldn't it be the other way around?
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.
Oh, is it because the meshlet prepass writes directly to the view depth?
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 think meshlets should be mentioned in that comment if that's the case.
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.
This is existing code, for the regular (non meshlet) prepass. We don't actually render directly to the prepass texture, we render to the view depth, and then copy the result into the prepass depth texture.
I was just updating the comment as it was inaccurate before.
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.
Oh, right, I remember now.
@@ -122,17 +122,17 @@ impl ViewNode for DeferredGBufferPrepassNode { | |||
let view_entity = graph.view_entity(); | |||
render_context.add_command_buffer_generation_task(move |render_device| { | |||
#[cfg(feature = "trace")] | |||
let _deferred_span = info_span!("deferred").entered(); | |||
let _deferred_span = info_span!("deferred_prepass").entered(); |
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.
Why the rename to add _prepass
everywhere?
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.
It was a bit confusing seeing "deferred" in the profiler. This made it a bit clearer, and matched the node name.
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 sure about the meshlet changes, but they are scoped to meshlet and shouldn't break anything outside
* Fixes #13813 * Fixes #13810 Tested a combined scene with both regular meshes and meshlet meshes with: * Regular forward setup * Forward + normal/motion vector prepasses * Deferred (with depth prepass since that's required) * Deferred + depth/normal/motion vector prepasses Still broken: * Using meshlet meshes rendering in deferred and regular meshes rendering in forward + depth/normal prepass. I don't know how to fix this at the moment, so for now I've just add instructions to not mix them.
Tested a combined scene with both regular meshes and meshlet meshes with:
Still broken: