The stand-in for the indirect light can bound what the air scatters (VICTORY_AMBIENT_AIR, off)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
localandClaude Opus 5.5 committed 2026-11-25 11:45:56 -06:00
1 parent 1316d0819d
commit 6c105a5e45
2 files changed
+79 -15

No files matched your search

+16 -5
View File
@@ -2623,7 +2623,7 @@ impl State {
/// The stand-in for the indirect light after a dispatch of `p`
/// (`crate::ambient`). Whether it recorded anything.
fn ambient(&self, list: &HostList, p: &HostPipeline, role: crate::ambient::Role) -> bool {
use crate::ambient::{DEPTH, LIGHT, RADIANCE, Role, Views};
use crate::ambient::{AIR, DEPTH, LIGHT, RADIANCE, Role, Views};
let Some(t) = p.stages.first().map(|s| s.translated()) else {
return false;
};
@@ -2651,10 +2651,15 @@ impl State {
let desc = unsafe { host.GetDesc() };
Some((desc, heap.gpu_handle((start + offset * 4) / 32)))
};
let image = entry(ResourceType::Uav, if role == Role::Resolve { LIGHT } else { RADIANCE });
let at = match role {
Role::Resolve => LIGHT,
Role::Radiance => RADIANCE,
Role::Air => AIR,
};
let image = entry(ResourceType::Uav, at);
let depth = match role {
Role::Resolve => entry(ResourceType::Srv, DEPTH),
Role::Radiance => image,
Role::Radiance | Role::Air => image,
};
let (Some((of, image)), Some((seen, depth))) = (image, depth) else {
once!(?role, "no stand-in for the indirect light: other tables");
@@ -2662,11 +2667,17 @@ impl State {
};
// (R32_UINT holding R9G9B9E5; R11G11B10_FLOAT.)
let format = if role == Role::Resolve { 42 } else { 26 };
if of.Format.0 != format || (seen.Width, seen.Height) != (of.Width, of.Height) {
let volume = of.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D;
if of.Format.0 != format || (seen.Width, seen.Height) != (of.Width, of.Height) || volume != (role == Role::Air) {
once!(?role, format = of.Format.0, "no stand-in for the indirect light: another image");
return false;
}
crate::ambient::after(list, role, &Views { image, depth, size: [of.Width as u32, of.Height] })
crate::ambient::after(list, role, &Views {
image,
depth,
size: [of.Width as u32, of.Height],
slices: u32::from(of.DepthOrArraySize),
})
}
/// What a draw or dispatch runs, for the device-removed report