-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Use add_command_buffer_generation_task for transparent and transmissive 3D passes #20308
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?
Use add_command_buffer_generation_task for transparent and transmissive 3D passes #20308
Conversation
…ve 3D passes, matching the approach already used by MainOpaquePass3dNode. Needs review and brenchmarking
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.
A little hard to review the diff, but I think this looks good.
// NOTE: Scoped to drop the mutable borrow of render_context | ||
#[cfg(feature = "trace")] | ||
let _main_transmissive_pass_3d_span = info_span!("main_transmissive_pass_3d").entered(); | ||
|
||
if !transmissive_phase.items.is_empty() { |
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 should be an early return to reduce nesting. Nothing else happens if this check is false
); | ||
|
||
let render_pass = | ||
command_encoder.begin_render_pass(&RenderPassDescriptor { |
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 descriptor should be constructed once before the if steps > 0
. It's the same in both branches. That would probably help reduce the diff size too.
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.
A few nitpicks for the transmissive pass that should help make the code shorter/easier to review
Objective
Solution
Refactors
MainTransparentPass3dNode
andMainTransmissivePass3dNode
to use the async command buffer generation pattern withadd_command_buffer_generation_task()
, matching the approach already used byMainOpaquePass3dNode
.Changes:
This change should improve performance by allowing render command generation to happen in parallel rather than sequentially on the render thread.
Testing
Reviewers can test by:
transparency_3d
)