mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-28 02:56:36 -04:00
Reset backdrop stretch when batching supersampled world lines
Keep line quads separate from pending backdrop batches and reset the key after earlier batches flush. Exercise both draw orders with actual GL readback. Fixes the remaining Tomba 2 fishing string offset (beads-w0mm).
This commit is contained in:
@@ -4709,11 +4709,14 @@ static void gpu_geometry(GLenum mode, const int *xs, const int *ys,
|
||||
}
|
||||
line_to_quad(lv, quad);
|
||||
if (s_fb_n > 0 && (s_fb_mode != GL_TRIANGLES || s_fb_semi != semi ||
|
||||
s_fb_mask != (int)s_mask_set || s_fb_depth != 0))
|
||||
s_fb_mask != (int)s_mask_set || s_fb_gate != 0 || s_fb_depth != 0))
|
||||
flush_flat_batch();
|
||||
if (s_fb_n + 6 > FLATBATCH_MAXV)
|
||||
flush_flat_batch();
|
||||
s_fb_mode = GL_TRIANGLES;
|
||||
/* The expanded line is still world geometry. A previous backdrop
|
||||
* batch may have left its stretch key set even after being flushed. */
|
||||
s_fb_gate = 0;
|
||||
s_fb_semi = semi;
|
||||
s_fb_mask = (int)s_mask_set;
|
||||
s_fb_depth = 0; /* lines are 2D: never depth-tested (G1.14) */
|
||||
|
||||
@@ -1298,10 +1298,15 @@ static int backdrop_lines_main(int scale) {
|
||||
g_ws_bd_stretch_on = 1;
|
||||
g_ws_bd_phase_mode = 1;
|
||||
g_ws_bd_stretch_pct = 0;
|
||||
for (int policy = 0; policy < 2; ++policy) {
|
||||
for (int policy = 0; policy < 2; ++policy) for (int order = 0; order < 3; ++order) {
|
||||
glb_wide_clear(0, 0, 512, 0);
|
||||
test_flat_backdrop = policy == 0;
|
||||
test_backdrop_phase = policy == 1;
|
||||
/* Cover both a pending backdrop batch and its key remaining after a
|
||||
* flush. Supersampled lines expand to triangles, but must not join
|
||||
* that backdrop batch or inherit its horizontal stretch. */
|
||||
if (order) glb_draw_flat_triangle(4, 4, 20, 4, 4, 12, 0x4210);
|
||||
if (order == 2) gl_renderer_sync_cpu();
|
||||
glb_draw_line(64, 20, 64, 100, 0x7fff);
|
||||
glb_draw_shaded_line(100, 20, 0x7fff, 100, 100, 0x7fff);
|
||||
test_backdrop_phase = 0;
|
||||
|
||||
Reference in New Issue
Block a user