From 0be1529d15aa6b0ef245ce3b8181fa4f9f8fc7b2 Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Mon, 17 Mar 2025 11:22:06 -0700 Subject: [PATCH] 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. --- crates/bevy_render/src/view/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/bevy_render/src/view/mod.rs b/crates/bevy_render/src/view/mod.rs index 41329c41b7..11864cc10e 100644 --- a/crates/bevy_render/src/view/mod.rs +++ b/crates/bevy_render/src/view/mod.rs @@ -615,7 +615,9 @@ pub struct ViewTargetAttachments(HashMap { pub source: &'a TextureView, + pub source_texture: &'a Texture, pub destination: &'a TextureView, + pub destination_texture: &'a Texture, } impl From 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, } } }