summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2017-08-07 13:02:47 -0700
committerVito Caputo <vcaputo@pengaru.com>2017-08-07 13:15:44 -0700
commitf0a961c5672aaee05112d54555aec6b9b68416dc (patch)
tree86877ea048bc152e8b9d3169e402d977a2c1de8a /m4
parent3206fc10cb2cf01e61232a04f68917b0c244e552 (diff)
threads: rework threaded fragment scheduling
Instead of creating fragment lists striped across available threads uniformly in a round-robin fashion, just have the render threads iterate across the shared fragments array using atomics. This way non-uniform cost of rendering can be adapted to, provided the module prepares the frame with sufficient fragment granularity. In the ray tracer for example, it is quite common for some areas of the screen to have lower complexity/cost than others. The previous model distributed the fragments uniformly across the threads with no ability for underutilized threads to steal work from overutilized threads in the event of non-uniform cost distributions. Now no attempt to schedule work is made. The render threads simply race with eachother on a per-frame basis, atomically incrementing a shared index into the frame's prepared fragemnts. The fragment size itself represents the atomic work unit. A later commit will change the various renderers to prepare more/smaller fragments where appropriate. The ray tracer in particular needs more and would probably further benefit from a tiling strategy, especially when an acceleration data structure is introduced.
Diffstat (limited to 'm4')
0 files changed, 0 insertions, 0 deletions
© All Rights Reserved