Skip to content

Avoid creating a pass for main_transparent_pass_2d when unecessary#24850

Open
PJB3005 wants to merge 1 commit into
bevyengine:mainfrom
PJB3005:26-07-02-transparent-dont-run
Open

Avoid creating a pass for main_transparent_pass_2d when unecessary#24850
PJB3005 wants to merge 1 commit into
bevyengine:mainfrom
PJB3005:26-07-02-transparent-dont-run

Conversation

@PJB3005

@PJB3005 PJB3005 commented Jul 2, 2026

Copy link
Copy Markdown

Objective

  • Less CPU & GPU usage from an empty render pass

Solution

  • Move the if condition to earlier

Testing

  • Ran 2d_shapes and transparency_2d examples and it looks fine.

Showcase

tracy-profiler_iW4FEIsKxw

@mardzie mardzie left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me but I am not familiar with the broader context.

@beicause beicause left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

We already skipped empty render pass for 3d

if !transparent_phase.items.is_empty() {

transparent 3d doesn't skip the webgl2 workaround though, but this is fine (#24851).

@PJB3005

PJB3005 commented Jul 3, 2026

Copy link
Copy Markdown
Author

transparent 3d doesn't skip the webgl2 workaround though

Yeah I figured that'd be fine since we're not doing anything here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants