#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)
- 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
}
assert(cbuf);
lpt = llvmpipe_resource(cbuf->texture);
task->color_tiles[buf] = llvmpipe_get_texture_tile(lpt,
- cbuf->face,
+ cbuf->face + cbuf->zslice,
cbuf->level,
usage,
x, y);
* and update the tile's layout info.
*/
(void) llvmpipe_get_texture_tile(lpt,
- zsbuf->face,
+ zsbuf->face + zsbuf->zslice,
zsbuf->level,
usage,
x, y);
assert(cbuf);
lpt = llvmpipe_texture(cbuf->texture);
task->color_tiles[buf] = llvmpipe_get_texture_tile(lpt,
- cbuf->face,
+ cbuf->face + cbuf->zslice,
cbuf->level,
usage,
task->x, task->y);
const unsigned face = cbuf->face, level = cbuf->level;
struct llvmpipe_resource *lpt = llvmpipe_resource(cbuf->texture);
/* this will convert the tiled data to linear if needed */
- (void) llvmpipe_get_texture_tile_linear(lpt, face,level,
+ (void) llvmpipe_get_texture_tile_linear(lpt, face, level,
LP_TEX_USAGE_READ,
task->x, task->y);
}
{
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 */