diff --git a/tests/test_mem_trim.py b/tests/test_mem_trim.py index 67fa98f34..ec80f25b8 100644 --- a/tests/test_mem_trim.py +++ b/tests/test_mem_trim.py @@ -6,6 +6,7 @@ a floor, and the spare ones are counted out as well as in. python -I -B tests/test_mem_trim.py """ +import re from pathlib import Path ROOT = Path(__file__).resolve().parents[1] @@ -42,7 +43,9 @@ def main(): need(begin.index("r.streams.resize(1)") < begin.index("r.si = 0"), "the streams given back are used after") tex = (ROOT / "gpu/vk/vk_texture.cpp").read_text(encoding="utf-8") - need(tex.count("if (!bc_scratch_layout(cmd)) return false;") == 2, "a BC3 upload uses a scratch it did not ask for") + # (the second argument says the upload was encoded at an even size and needs the second scratch) + asks = re.findall(r"if \(!bc_scratch_layout\(cmd(?:, [\w.>-]+)?\)\) return false;", tex) + need(len(asks) == 2, "a BC3 upload uses a scratch it did not ask for") need("bc_have = false" in block(tex, "void bc_scratch_idle("), "the scratch given back is still taken for made") need("dead.push_back" in block(tex, "void bc_scratch_idle("), "the scratch is freed with no wait for the GPU") need("total_bytes -= std::min(total_bytes, tex.bytes + tex.pad)" in tex, "a texture leaves the budget by its texels only")