Skip to content

Remove ExtractedView::hdr, add ExtractedView::texture_format, move compositing_space to ExtractedCamera#23734

Open
atlv24 wants to merge 5 commits intobevyengine:mainfrom
atlv24:ad/view-texture-format
Open

Remove ExtractedView::hdr, add ExtractedView::texture_format, move compositing_space to ExtractedCamera#23734
atlv24 wants to merge 5 commits intobevyengine:mainfrom
atlv24:ad/view-texture-format

Conversation

@atlv24
Copy link
Copy Markdown
Contributor

@atlv24 atlv24 commented Apr 9, 2026

Objective

Solution

  • Remove ExtractedView::hdr
  • Add ExtractedView::texture_format
  • Move ExtractedView::compositing_space to ExtractedCamera::compositing_space
  • Add texture_format to a bunch of specialization keys instead of hdr bool
  • Convert VolumetricFogPipelineKey to not use flags and just use bool and texture format

Testing

This needs a migration guide.

@atlv24 atlv24 added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 9, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Rendering Apr 9, 2026
@atlv24 atlv24 requested review from mate-h and tychedelia April 9, 2026 06:18
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

It looks like your PR is a breaking change, but you didn't provide a migration guide.

Please review the instructions for writing migration guides, then expand or revise the content in the migration guides directory to reflect your changes.

@jasmine-nominal
Copy link
Copy Markdown
Contributor

Can you add docs to ExtractedCamera/View clarifying the differences between them? (view can be any sort of rendering thing e.g. a shadow map, camera is stuff relevant to an actual camera)


/// Flags that specify features on the pipeline key.
flags: VolumetricFogPipelineKeyFlags,
texture_format: TextureFormat,
Copy link
Copy Markdown
Contributor

@IceSentry IceSentry Apr 9, 2026

Choose a reason for hiding this comment

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

Suggested change
texture_format: TextureFormat,
/// Texture format of the view target
texture_format: TextureFormat,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

there's some semantics I want to figure out before writing this comment, specifically with how Hdr overrides the window texture format and uses a different internal. Still thinking

Copy link
Copy Markdown
Contributor

@IceSentry IceSentry left a comment

Choose a reason for hiding this comment

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

I really like the direction of this PR, bit +1 from me once CI is passing.

Copy link
Copy Markdown
Member

@tychedelia tychedelia left a comment

Choose a reason for hiding this comment

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

Ty, this is a helpful step towards some other goals I have here. I'm wondering for a few of these passes where you switched to camera.hdr, is there a strong reason not to have them use the view target texture?

let mut view_key = MeshPipelineKey::from_msaa_samples(msaa.samples())
| MeshPipelineKey::from_hdr(view.hdr);
// HACK: we should be specializing by texture format, not bool hdr, but mesh pipeline keys have limited space.
let is_hdr = view.texture_format == ViewTarget::TEXTURE_FORMAT_HDR;
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.

hrm... yeah, don't love this. i think with how much we've improved specialization the cost of having a bigger mesh key would be worth investigating, it could totally be whatever

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah I think its fine, i think its the only iffy part. its not hard to have a followup yeet it and be independently benchmarked though

Copy link
Copy Markdown
Contributor

@beicause beicause Apr 10, 2026

Choose a reason for hiding this comment

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

but mesh pipeline keys have limited space.

Not really. In #22637 I made texture format a part of mesh key.

@mate-h
Copy link
Copy Markdown
Contributor

mate-h commented Apr 10, 2026

I like the direction you're proposing! very nice. Extracted views really shouldn't care about hdr or compositing space or not, cameras should. I did a bunch of research and testing for this PR and I tried fixing the 2d hdr bloom, 3d scene examples and also created a compositing space example. While trying not to reintroduce any of the antipatterns being cleaned up in this PR. atlv24#5

@beicause
Copy link
Copy Markdown
Contributor

beicause commented Apr 10, 2026

I hope we could put all webgpu renderable && blendable formats into the mesh pipeline key to reduce collisions with #22637. But I'm not against the current either.

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 M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

Hdr required to get rendertarget to respect TextureFormat

7 participants