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_cpu_detect.h"
32 #include "util/u_surface.h"
34 #include "lp_scene_queue.h"
39 #include "lp_rast_priv.h"
40 #include "lp_tile_soa.h"
41 #include "gallivm/lp_bld_debug.h"
45 /* Begin rasterizing a scene:
48 lp_rast_begin( struct lp_rasterizer
*rast
,
49 struct lp_scene
*scene
)
51 const struct pipe_framebuffer_state
*fb
= &scene
->fb
;
52 boolean write_color
= fb
->nr_cbufs
!= 0;
53 boolean write_zstencil
= fb
->zsbuf
!= NULL
;
56 rast
->curr_scene
= scene
;
58 LP_DBG(DEBUG_RAST
, "%s\n", __FUNCTION__
);
60 rast
->state
.nr_cbufs
= scene
->fb
.nr_cbufs
;
61 rast
->state
.write_zstencil
= write_zstencil
;
62 rast
->state
.write_color
= write_color
;
64 for (i
= 0; i
< rast
->state
.nr_cbufs
; i
++) {
65 struct pipe_surface
*cbuf
= scene
->fb
.cbufs
[i
];
66 rast
->cbuf
[i
].map
= scene
->cbuf_map
[i
];
67 rast
->cbuf
[i
].format
= cbuf
->texture
->format
;
68 rast
->cbuf
[i
].width
= cbuf
->width
;
69 rast
->cbuf
[i
].height
= cbuf
->height
;
70 rast
->cbuf
[i
].stride
= llvmpipe_texture_stride(cbuf
->texture
, cbuf
->level
);
74 struct pipe_surface
*zsbuf
= scene
->fb
.zsbuf
;
75 rast
->zsbuf
.map
= scene
->zsbuf_map
;
76 rast
->zsbuf
.stride
= llvmpipe_texture_stride(zsbuf
->texture
, zsbuf
->level
);
77 rast
->zsbuf
.blocksize
=
78 util_format_get_blocksize(zsbuf
->texture
->format
);
81 lp_scene_bin_iter_begin( scene
);
88 lp_rast_end( struct lp_rasterizer
*rast
)
92 lp_scene_reset( rast
->curr_scene
);
94 for (i
= 0; i
< rast
->state
.nr_cbufs
; i
++)
95 rast
->cbuf
[i
].map
= NULL
;
97 rast
->zsbuf
.map
= NULL
;
98 rast
->curr_scene
= NULL
;
102 * Begining rasterization of a tile.
103 * \param x window X position of the tile, in pixels
104 * \param y window Y position of the tile, in pixels
107 lp_rast_start_tile(struct lp_rasterizer_task
*task
,
108 unsigned x
, unsigned y
)
110 LP_DBG(DEBUG_RAST
, "%s %d,%d\n", __FUNCTION__
, x
, y
);
118 * Clear the rasterizer's current color tile.
119 * This is a bin command called during bin processing.
122 lp_rast_clear_color(struct lp_rasterizer_task
*task
,
123 const union lp_rast_cmd_arg arg
)
125 struct lp_rasterizer
*rast
= task
->rast
;
126 const uint8_t *clear_color
= arg
.clear_color
;
127 uint8_t **color_tile
= task
->tile
.color
;
130 LP_DBG(DEBUG_RAST
, "%s 0x%x,0x%x,0x%x,0x%x\n", __FUNCTION__
,
136 if (clear_color
[0] == clear_color
[1] &&
137 clear_color
[1] == clear_color
[2] &&
138 clear_color
[2] == clear_color
[3]) {
139 /* clear to grayscale value {x, x, x, x} */
140 for (i
= 0; i
< rast
->state
.nr_cbufs
; i
++) {
141 memset(color_tile
[i
], clear_color
[0], TILE_SIZE
* TILE_SIZE
* 4);
146 * Note: if the swizzled tile layout changes (see TILE_PIXEL) this code
147 * will need to change. It'll be pretty obvious when clearing no longer
150 const unsigned chunk
= TILE_SIZE
/ 4;
151 for (i
= 0; i
< rast
->state
.nr_cbufs
; i
++) {
152 uint8_t *c
= color_tile
[i
];
154 for (j
= 0; j
< 4 * TILE_SIZE
; j
++) {
155 memset(c
, clear_color
[0], chunk
);
157 memset(c
, clear_color
[1], chunk
);
159 memset(c
, clear_color
[2], chunk
);
161 memset(c
, clear_color
[3], chunk
);
164 assert(c
- color_tile
[i
] == TILE_SIZE
* TILE_SIZE
* 4);
168 LP_COUNT(nr_color_tile_clear
);
173 * Clear the rasterizer's current z/stencil tile.
174 * This is a bin command called during bin processing.
177 lp_rast_clear_zstencil(struct lp_rasterizer_task
*task
,
178 const union lp_rast_cmd_arg arg
)
180 struct lp_rasterizer
*rast
= task
->rast
;
181 const unsigned tile_x
= task
->x
;
182 const unsigned tile_y
= task
->y
;
183 const unsigned height
= TILE_SIZE
/ TILE_VECTOR_HEIGHT
;
184 const unsigned width
= TILE_SIZE
* TILE_VECTOR_HEIGHT
;
185 unsigned block_size
= rast
->zsbuf
.blocksize
;
187 unsigned dst_stride
= rast
->zsbuf
.stride
* TILE_VECTOR_HEIGHT
;
190 LP_DBG(DEBUG_RAST
, "%s 0x%x\n", __FUNCTION__
, arg
.clear_zstencil
);
192 assert(rast
->zsbuf
.map
);
193 if (!rast
->zsbuf
.map
)
196 LP_DBG(DEBUG_RAST
, "%s\n", __FUNCTION__
);
199 * Clear the aera of the swizzled depth/depth buffer matching this tile, in
200 * stripes of TILE_VECTOR_HEIGHT x TILE_SIZE at a time.
202 * The swizzled depth format is such that the depths for
203 * TILE_VECTOR_HEIGHT x TILE_VECTOR_WIDTH pixels have consecutive offsets.
206 dst
= lp_rast_depth_pointer(rast
, tile_x
, tile_y
);
208 switch (block_size
) {
210 memset(dst
, (uint8_t) arg
.clear_zstencil
, height
* width
);
213 for (i
= 0; i
< height
; i
++) {
214 uint16_t *row
= (uint16_t *)dst
;
215 for (j
= 0; j
< width
; j
++)
216 *row
++ = (uint16_t) arg
.clear_zstencil
;
221 for (i
= 0; i
< height
; i
++) {
222 uint32_t *row
= (uint32_t *)dst
;
223 for (j
= 0; j
< width
; j
++)
224 *row
++ = arg
.clear_zstencil
;
236 * Load tile color from the framebuffer surface.
237 * This is a bin command called during bin processing.
240 lp_rast_load_color(struct lp_rasterizer_task
*task
,
241 const union lp_rast_cmd_arg arg
)
243 struct lp_rasterizer
*rast
= task
->rast
;
244 const unsigned x
= task
->x
, y
= task
->y
;
247 LP_DBG(DEBUG_RAST
, "%s at %u, %u\n", __FUNCTION__
, x
, y
);
249 for (i
= 0; i
< rast
->state
.nr_cbufs
; i
++) {
250 if (x
>= rast
->cbuf
[i
].width
|| y
>= rast
->cbuf
[i
].height
)
253 lp_tile_read_4ub(rast
->cbuf
[i
].format
,
256 rast
->cbuf
[i
].stride
,
258 TILE_SIZE
, TILE_SIZE
);
260 LP_COUNT(nr_color_tile_load
);
266 lp_rast_set_state(struct lp_rasterizer_task
*task
,
267 const union lp_rast_cmd_arg arg
)
269 const struct lp_rast_state
*state
= arg
.set_state
;
271 LP_DBG(DEBUG_RAST
, "%s %p\n", __FUNCTION__
, (void *) state
);
273 /* just set the current state pointer for this rasterizer */
274 task
->current_state
= state
;
280 * Run the shader on all blocks in a tile. This is used when a tile is
281 * completely contained inside a triangle.
282 * This is a bin command called during bin processing.
285 lp_rast_shade_tile(struct lp_rasterizer_task
*task
,
286 const union lp_rast_cmd_arg arg
)
288 struct lp_rasterizer
*rast
= task
->rast
;
289 const struct lp_rast_state
*state
= task
->current_state
;
290 struct lp_rast_tile
*tile
= &task
->tile
;
291 const struct lp_rast_shader_inputs
*inputs
= arg
.shade_tile
;
292 const unsigned tile_x
= task
->x
, tile_y
= task
->y
;
295 LP_DBG(DEBUG_RAST
, "%s\n", __FUNCTION__
);
297 /* render the whole 64x64 tile in 4x4 chunks */
298 for (y
= 0; y
< TILE_SIZE
; y
+= 4){
299 for (x
= 0; x
< TILE_SIZE
; x
+= 4) {
300 uint8_t *color
[PIPE_MAX_COLOR_BUFS
];
302 unsigned block_offset
, i
;
304 /* offset of the 16x16 pixel block within the tile */
305 block_offset
= ((y
/ 4) * (16 * 16) + (x
/ 4) * 16);
308 for (i
= 0; i
< rast
->state
.nr_cbufs
; i
++)
309 color
[i
] = tile
->color
[i
] + 4 * block_offset
;
312 depth
= lp_rast_depth_pointer(rast
, tile_x
+ x
, tile_y
+ y
);
315 state
->jit_function
[0]( &state
->jit_context
,
316 tile_x
+ x
, tile_y
+ y
,
322 INT_MIN
, INT_MIN
, INT_MIN
,
330 * Compute shading for a 4x4 block of pixels.
331 * This is a bin command called during bin processing.
333 void lp_rast_shade_quads( struct lp_rasterizer_task
*task
,
334 const struct lp_rast_shader_inputs
*inputs
,
335 unsigned x
, unsigned y
,
336 int32_t c1
, int32_t c2
, int32_t c3
)
338 const struct lp_rast_state
*state
= task
->current_state
;
339 struct lp_rasterizer
*rast
= task
->rast
;
340 struct lp_rast_tile
*tile
= &task
->tile
;
341 uint8_t *color
[PIPE_MAX_COLOR_BUFS
];
350 assert(x
% TILE_VECTOR_WIDTH
== 0);
351 assert(y
% TILE_VECTOR_HEIGHT
== 0);
353 assert((x
% 4) == 0);
354 assert((y
% 4) == 0);
359 /* offset of the 16x16 pixel block within the tile */
360 block_offset
= ((iy
/ 4) * (16 * 16) + (ix
/ 4) * 16);
363 for (i
= 0; i
< rast
->state
.nr_cbufs
; i
++)
364 color
[i
] = tile
->color
[i
] + 4 * block_offset
;
367 depth
= lp_rast_depth_pointer(rast
, x
, y
);
370 assert(lp_check_alignment(tile
->color
[0], 16));
371 assert(lp_check_alignment(state
->jit_context
.blend_color
, 16));
373 assert(lp_check_alignment(inputs
->step
[0], 16));
374 assert(lp_check_alignment(inputs
->step
[1], 16));
375 assert(lp_check_alignment(inputs
->step
[2], 16));
378 state
->jit_function
[1]( &state
->jit_context
,
386 inputs
->step
[0], inputs
->step
[1], inputs
->step
[2]);
391 * Set top row and left column of the tile's pixels to white. For debugging.
394 outline_tile(uint8_t *tile
)
396 const uint8_t val
= 0xff;
399 for (i
= 0; i
< TILE_SIZE
; i
++) {
400 TILE_PIXEL(tile
, i
, 0, 0) = val
;
401 TILE_PIXEL(tile
, i
, 0, 1) = val
;
402 TILE_PIXEL(tile
, i
, 0, 2) = val
;
403 TILE_PIXEL(tile
, i
, 0, 3) = val
;
405 TILE_PIXEL(tile
, 0, i
, 0) = val
;
406 TILE_PIXEL(tile
, 0, i
, 1) = val
;
407 TILE_PIXEL(tile
, 0, i
, 2) = val
;
408 TILE_PIXEL(tile
, 0, i
, 3) = val
;
414 * Draw grid of gray lines at 16-pixel intervals across the tile to
415 * show the sub-tile boundaries. For debugging.
418 outline_subtiles(uint8_t *tile
)
420 const uint8_t val
= 0x80;
421 const unsigned step
= 16;
424 for (i
= 0; i
< TILE_SIZE
; i
+= step
) {
425 for (j
= 0; j
< TILE_SIZE
; j
++) {
426 TILE_PIXEL(tile
, i
, j
, 0) = val
;
427 TILE_PIXEL(tile
, i
, j
, 1) = val
;
428 TILE_PIXEL(tile
, i
, j
, 2) = val
;
429 TILE_PIXEL(tile
, i
, j
, 3) = val
;
431 TILE_PIXEL(tile
, j
, i
, 0) = val
;
432 TILE_PIXEL(tile
, j
, i
, 1) = val
;
433 TILE_PIXEL(tile
, j
, i
, 2) = val
;
434 TILE_PIXEL(tile
, j
, i
, 3) = val
;
444 * Write the rasterizer's color tile to the framebuffer.
447 lp_rast_store_color(struct lp_rasterizer_task
*task
)
449 struct lp_rasterizer
*rast
= task
->rast
;
450 const unsigned x
= task
->x
, y
= task
->y
;
453 for (i
= 0; i
< rast
->state
.nr_cbufs
; i
++) {
454 if (x
>= rast
->cbuf
[i
].width
)
457 if (y
>= rast
->cbuf
[i
].height
)
460 LP_DBG(DEBUG_RAST
, "%s [%u] %d,%d\n", __FUNCTION__
,
461 task
->thread_index
, x
, y
);
463 if (LP_DEBUG
& DEBUG_SHOW_SUBTILES
)
464 outline_subtiles(task
->tile
.color
[i
]);
465 else if (LP_DEBUG
& DEBUG_SHOW_TILES
)
466 outline_tile(task
->tile
.color
[i
]);
468 lp_tile_write_4ub(rast
->cbuf
[i
].format
,
471 rast
->cbuf
[i
].stride
,
473 TILE_SIZE
, TILE_SIZE
);
475 LP_COUNT(nr_color_tile_store
);
482 * Signal on a fence. This is called during bin execution/rasterization.
486 lp_rast_fence(struct lp_rasterizer_task
*task
,
487 const union lp_rast_cmd_arg arg
)
489 struct lp_fence
*fence
= arg
.fence
;
491 pipe_mutex_lock( fence
->mutex
);
494 assert(fence
->count
<= fence
->rank
);
496 LP_DBG(DEBUG_RAST
, "%s count=%u rank=%u\n", __FUNCTION__
,
497 fence
->count
, fence
->rank
);
499 pipe_condvar_signal( fence
->signalled
);
501 pipe_mutex_unlock( fence
->mutex
);
508 * Rasterize commands for a single bin.
509 * \param x, y position of the bin's tile in the framebuffer
510 * Must be called between lp_rast_begin() and lp_rast_end().
514 rasterize_bin(struct lp_rasterizer_task
*task
,
515 const struct cmd_bin
*bin
,
518 const struct cmd_block_list
*commands
= &bin
->commands
;
519 struct cmd_block
*block
;
522 lp_rast_start_tile( task
, x
* TILE_SIZE
, y
* TILE_SIZE
);
524 /* simply execute each of the commands in the block list */
525 for (block
= commands
->head
; block
; block
= block
->next
) {
526 for (k
= 0; k
< block
->count
; k
++) {
527 block
->cmd
[k
]( task
, block
->arg
[k
] );
531 /* Write the rasterizer's tiles to the framebuffer.
533 if (task
->rast
->state
.write_color
)
534 lp_rast_store_color(task
);
536 /* Free data for this bin.
538 lp_scene_bin_reset( task
->rast
->curr_scene
, x
, y
);
542 #define RAST(x) { lp_rast_##x, #x }
551 RAST(clear_zstencil
),
559 debug_bin( const struct cmd_bin
*bin
)
561 const struct cmd_block
*head
= bin
->commands
.head
;
564 for (i
= 0; i
< head
->count
; i
++) {
565 debug_printf("%d: ", i
);
566 for (j
= 0; j
< Elements(cmd_names
); j
++) {
567 if (head
->cmd
[i
] == cmd_names
[j
].cmd
) {
568 debug_printf("%s\n", cmd_names
[j
].name
);
572 if (j
== Elements(cmd_names
))
573 debug_printf("...other\n");
578 /* An empty bin is one that just loads the contents of the tile and
579 * stores them again unchanged. This typically happens when bins have
580 * been flushed for some reason in the middle of a frame, or when
581 * incremental updates are being made to a render target.
583 * Try to avoid doing pointless work in this case.
586 is_empty_bin( const struct cmd_bin
*bin
)
588 const struct cmd_block
*head
= bin
->commands
.head
;
594 /* We emit at most two load-tile commands at the start of the first
595 * command block. In addition we seem to emit a couple of
596 * set-state commands even in empty bins.
598 * As a heuristic, if a bin has more than 4 commands, consider it
601 if (head
->next
!= NULL
||
606 for (i
= 0; i
< head
->count
; i
++)
607 if (head
->cmd
[i
] != lp_rast_load_color
&&
608 head
->cmd
[i
] != lp_rast_set_state
) {
618 * Rasterize/execute all bins within a scene.
622 rasterize_scene(struct lp_rasterizer_task
*task
,
623 struct lp_scene
*scene
)
625 /* loop over scene bins, rasterize each */
629 for (i
= 0; i
< scene
->tiles_x
; i
++) {
630 for (j
= 0; j
< scene
->tiles_y
; j
++) {
631 struct cmd_bin
*bin
= lp_scene_get_bin(scene
, i
, j
);
632 rasterize_bin(task
, bin
, i
, j
);
642 while ((bin
= lp_scene_bin_iter_next(scene
, &x
, &y
))) {
643 if (!is_empty_bin( bin
))
644 rasterize_bin(task
, bin
, x
, y
);
652 * Called by setup module when it has something for us to render.
655 lp_rast_queue_scene( struct lp_rasterizer
*rast
,
656 struct lp_scene
*scene
)
658 LP_DBG(DEBUG_SETUP
, "%s\n", __FUNCTION__
);
660 if (rast
->num_threads
== 0) {
663 lp_rast_begin( rast
, scene
);
665 rasterize_scene( &rast
->tasks
[0], scene
);
667 lp_scene_reset( scene
);
668 rast
->curr_scene
= NULL
;
671 /* threaded rendering! */
674 lp_scene_enqueue( rast
->full_scenes
, scene
);
676 /* signal the threads that there's work to do */
677 for (i
= 0; i
< rast
->num_threads
; i
++) {
678 pipe_semaphore_signal(&rast
->tasks
[i
].work_ready
);
682 LP_DBG(DEBUG_SETUP
, "%s done \n", __FUNCTION__
);
687 lp_rast_finish( struct lp_rasterizer
*rast
)
689 if (rast
->num_threads
== 0) {
695 /* wait for work to complete */
696 for (i
= 0; i
< rast
->num_threads
; i
++) {
697 pipe_semaphore_wait(&rast
->tasks
[i
].work_done
);
704 * This is the thread's main entrypoint.
705 * It's a simple loop:
708 * 3. signal that we're done
710 static PIPE_THREAD_ROUTINE( thread_func
, init_data
)
712 struct lp_rasterizer_task
*task
= (struct lp_rasterizer_task
*) init_data
;
713 struct lp_rasterizer
*rast
= task
->rast
;
714 boolean debug
= false;
719 debug_printf("thread %d waiting for work\n", task
->thread_index
);
720 pipe_semaphore_wait(&task
->work_ready
);
725 if (task
->thread_index
== 0) {
727 * - get next scene to rasterize
728 * - map the framebuffer surfaces
731 lp_scene_dequeue( rast
->full_scenes
, TRUE
) );
734 /* Wait for all threads to get here so that threads[1+] don't
735 * get a null rast->curr_scene pointer.
737 pipe_barrier_wait( &rast
->barrier
);
741 debug_printf("thread %d doing work\n", task
->thread_index
);
743 rasterize_scene(task
,
746 /* wait for all threads to finish with this scene */
747 pipe_barrier_wait( &rast
->barrier
);
749 /* XXX: shouldn't be necessary:
751 if (task
->thread_index
== 0) {
755 /* signal done with work */
757 debug_printf("thread %d done working\n", task
->thread_index
);
759 pipe_semaphore_signal(&task
->work_done
);
767 * Initialize semaphores and spawn the threads.
770 create_rast_threads(struct lp_rasterizer
*rast
)
774 #ifdef PIPE_OS_WINDOWS
775 /* Multithreading not supported on windows until conditions and barriers are
776 * properly implemented. */
777 rast
->num_threads
= 0;
779 rast
->num_threads
= util_cpu_caps
.nr_cpus
;
780 rast
->num_threads
= debug_get_num_option("LP_NUM_THREADS", rast
->num_threads
);
781 rast
->num_threads
= MIN2(rast
->num_threads
, MAX_THREADS
);
784 /* NOTE: if num_threads is zero, we won't use any threads */
785 for (i
= 0; i
< rast
->num_threads
; i
++) {
786 pipe_semaphore_init(&rast
->tasks
[i
].work_ready
, 0);
787 pipe_semaphore_init(&rast
->tasks
[i
].work_done
, 0);
788 rast
->threads
[i
] = pipe_thread_create(thread_func
,
789 (void *) &rast
->tasks
[i
]);
796 * Create new lp_rasterizer.
797 * \param empty the queue to put empty scenes on after we've finished
800 struct lp_rasterizer
*
801 lp_rast_create( void )
803 struct lp_rasterizer
*rast
;
806 rast
= CALLOC_STRUCT(lp_rasterizer
);
810 rast
->full_scenes
= lp_scene_queue_create();
812 for (i
= 0; i
< Elements(rast
->tasks
); i
++) {
813 struct lp_rasterizer_task
*task
= &rast
->tasks
[i
];
815 for (cbuf
= 0; cbuf
< PIPE_MAX_COLOR_BUFS
; cbuf
++ )
816 task
->tile
.color
[cbuf
] = align_malloc(TILE_SIZE
* TILE_SIZE
* 4, 16);
819 task
->thread_index
= i
;
822 create_rast_threads(rast
);
824 /* for synchronizing rasterization threads */
825 pipe_barrier_init( &rast
->barrier
, rast
->num_threads
);
833 void lp_rast_destroy( struct lp_rasterizer
*rast
)
837 for (i
= 0; i
< Elements(rast
->tasks
); i
++) {
838 for (cbuf
= 0; cbuf
< PIPE_MAX_COLOR_BUFS
; cbuf
++ )
839 align_free(rast
->tasks
[i
].tile
.color
[cbuf
]);
842 /* Set exit_flag and signal each thread's work_ready semaphore.
843 * Each thread will be woken up, notice that the exit_flag is set and
844 * break out of its main loop. The thread will then exit.
846 rast
->exit_flag
= TRUE
;
847 for (i
= 0; i
< rast
->num_threads
; i
++) {
848 pipe_semaphore_signal(&rast
->tasks
[i
].work_ready
);
851 /* Wait for threads to terminate before cleaning up per-thread data */
852 for (i
= 0; i
< rast
->num_threads
; i
++) {
853 pipe_thread_wait(rast
->threads
[i
]);
856 /* Clean up per-thread data */
857 for (i
= 0; i
< rast
->num_threads
; i
++) {
858 pipe_semaphore_destroy(&rast
->tasks
[i
].work_ready
);
859 pipe_semaphore_destroy(&rast
->tasks
[i
].work_done
);
862 /* for synchronizing rasterization threads */
863 pipe_barrier_destroy( &rast
->barrier
);
869 /** Return number of rasterization threads */
871 lp_rast_get_num_threads( struct lp_rasterizer
*rast
)
873 return rast
->num_threads
;