1 /**************************************************************************
3 * Copyright 2009 VMware, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
29 #include "util/u_memory.h"
30 #include "util/u_math.h"
31 #include "util/u_rect.h"
32 #include "util/u_surface.h"
33 #include "util/u_pack_color.h"
35 #include "lp_scene_queue.h"
41 #include "lp_rast_priv.h"
42 #include "lp_tile_soa.h"
43 #include "gallivm/lp_bld_debug.h"
49 const struct lp_rast_state
*jit_state
= NULL
;
50 const struct lp_rasterizer_task
*jit_task
= NULL
;
55 * Begin rasterizing a scene.
56 * Called once per scene by one thread.
59 lp_rast_begin( struct lp_rasterizer
*rast
,
60 struct lp_scene
*scene
)
63 rast
->curr_scene
= scene
;
65 LP_DBG(DEBUG_RAST
, "%s\n", __FUNCTION__
);
67 lp_scene_begin_rasterization( scene
);
68 lp_scene_bin_iter_begin( scene
);
73 lp_rast_end( struct lp_rasterizer
*rast
)
75 lp_scene_end_rasterization( rast
->curr_scene
);
77 rast
->curr_scene
= NULL
;
81 debug_printf("Post render scene: tile unswizzle: %u tile swizzle: %u\n",
82 lp_tile_unswizzle_count
, lp_tile_swizzle_count
);
88 * Begining rasterization of a tile.
89 * \param x window X position of the tile, in pixels
90 * \param y window Y position of the tile, in pixels
93 lp_rast_tile_begin(struct lp_rasterizer_task
*task
,
94 const struct cmd_bin
*bin
)
96 const struct lp_scene
*scene
= task
->scene
;
97 enum lp_texture_usage usage
;
99 LP_DBG(DEBUG_RAST
, "%s %d,%d\n", __FUNCTION__
, bin
->x
, bin
->y
);
102 task
->x
= bin
->x
* TILE_SIZE
;
103 task
->y
= bin
->y
* TILE_SIZE
;
105 /* reset pointers to color tile(s) */
106 memset(task
->color_tiles
, 0, sizeof(task
->color_tiles
));
108 /* get pointer to depth/stencil tile */
110 struct pipe_surface
*zsbuf
= task
->scene
->fb
.zsbuf
;
112 struct llvmpipe_resource
*lpt
= llvmpipe_resource(zsbuf
->texture
);
114 if (scene
->has_depthstencil_clear
)
115 usage
= LP_TEX_USAGE_WRITE_ALL
;
117 usage
= LP_TEX_USAGE_READ_WRITE
;
119 /* "prime" the tile: convert data from linear to tiled if necessary
120 * and update the tile's layout info.
122 (void) llvmpipe_get_texture_tile(lpt
,
123 zsbuf
->u
.tex
.first_layer
,
128 /* Get actual pointer to the tile data. Note that depth/stencil
129 * data is tiled differently than color data.
131 task
->depth_tile
= lp_rast_get_depth_block_pointer(task
,
135 assert(task
->depth_tile
);
138 task
->depth_tile
= NULL
;
145 * Clear the rasterizer's current color tile.
146 * This is a bin command called during bin processing.
149 lp_rast_clear_color(struct lp_rasterizer_task
*task
,
150 const union lp_rast_cmd_arg arg
)
152 const struct lp_scene
*scene
= task
->scene
;
153 const uint8_t *clear_color
= arg
.clear_color
;
157 LP_DBG(DEBUG_RAST
, "%s 0x%x,0x%x,0x%x,0x%x\n", __FUNCTION__
,
163 if (clear_color
[0] == clear_color
[1] &&
164 clear_color
[1] == clear_color
[2] &&
165 clear_color
[2] == clear_color
[3]) {
166 /* clear to grayscale value {x, x, x, x} */
167 for (i
= 0; i
< scene
->fb
.nr_cbufs
; i
++) {
169 lp_rast_get_color_tile_pointer(task
, i
, LP_TEX_USAGE_WRITE_ALL
);
170 memset(ptr
, clear_color
[0], TILE_SIZE
* TILE_SIZE
* 4);
175 * Note: if the swizzled tile layout changes (see TILE_PIXEL) this code
176 * will need to change. It'll be pretty obvious when clearing no longer
179 const unsigned chunk
= TILE_SIZE
/ 4;
180 for (i
= 0; i
< scene
->fb
.nr_cbufs
; i
++) {
182 lp_rast_get_color_tile_pointer(task
, i
, LP_TEX_USAGE_WRITE_ALL
);
185 for (j
= 0; j
< 4 * TILE_SIZE
; j
++) {
186 memset(c
, clear_color
[0], chunk
);
188 memset(c
, clear_color
[1], chunk
);
190 memset(c
, clear_color
[2], chunk
);
192 memset(c
, clear_color
[3], chunk
);
198 LP_COUNT(nr_color_tile_clear
);
207 * Clear the rasterizer's current z/stencil tile.
208 * This is a bin command called during bin processing.
211 lp_rast_clear_zstencil(struct lp_rasterizer_task
*task
,
212 const union lp_rast_cmd_arg arg
)
214 const struct lp_scene
*scene
= task
->scene
;
215 uint32_t clear_value
= arg
.clear_zstencil
.value
;
216 uint32_t clear_mask
= arg
.clear_zstencil
.mask
;
217 const unsigned height
= TILE_SIZE
/ TILE_VECTOR_HEIGHT
;
218 const unsigned width
= TILE_SIZE
* TILE_VECTOR_HEIGHT
;
219 const unsigned block_size
= scene
->zsbuf
.blocksize
;
220 const unsigned dst_stride
= scene
->zsbuf
.stride
* TILE_VECTOR_HEIGHT
;
224 LP_DBG(DEBUG_RAST
, "%s: value=0x%08x, mask=0x%08x\n",
225 __FUNCTION__
, clear_value
, clear_mask
);
228 * Clear the aera of the swizzled depth/depth buffer matching this tile, in
229 * stripes of TILE_VECTOR_HEIGHT x TILE_SIZE at a time.
231 * The swizzled depth format is such that the depths for
232 * TILE_VECTOR_HEIGHT x TILE_VECTOR_WIDTH pixels have consecutive offsets.
235 dst
= task
->depth_tile
;
237 clear_value
&= clear_mask
;
239 switch (block_size
) {
241 assert(clear_mask
== 0xff);
242 memset(dst
, (uint8_t) clear_value
, height
* width
);
245 if (clear_mask
== 0xffff) {
246 for (i
= 0; i
< height
; i
++) {
247 uint16_t *row
= (uint16_t *)dst
;
248 for (j
= 0; j
< width
; j
++)
249 *row
++ = (uint16_t) clear_value
;
254 for (i
= 0; i
< height
; i
++) {
255 uint16_t *row
= (uint16_t *)dst
;
256 for (j
= 0; j
< width
; j
++) {
257 uint16_t tmp
= ~clear_mask
& *row
;
258 *row
++ = clear_value
| tmp
;
265 if (clear_mask
== 0xffffffff) {
266 for (i
= 0; i
< height
; i
++) {
267 uint32_t *row
= (uint32_t *)dst
;
268 for (j
= 0; j
< width
; j
++)
269 *row
++ = clear_value
;
274 for (i
= 0; i
< height
; i
++) {
275 uint32_t *row
= (uint32_t *)dst
;
276 for (j
= 0; j
< width
; j
++) {
277 uint32_t tmp
= ~clear_mask
& *row
;
278 *row
++ = clear_value
| tmp
;
293 * Convert the color tile from tiled to linear layout.
294 * This is generally only done when we're flushing the scene just prior to
295 * SwapBuffers. If we didn't do this here, we'd have to convert the entire
296 * tiled color buffer to linear layout in the llvmpipe_texture_unmap()
297 * function. It's better to do it here to take advantage of
298 * threading/parallelism.
299 * This is a bin command which is stored in all bins.
302 lp_rast_store_linear_color( struct lp_rasterizer_task
*task
)
304 const struct lp_scene
*scene
= task
->scene
;
307 for (buf
= 0; buf
< scene
->fb
.nr_cbufs
; buf
++) {
308 struct pipe_surface
*cbuf
= scene
->fb
.cbufs
[buf
];
309 const unsigned layer
= cbuf
->u
.tex
.first_layer
;
310 const unsigned level
= cbuf
->u
.tex
.level
;
311 struct llvmpipe_resource
*lpt
= llvmpipe_resource(cbuf
->texture
);
313 if (!task
->color_tiles
[buf
])
316 llvmpipe_unswizzle_cbuf_tile(lpt
,
320 task
->color_tiles
[buf
]);
327 * Run the shader on all blocks in a tile. This is used when a tile is
328 * completely contained inside a triangle.
329 * This is a bin command called during bin processing.
332 lp_rast_shade_tile(struct lp_rasterizer_task
*task
,
333 const union lp_rast_cmd_arg arg
)
335 const struct lp_scene
*scene
= task
->scene
;
336 const struct lp_rast_shader_inputs
*inputs
= arg
.shade_tile
;
337 const struct lp_rast_state
*state
;
338 struct lp_fragment_shader_variant
*variant
;
339 const unsigned tile_x
= task
->x
, tile_y
= task
->y
;
342 if (inputs
->disable
) {
343 /* This command was partially binned and has been disabled */
347 LP_DBG(DEBUG_RAST
, "%s\n", __FUNCTION__
);
354 variant
= state
->variant
;
356 /* render the whole 64x64 tile in 4x4 chunks */
357 for (y
= 0; y
< TILE_SIZE
; y
+= 4){
358 for (x
= 0; x
< TILE_SIZE
; x
+= 4) {
359 uint8_t *color
[PIPE_MAX_COLOR_BUFS
];
364 for (i
= 0; i
< scene
->fb
.nr_cbufs
; i
++)
365 color
[i
] = lp_rast_get_color_block_pointer(task
, i
,
366 tile_x
+ x
, tile_y
+ y
);
369 depth
= lp_rast_get_depth_block_pointer(task
, tile_x
+ x
, tile_y
+ y
);
371 /* run shader on 4x4 block */
372 BEGIN_JIT_CALL(state
, task
);
373 variant
->jit_function
[RAST_WHOLE
]( &state
->jit_context
,
374 tile_x
+ x
, tile_y
+ y
,
390 * Run the shader on all blocks in a tile. This is used when a tile is
391 * completely contained inside a triangle, and the shader is opaque.
392 * This is a bin command called during bin processing.
395 lp_rast_shade_tile_opaque(struct lp_rasterizer_task
*task
,
396 const union lp_rast_cmd_arg arg
)
398 const struct lp_scene
*scene
= task
->scene
;
401 LP_DBG(DEBUG_RAST
, "%s\n", __FUNCTION__
);
408 /* this will prevent converting the layout from tiled to linear */
409 for (i
= 0; i
< scene
->fb
.nr_cbufs
; i
++) {
410 (void)lp_rast_get_color_tile_pointer(task
, i
, LP_TEX_USAGE_WRITE_ALL
);
413 lp_rast_shade_tile(task
, arg
);
418 * Compute shading for a 4x4 block of pixels inside a triangle.
419 * This is a bin command called during bin processing.
420 * \param x X position of quad in window coords
421 * \param y Y position of quad in window coords
424 lp_rast_shade_quads_mask(struct lp_rasterizer_task
*task
,
425 const struct lp_rast_shader_inputs
*inputs
,
426 unsigned x
, unsigned y
,
429 const struct lp_rast_state
*state
= task
->state
;
430 struct lp_fragment_shader_variant
*variant
= state
->variant
;
431 const struct lp_scene
*scene
= task
->scene
;
432 uint8_t *color
[PIPE_MAX_COLOR_BUFS
];
439 assert(x
< scene
->tiles_x
* TILE_SIZE
);
440 assert(y
< scene
->tiles_y
* TILE_SIZE
);
441 assert(x
% TILE_VECTOR_WIDTH
== 0);
442 assert(y
% TILE_VECTOR_HEIGHT
== 0);
444 assert((x
% 4) == 0);
445 assert((y
% 4) == 0);
448 for (i
= 0; i
< scene
->fb
.nr_cbufs
; i
++) {
449 color
[i
] = lp_rast_get_color_block_pointer(task
, i
, x
, y
);
450 assert(lp_check_alignment(color
[i
], 16));
454 depth
= lp_rast_get_depth_block_pointer(task
, x
, y
);
457 assert(lp_check_alignment(state
->jit_context
.blend_color
, 16));
459 /* run shader on 4x4 block */
460 BEGIN_JIT_CALL(state
, task
);
461 variant
->jit_function
[RAST_EDGE_TEST
](&state
->jit_context
,
477 * Begin a new occlusion query.
478 * This is a bin command put in all bins.
482 lp_rast_begin_query(struct lp_rasterizer_task
*task
,
483 const union lp_rast_cmd_arg arg
)
485 struct llvmpipe_query
*pq
= arg
.query_obj
;
487 assert(task
->query
== NULL
);
488 task
->vis_counter
= 0;
494 * End the current occlusion query.
495 * This is a bin command put in all bins.
499 lp_rast_end_query(struct lp_rasterizer_task
*task
,
500 const union lp_rast_cmd_arg arg
)
504 task
->query
->count
[task
->thread_index
] += task
->vis_counter
;
511 lp_rast_set_state(struct lp_rasterizer_task
*task
,
512 const union lp_rast_cmd_arg arg
)
514 task
->state
= arg
.state
;
520 * Set top row and left column of the tile's pixels to white. For debugging.
523 outline_tile(uint8_t *tile
)
525 const uint8_t val
= 0xff;
528 for (i
= 0; i
< TILE_SIZE
; i
++) {
529 TILE_PIXEL(tile
, i
, 0, 0) = val
;
530 TILE_PIXEL(tile
, i
, 0, 1) = val
;
531 TILE_PIXEL(tile
, i
, 0, 2) = val
;
532 TILE_PIXEL(tile
, i
, 0, 3) = val
;
534 TILE_PIXEL(tile
, 0, i
, 0) = val
;
535 TILE_PIXEL(tile
, 0, i
, 1) = val
;
536 TILE_PIXEL(tile
, 0, i
, 2) = val
;
537 TILE_PIXEL(tile
, 0, i
, 3) = val
;
543 * Draw grid of gray lines at 16-pixel intervals across the tile to
544 * show the sub-tile boundaries. For debugging.
547 outline_subtiles(uint8_t *tile
)
549 const uint8_t val
= 0x80;
550 const unsigned step
= 16;
553 for (i
= 0; i
< TILE_SIZE
; i
+= step
) {
554 for (j
= 0; j
< TILE_SIZE
; j
++) {
555 TILE_PIXEL(tile
, i
, j
, 0) = val
;
556 TILE_PIXEL(tile
, i
, j
, 1) = val
;
557 TILE_PIXEL(tile
, i
, j
, 2) = val
;
558 TILE_PIXEL(tile
, i
, j
, 3) = val
;
560 TILE_PIXEL(tile
, j
, i
, 0) = val
;
561 TILE_PIXEL(tile
, j
, i
, 1) = val
;
562 TILE_PIXEL(tile
, j
, i
, 2) = val
;
563 TILE_PIXEL(tile
, j
, i
, 3) = val
;
573 * Called when we're done writing to a color tile.
576 lp_rast_tile_end(struct lp_rasterizer_task
*task
)
579 if (LP_DEBUG
& (DEBUG_SHOW_SUBTILES
| DEBUG_SHOW_TILES
)) {
580 const struct lp_scene
*scene
= task
->scene
;
583 for (buf
= 0; buf
< scene
->fb
.nr_cbufs
; buf
++) {
584 uint8_t *color
= lp_rast_get_color_block_pointer(task
, buf
,
587 if (LP_DEBUG
& DEBUG_SHOW_SUBTILES
)
588 outline_subtiles(color
);
589 else if (LP_DEBUG
& DEBUG_SHOW_TILES
)
594 (void) outline_subtiles
;
597 lp_rast_store_linear_color(task
);
600 union lp_rast_cmd_arg dummy
= {0};
601 lp_rast_end_query(task
, dummy
);
605 memset(task
->color_tiles
, 0, sizeof(task
->color_tiles
));
606 task
->depth_tile
= NULL
;
611 static lp_rast_cmd_func dispatch
[LP_RAST_OP_MAX
] =
614 lp_rast_clear_zstencil
,
623 lp_rast_triangle_3_4
,
624 lp_rast_triangle_3_16
,
625 lp_rast_triangle_4_16
,
627 lp_rast_shade_tile_opaque
,
635 do_rasterize_bin(struct lp_rasterizer_task
*task
,
636 const struct cmd_bin
*bin
)
638 const struct cmd_block
*block
;
644 for (block
= bin
->head
; block
; block
= block
->next
) {
645 for (k
= 0; k
< block
->count
; k
++) {
646 dispatch
[block
->cmd
[k
]]( task
, block
->arg
[k
] );
654 * Rasterize commands for a single bin.
655 * \param x, y position of the bin's tile in the framebuffer
656 * Must be called between lp_rast_begin() and lp_rast_end().
660 rasterize_bin(struct lp_rasterizer_task
*task
,
661 const struct cmd_bin
*bin
)
663 lp_rast_tile_begin( task
, bin
);
665 do_rasterize_bin(task
, bin
);
667 lp_rast_tile_end(task
);
672 if (bin
->head
->count
== 1) {
673 if (bin
->head
->cmd
[0] == LP_RAST_OP_SHADE_TILE_OPAQUE
)
674 LP_COUNT(nr_pure_shade_opaque_64
);
675 else if (bin
->head
->cmd
[0] == LP_RAST_OP_SHADE_TILE
)
676 LP_COUNT(nr_pure_shade_64
);
681 /* An empty bin is one that just loads the contents of the tile and
682 * stores them again unchanged. This typically happens when bins have
683 * been flushed for some reason in the middle of a frame, or when
684 * incremental updates are being made to a render target.
686 * Try to avoid doing pointless work in this case.
689 is_empty_bin( const struct cmd_bin
*bin
)
691 return bin
->head
== NULL
;
696 * Rasterize/execute all bins within a scene.
700 rasterize_scene(struct lp_rasterizer_task
*task
,
701 struct lp_scene
*scene
)
704 /* loop over scene bins, rasterize each */
708 for (i
= 0; i
< scene
->tiles_x
; i
++) {
709 for (j
= 0; j
< scene
->tiles_y
; j
++) {
710 struct cmd_bin
*bin
= lp_scene_get_bin(scene
, i
, j
);
711 rasterize_bin(task
, bin
, i
, j
);
720 while ((bin
= lp_scene_bin_iter_next(scene
))) {
721 if (!is_empty_bin( bin
))
722 rasterize_bin(task
, bin
);
728 lp_fence_signal(scene
->fence
);
736 * Called by setup module when it has something for us to render.
739 lp_rast_queue_scene( struct lp_rasterizer
*rast
,
740 struct lp_scene
*scene
)
742 LP_DBG(DEBUG_SETUP
, "%s\n", __FUNCTION__
);
744 if (rast
->num_threads
== 0) {
747 lp_rast_begin( rast
, scene
);
749 rasterize_scene( &rast
->tasks
[0], scene
);
753 rast
->curr_scene
= NULL
;
756 /* threaded rendering! */
759 lp_scene_enqueue( rast
->full_scenes
, scene
);
761 /* signal the threads that there's work to do */
762 for (i
= 0; i
< rast
->num_threads
; i
++) {
763 pipe_semaphore_signal(&rast
->tasks
[i
].work_ready
);
767 LP_DBG(DEBUG_SETUP
, "%s done \n", __FUNCTION__
);
772 lp_rast_finish( struct lp_rasterizer
*rast
)
774 if (rast
->num_threads
== 0) {
780 /* wait for work to complete */
781 for (i
= 0; i
< rast
->num_threads
; i
++) {
782 pipe_semaphore_wait(&rast
->tasks
[i
].work_done
);
789 * This is the thread's main entrypoint.
790 * It's a simple loop:
793 * 3. signal that we're done
795 static PIPE_THREAD_ROUTINE( thread_func
, init_data
)
797 struct lp_rasterizer_task
*task
= (struct lp_rasterizer_task
*) init_data
;
798 struct lp_rasterizer
*rast
= task
->rast
;
799 boolean debug
= false;
804 debug_printf("thread %d waiting for work\n", task
->thread_index
);
805 pipe_semaphore_wait(&task
->work_ready
);
810 if (task
->thread_index
== 0) {
812 * - get next scene to rasterize
813 * - map the framebuffer surfaces
816 lp_scene_dequeue( rast
->full_scenes
, TRUE
) );
819 /* Wait for all threads to get here so that threads[1+] don't
820 * get a null rast->curr_scene pointer.
822 pipe_barrier_wait( &rast
->barrier
);
826 debug_printf("thread %d doing work\n", task
->thread_index
);
828 rasterize_scene(task
,
831 /* wait for all threads to finish with this scene */
832 pipe_barrier_wait( &rast
->barrier
);
834 /* XXX: shouldn't be necessary:
836 if (task
->thread_index
== 0) {
840 /* signal done with work */
842 debug_printf("thread %d done working\n", task
->thread_index
);
844 pipe_semaphore_signal(&task
->work_done
);
852 * Initialize semaphores and spawn the threads.
855 create_rast_threads(struct lp_rasterizer
*rast
)
859 /* NOTE: if num_threads is zero, we won't use any threads */
860 for (i
= 0; i
< rast
->num_threads
; i
++) {
861 pipe_semaphore_init(&rast
->tasks
[i
].work_ready
, 0);
862 pipe_semaphore_init(&rast
->tasks
[i
].work_done
, 0);
863 rast
->threads
[i
] = pipe_thread_create(thread_func
,
864 (void *) &rast
->tasks
[i
]);
871 * Create new lp_rasterizer. If num_threads is zero, don't create any
872 * new threads, do rendering synchronously.
873 * \param num_threads number of rasterizer threads to create
875 struct lp_rasterizer
*
876 lp_rast_create( unsigned num_threads
)
878 struct lp_rasterizer
*rast
;
881 rast
= CALLOC_STRUCT(lp_rasterizer
);
886 rast
->full_scenes
= lp_scene_queue_create();
887 if (!rast
->full_scenes
) {
891 for (i
= 0; i
< Elements(rast
->tasks
); i
++) {
892 struct lp_rasterizer_task
*task
= &rast
->tasks
[i
];
894 task
->thread_index
= i
;
897 rast
->num_threads
= num_threads
;
899 create_rast_threads(rast
);
901 /* for synchronizing rasterization threads */
902 pipe_barrier_init( &rast
->barrier
, rast
->num_threads
);
904 memset(lp_swizzled_cbuf
, 0, sizeof lp_swizzled_cbuf
);
906 memset(lp_dummy_tile
, 0, sizeof lp_dummy_tile
);
919 void lp_rast_destroy( struct lp_rasterizer
*rast
)
923 /* Set exit_flag and signal each thread's work_ready semaphore.
924 * Each thread will be woken up, notice that the exit_flag is set and
925 * break out of its main loop. The thread will then exit.
927 rast
->exit_flag
= TRUE
;
928 for (i
= 0; i
< rast
->num_threads
; i
++) {
929 pipe_semaphore_signal(&rast
->tasks
[i
].work_ready
);
932 /* Wait for threads to terminate before cleaning up per-thread data */
933 for (i
= 0; i
< rast
->num_threads
; i
++) {
934 pipe_thread_wait(rast
->threads
[i
]);
937 /* Clean up per-thread data */
938 for (i
= 0; i
< rast
->num_threads
; i
++) {
939 pipe_semaphore_destroy(&rast
->tasks
[i
].work_ready
);
940 pipe_semaphore_destroy(&rast
->tasks
[i
].work_done
);
943 /* for synchronizing rasterization threads */
944 pipe_barrier_destroy( &rast
->barrier
);
946 lp_scene_queue_destroy(rast
->full_scenes
);
952 /** Return number of rasterization threads */
954 lp_rast_get_num_threads( struct lp_rasterizer
*rast
)
956 return rast
->num_threads
;