Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions d3d12/crates/leonida-gpu/src/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3081,6 +3081,21 @@ impl State {
self.views_untold = false;
// (Clears the cache if the switch changed since the last call.)
self.cache.sync();
// The depth target a draw only tests, for the views of it that the
// draw's shaders read (`readable`). Primed before the textures picked
// by index are brought up to date: that pass reads a picked view of
// this target through `readable` too, and the state it leaves has to
// keep `SHADER_RESOURCE` (`State::prepare_for`).
// The bake list runs that same pass (`early_textures` → `heap_textures`
// on `bake_list`), so it can now record the combined-state barrier for
// this target too: the same state, tracked per list, and the draw's own
// list gets its transition in `prepare_for`.
let tested = if !compute && self.depth_state == DEPTH_READ {
self.depth
} else {
0
};
TESTED_DEPTH.set((tested, false));
// Textures picked by index, before anything asks for them.
self.early_textures(list, p, compute);
if crate::host::walls_trace() {
Expand Down Expand Up @@ -3137,14 +3152,6 @@ impl State {
self.host_roots = [0; 2];
self.cache.heaps_changed();
}
// The depth target a draw only tests, for the views of it that the
// draw's shaders read (`readable`).
let tested = if !compute && self.depth_state == DEPTH_READ {
self.depth
} else {
0
};
TESTED_DEPTH.set((tested, false));
let root = p.root.as_raw() as usize;
if self.host_roots[usize::from(compute)] != root {
// SAFETY: an open list and a live root signature.
Expand Down
Loading