diff options
author | Tim Rowley <[email protected]> | 2016-02-19 17:55:23 -0600 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2016-03-25 14:26:17 -0500 |
commit | 45f0ce168ce21a7a95f48d3164e42a947732b896 (patch) | |
tree | 91b6f713406ae956674a91c42aab0ffaa104abbc /src/gtest | |
parent | dd0f9eed8cda45ed1373abebad7dd2398a16e9a7 (diff) |
swr: [rasterizer core] RingBuffer class for DC/DS
Use head/tail ring buffer indices for thread synchronization.
1. SwrWaitForIdle loops until ring is empty. (head == tail)
2. GetDrawContext waits until ring is not full. (head - tail) == Ring Size
3. Draw enqueues by incrementing head.
4. Last worker thread to move past a DC dequeues by incrementing tail.
Todo: To reduce contention we can cache the tail in the API thread. For
example, if you know you have 64 free entries in the ring then you don't
need to keep checking the tail until you used those 64 entries.
Diffstat (limited to 'src/gtest')
0 files changed, 0 insertions, 0 deletions