mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-28 02:56:36 -04:00
84dbc2982a
Windowed high-resolution mode kept one window over the union of displayed columns. Two 512-wide buffers side by side need 18432 px at 18x, past a 16384 GPU limit, so the second buffer was refused and every other frame presented at 1x. - The window is now up to four tiles, each its own surface over a column range. A new display first tries one surface over the union of all displays (the old behaviour, so R4's 320-wide window is unchanged), then a merge with the tiles it overlaps, then a tile of its own. Every mirrored write (queued draws, fills, uploads, copies, the depth24 clear, stencil rebuilds) goes to each tile it touches; present, captures, screenshot_hires and the native-wide centre read the tile holding the display. A display no tile can hold within the GPU limit, the memory budget (all tiles together) or the tile cap still presents at 1x, logged. - A copy into the window stages its S-scaled source in a scratch of its own, in column chunks that fit the GPU limit, walked in memmove order so an overlapping copy still reads pre-copy pixels. The shared scratch no longer grows past the hr surface for it. - Staging textures commit a new size only after the driver accepted the storage; a size past the limit is refused with a log line and the texture keeps its old storage (scratch_ensure used to record the size before a glTexImage2D that could fail). - PSX_GL_MAX_DIM lowers the GPU limit the backend plans with (testing a layout for a smaller GPU). video_info adds display_x/display_y, hires_window_tiles and hires_window_mib. - gl_scale_invariance_test: side-by-side runs flip two 512-wide buffers and require one surface at 5x and two tiles at 9x (PSX_GL_MAX_DIM=8192) to equal the full-VRAM surface, including copies between the buffers and 1000-column copies; at 18x both buffers must read back at S. A scratch request past the limit must be refused and leave the texture and its recorded size intact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>