GroveEngine/tests
StillHammer 63751d6f91 fix: Multi-texture sprite rendering - setState per batch + transient buffers
Fixed two critical bugs preventing multiple textured sprites from rendering correctly:

1. **setState consumed by submit**: Render state was set once at the beginning,
   but bgfx consumes state at each submit(). Batches 2+ had no state → invisible.

   FIX: Call setState() before EACH batch, not once globally.

2. **Buffer overwrite race condition**: updateBuffer() is immediate but submit()
   is deferred. When batch 2 called updateBuffer(), it overwrote batch 1's data
   BEFORE bgfx executed the draw calls. All batches used the last batch's data
   → all sprites rendered at the same position (superimposed).

   FIX: Use transient buffers (one per batch, frame-local) instead of reusing
   the same dynamic buffer. Each batch gets its own isolated memory.

Changes:
- SpritePass: setState before each batch + transient buffer allocation per batch
- UIRenderer: Retained mode rendering (render:sprite:add/update/remove)
- test_ui_showcase: Added 3 textured buttons demo section
- test_3buttons_minimal: Minimal test case for multi-texture debugging

Tested: 3 textured buttons now render at correct positions with correct textures.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 14:05:56 +07:00
..
assets/textures feat: Complete Phase 6.5 - Comprehensive BgfxRenderer testing 2025-11-29 22:56:29 +08:00
benchmarks feat: Add comprehensive benchmark suite for GroveEngine performance validation 2025-11-20 16:08:10 +08:00
demo feat: Add UIModule interactive showcase demo 2025-11-29 08:52:25 +08:00
helpers fix: IntraIOManager batch thread + AutoCompiler Windows support 2025-12-31 09:44:37 +07:00
hotreload feat: Windows portage + Phase 4 SceneCollector integration 2025-11-27 09:48:14 +08:00
integration fix: Windows test stability - scenario_09 race condition and IOSystemStress crash 2025-12-31 15:23:56 +07:00
mocks feat: Complete Phase 6.5 - Comprehensive BgfxRenderer testing 2025-11-29 22:56:29 +08:00
modules fix: IntraIOManager batch thread + AutoCompiler Windows support 2025-12-31 09:44:37 +07:00
unit feat: Complete Phase 6.5 - Comprehensive BgfxRenderer testing 2025-11-29 22:56:29 +08:00
visual fix: Multi-texture sprite rendering - setState per batch + transient buffers 2026-01-14 14:05:56 +07:00
CMakeLists.txt fix: Multi-texture sprite rendering - setState per batch + transient buffers 2026-01-14 14:05:56 +07:00
profile_memory_leak.cpp feat: Add integration tests 8-10 & fix CTest configuration 2025-11-19 07:34:15 +08:00