#include <limits.h>
#include "util/u_memory.h"
#include "util/u_math.h"
-#include "util/u_cpu_detect.h"
#include "util/u_surface.h"
#include "lp_scene_queue.h"
rast->curr_scene = NULL;
+#ifdef DEBUG
if (0)
- debug_printf("Post render scene: tile read: %d tile write: %d\n",
- tile_read_count, tile_write_count);
+ debug_printf("Post render scene: tile unswizzle: %u tile swizzle: %u\n",
+ lp_tile_unswizzle_count, lp_tile_swizzle_count);
+#endif
}
{
unsigned i;
-#ifdef PIPE_OS_WINDOWS
- /* Multithreading not supported on windows until conditions and barriers are
- * properly implemented. */
- rast->num_threads = 0;
-#else
-#ifdef PIPE_OS_EMBEDDED
- rast->num_threads = 0;
-#else
- rast->num_threads = util_cpu_caps.nr_cpus;
-#endif
- rast->num_threads = debug_get_num_option("LP_NUM_THREADS", rast->num_threads);
- rast->num_threads = MIN2(rast->num_threads, MAX_THREADS);
-#endif
-
/* NOTE: if num_threads is zero, we won't use any threads */
for (i = 0; i < rast->num_threads; i++) {
pipe_semaphore_init(&rast->tasks[i].work_ready, 0);
/**
- * Create new lp_rasterizer.
- * \param empty the queue to put empty scenes on after we've finished
- * processing them.
+ * Create new lp_rasterizer. If num_threads is zero, don't create any
+ * new threads, do rendering synchronously.
+ * \param num_threads number of rasterizer threads to create
*/
struct lp_rasterizer *
-lp_rast_create( void )
+lp_rast_create( unsigned num_threads )
{
struct lp_rasterizer *rast;
unsigned i;
task->thread_index = i;
}
+ rast->num_threads = num_threads;
+
create_rast_threads(rast);
/* for synchronizing rasterization threads */