Expose textures to ViewTarget::post_process_write() (#18348)

Extracted from my DLSS branch.

## Changelog
* Added `source_texture` and `destination_texture` to
`PostProcessWrite`, in addition to the existing texture views.
This commit is contained in:
JMS55 2025-03-17 11:22:06 -07:00 committed by GitHub
parent 5c3368fbcf
commit 0be1529d15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -615,7 +615,9 @@ pub struct ViewTargetAttachments(HashMap<NormalizedRenderTarget, OutputColorAtta
pub struct PostProcessWrite<'a> {
pub source: &'a TextureView,
pub source_texture: &'a Texture,
pub destination: &'a TextureView,
pub destination_texture: &'a Texture,
}
impl From<ColorGrading> for ColorGradingUniform {
@ -843,13 +845,17 @@ impl ViewTarget {
self.main_textures.b.mark_as_cleared();
PostProcessWrite {
source: &self.main_textures.a.texture.default_view,
source_texture: &self.main_textures.a.texture.texture,
destination: &self.main_textures.b.texture.default_view,
destination_texture: &self.main_textures.b.texture.texture,
}
} else {
self.main_textures.a.mark_as_cleared();
PostProcessWrite {
source: &self.main_textures.b.texture.default_view,
source_texture: &self.main_textures.b.texture.texture,
destination: &self.main_textures.a.texture.default_view,
destination_texture: &self.main_textures.a.texture.texture,
}
}
}