Commit 41d4600
committed
Metal: dedup per-frame uniforms bind and clean up OSD locals
Follow-up cleanup to 5298e70 ("Metal: inline single-call helpers in
render path"), which made two small issues visible:
1. The core-draw, menu-draw, and overlay blocks in -renderFrame: each
bound _context.uniforms at BufferIndexUniforms on the main render
command encoder, always with the same buffer. Issue one bind per
frame instead.
The bind is placed AFTER [_frameView drawWithContext:_context]
returns rather than at the top of the frame. FrameView's shader-pass
loop may, on its back-buffer pass, rebind vertex slots at indices
determined by .slang shader reflection data, which in principle
could collide with BufferIndexUniforms. Binding after drawWithContext:
guarantees the uniforms slot holds what the subsequent menu/overlay
draws expect.
2. Rename width_n/height_n (awkward names introduced by the inlining
of -_renderMessage:data:, which previously had its own scope free
of width/height parameter shadowing) to bg_w/bg_h, matching the
semantics of the OSD message background quad.
No functional change intended.1 parent 5298e70 commit 41d4600
1 file changed
Lines changed: 15 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2487 | 2487 | | |
2488 | 2488 | | |
2489 | 2489 | | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
2490 | 2499 | | |
2491 | 2500 | | |
2492 | | - | |
2493 | 2501 | | |
2494 | 2502 | | |
2495 | 2503 | | |
| |||
2505 | 2513 | | |
2506 | 2514 | | |
2507 | 2515 | | |
2508 | | - | |
2509 | 2516 | | |
2510 | 2517 | | |
2511 | 2518 | | |
| |||
2527 | 2534 | | |
2528 | 2535 | | |
2529 | 2536 | | |
2530 | | - | |
2531 | 2537 | | |
2532 | 2538 | | |
2533 | 2539 | | |
| |||
2563 | 2569 | | |
2564 | 2570 | | |
2565 | 2571 | | |
2566 | | - | |
2567 | | - | |
| 2572 | + | |
| 2573 | + | |
2568 | 2574 | | |
2569 | 2575 | | |
2570 | 2576 | | |
2571 | 2577 | | |
2572 | 2578 | | |
2573 | 2579 | | |
2574 | 2580 | | |
2575 | | - | |
| 2581 | + | |
2576 | 2582 | | |
2577 | 2583 | | |
2578 | | - | |
2579 | | - | |
| 2584 | + | |
| 2585 | + | |
2580 | 2586 | | |
2581 | 2587 | | |
2582 | | - | |
| 2588 | + | |
2583 | 2589 | | |
2584 | 2590 | | |
2585 | 2591 | | |
| |||
0 commit comments