mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-04 11:45:18 +02:00
OptimizePendingStates sat four lines below the `!tasksSplit_ || waitable_->Empty()` check that makes touching shared state safe. It memcpys a 71-byte PixelFuncID over a RasterizerState and swaps drawPixel/samplerID, while worker threads copy those same entries by value to rasterize from - so a primitive could be drawn with the new drawPixel against the old pixelID bytes. Moving it inside the guard costs nothing correctness-wise: skipping a round just means those draws use the unoptimized function, and the next Drain with an empty waitable picks up the whole accumulated range. This does not close the whole race - Add* still ORs into states_[stateIndex_].flags after pushing, which items dispatched by an earlier Drain can be reading. That one needs the state entries to become copy-on-write once dispatched, which is a bigger change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vd8ntC2brCUtCrDJMqLbs8
To get to 100% compatibility, we will need a software renderer as there are games out there that do tricks that can't really be faked in a sensible way. Useful for homebrew too that mix sw and accel rendering.