Difference between revisions of "Raytrace Scheduler"

From CSE231 Wiki
Jump to navigation Jump to search
m (Cosgroved moved page WorkStealing to Raytrace Scheduler)
Line 3: Line 3:
 
SplitFourWayRayTracer
 
SplitFourWayRayTracer
 
==Fun==
 
==Fun==
DivideAndConquerRayTracer
+
===DivideAndConquerRayTracer===
WorkStealingRayTracer
+
Recursively divide the given region into 4 tasks for each of the four quadrants until you get below the threshold.
 +
When you get below the threshold, call the <code>renderSection</code> method to render the section.
 +
===WorkStealingRayTracer===
 +
The <code>renderMyTasksUntilEmptyThenStealWorkFromOthers</code> method will be called on one of the four quadrants, but it will be given the sections that make up all four quadrants. You can use the <code>id</code> to find the particular quadrant being called.
 +
 
 +
This method should repeatedly draw from the tail of its own double-ended queue to render its own tasks using the <code>Section.render</code> method. If it finishes all of its tasks, and there are still unfinished tasks in the other quadrants, then it should draw tasks from the head of the other quadrants' deques.

Revision as of 19:43, 4 December 2017

Where to Start

Demo

SplitFourWayRayTracer

Fun

DivideAndConquerRayTracer

Recursively divide the given region into 4 tasks for each of the four quadrants until you get below the threshold. When you get below the threshold, call the renderSection method to render the section.

WorkStealingRayTracer

The renderMyTasksUntilEmptyThenStealWorkFromOthers method will be called on one of the four quadrants, but it will be given the sections that make up all four quadrants. You can use the id to find the particular quadrant being called.

This method should repeatedly draw from the tail of its own double-ended queue to render its own tasks using the Section.render method. If it finishes all of its tasks, and there are still unfinished tasks in the other quadrants, then it should draw tasks from the head of the other quadrants' deques.