Add mock-game capture/audio/hook stress test

mock_game_test launches coop_mock_game (DX11/DX12, frame-numbered A/V), injects
coop_hook.dll, opens the hook's shared video texture, and decodes the frame
number from the captured pixels to assert a monotonic, advancing mirror for
both backends (catches dropped/stale/out-of-order frames). Then it runs an
A/V + hook/unhook stress pass and confirms no crash + capture resumes. Adds a
read_pixel() readback to the shipping SharedTextureSource for the decode.
Robust to repeated/CI runs (kills stray games, retries inject). Trim the
roadmap (the mock-game item is done) and document the test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 05:22:20 +02:00
parent e2562ac63c
commit e608c6fb38
5 changed files with 518 additions and 11 deletions

View File

@@ -31,6 +31,12 @@ public:
// Drop the opened resources (target changed / mirror turned off).
void reset();
// Read the RGBA8 pixel at (x,y) of the last copied frame into out[4]. For verification
// (e.g. decoding the mock game's frame-number block in a capture test). Copies the
// private texture to a CPU-readable staging texture and maps it -- not a hot path.
// Returns false if no frame has been copied yet or the readback failed.
bool read_pixel(std::uint32_t x, std::uint32_t y, std::uint8_t out[4]);
[[nodiscard]] ID3D11ShaderResourceView* srv() const
{
return srv_.Get();