Skip to content
Merged
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
7 changes: 6 additions & 1 deletion tests/test_mem_trim.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ 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")
astc = block(tex, "bool upload_astc_gpu(")
copy = block(tex, "bool texture_copy_into_bc(")
need("if (!bc_scratch_layout(cmd, tex.bc_resized)) return false;" in astc,
"an ASTC upload does not check scratch allocation with its resize mode")
need("if (!bc_scratch_layout(cmd, dst->bc_resized)) return false;" in copy,
"a BC3 copy does not check scratch allocation with its destination resize mode")
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")
Expand Down
Loading