Merge agent/haze2: Pixel programs keep the console's early depth test (VICTORY_EARLY_DEPTH=1, off by default)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
commit
ac7a591601
5 files changed
+249
No files matched your search
@@ -977,6 +977,17 @@ extern "system" fn present(
|
||||
if frame >= 256 {
|
||||
let (hits, misses) = crate::shader_cache::counts();
|
||||
tracing::info!(hits, misses, "shaders from the cache and translated so far");
|
||||
// `VICTORY_EARLY_DEPTH`: what became of the console's early depth
|
||||
// test in the pixel programs translated so far.
|
||||
let [given, off, exports] = victory_shader::emit::early_depth_counts();
|
||||
if given + off + exports > 0 {
|
||||
tracing::info!(
|
||||
given,
|
||||
off,
|
||||
exports,
|
||||
"pixel programs translated so far whose console code tests depth before them: given the host's early test (VICTORY_EARLY_DEPTH=1), left with the late test (switch off), left with it as they write depth or stencil"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(all(windows, feature = "diagnostics"))]
|
||||
|
||||
@@ -84,6 +84,16 @@ fn build() -> [u8; 32] {
|
||||
}
|
||||
bytes.push(0);
|
||||
}
|
||||
// So is whether pixel programs keep the console's early depth test
|
||||
// (`VICTORY_EARLY_DEPTH=1`): only while it is on, so that the
|
||||
// translations cached without it are still served without it.
|
||||
if victory_shader::emit::early_depth() {
|
||||
tracing::info!(
|
||||
"VICTORY_EARLY_DEPTH=1: pixel programs whose console code tests depth before them get the host's early depth-stencil test"
|
||||
);
|
||||
bytes.extend_from_slice(b"VICTORY_EARLY_DEPTH=1");
|
||||
bytes.push(0);
|
||||
}
|
||||
// And which clean-up passes ran over the translated code.
|
||||
bytes.extend_from_slice(&victory_shader::emit::shader_opt().to_le_bytes());
|
||||
bytes
|
||||
|
||||
Reference in new issue
Block a user