1 /**************************************************************************
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
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 TUNGSTEN GRAPHICS 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 **************************************************************************/
31 * Builds per-tile display lists and executes them on calls to
35 #include "pipe/p_defines.h"
36 #include "util/u_inlines.h"
37 #include "util/u_memory.h"
38 #include "util/u_pack_color.h"
39 #include "util/u_surface.h"
40 #include "lp_context.h"
42 #include "lp_scene_queue.h"
43 #include "lp_texture.h"
47 #include "lp_setup_context.h"
48 #include "lp_screen.h"
50 #include "state_tracker/sw_winsys.h"
52 #include "draw/draw_context.h"
53 #include "draw/draw_vbuf.h"
56 static void set_scene_state( struct lp_setup_context
*, enum setup_state
);
60 lp_setup_get_current_scene(struct lp_setup_context
*setup
)
64 /* wait for a free/empty scene
66 setup
->scene
= lp_scene_dequeue(setup
->empty_scenes
, TRUE
);
68 assert(lp_scene_is_empty(setup
->scene
));
70 lp_scene_begin_binning(setup
->scene
,
78 * Check if the size of the current scene has exceeded the limit.
79 * If so, flush/render it.
82 setup_check_scene_size_and_flush(struct lp_setup_context
*setup
)
85 struct lp_scene
*scene
= lp_setup_get_current_scene(setup
);
86 unsigned size
= lp_scene_get_size(scene
);
88 if (size
> LP_MAX_SCENE_SIZE
) {
89 /*printf("LLVMPIPE: scene size = %u, flushing.\n", size);*/
90 set_scene_state( setup
, SETUP_FLUSHED
);
91 /*assert(lp_scene_get_size(scene) == 0);*/
98 first_triangle( struct lp_setup_context
*setup
,
100 const float (*v1
)[4],
101 const float (*v2
)[4])
103 set_scene_state( setup
, SETUP_ACTIVE
);
104 lp_setup_choose_triangle( setup
);
105 setup
->triangle( setup
, v0
, v1
, v2
);
109 first_line( struct lp_setup_context
*setup
,
110 const float (*v0
)[4],
111 const float (*v1
)[4])
113 set_scene_state( setup
, SETUP_ACTIVE
);
114 lp_setup_choose_line( setup
);
115 setup
->line( setup
, v0
, v1
);
119 first_point( struct lp_setup_context
*setup
,
120 const float (*v0
)[4])
122 set_scene_state( setup
, SETUP_ACTIVE
);
123 lp_setup_choose_point( setup
);
124 setup
->point( setup
, v0
);
127 static void reset_context( struct lp_setup_context
*setup
)
129 LP_DBG(DEBUG_SETUP
, "%s\n", __FUNCTION__
);
131 /* Reset derived state */
132 setup
->constants
.stored_size
= 0;
133 setup
->constants
.stored_data
= NULL
;
134 setup
->fs
.stored
= NULL
;
142 setup
->clear
.flags
= 0;
144 /* Have an explicit "start-binning" call and get rid of this
147 setup
->line
= first_line
;
148 setup
->point
= first_point
;
149 setup
->triangle
= first_triangle
;
153 /** Rasterize all scene's bins */
155 lp_setup_rasterize_scene( struct lp_setup_context
*setup
)
157 struct lp_scene
*scene
= lp_setup_get_current_scene(setup
);
159 lp_scene_rasterize(scene
, setup
->rast
);
161 reset_context( setup
);
163 LP_DBG(DEBUG_SETUP
, "%s done \n", __FUNCTION__
);
169 begin_binning( struct lp_setup_context
*setup
)
171 struct lp_scene
*scene
= lp_setup_get_current_scene(setup
);
173 LP_DBG(DEBUG_SETUP
, "%s color: %s depth: %s\n", __FUNCTION__
,
174 (setup
->clear
.flags
& PIPE_CLEAR_COLOR
) ? "clear": "load",
175 (setup
->clear
.flags
& PIPE_CLEAR_DEPTHSTENCIL
) ? "clear": "load");
177 if (setup
->fb
.nr_cbufs
) {
178 if (setup
->clear
.flags
& PIPE_CLEAR_COLOR
) {
179 lp_scene_bin_everywhere( scene
,
181 setup
->clear
.color
);
182 scene
->has_color_clear
= TRUE
;
186 if (setup
->fb
.zsbuf
) {
187 if (setup
->clear
.flags
& PIPE_CLEAR_DEPTHSTENCIL
) {
188 lp_scene_bin_everywhere( scene
,
189 lp_rast_clear_zstencil
,
190 setup
->clear
.zstencil
);
191 scene
->has_depth_clear
= TRUE
;
195 LP_DBG(DEBUG_SETUP
, "%s done\n", __FUNCTION__
);
199 /* This basically bins and then flushes any outstanding full-screen
202 * TODO: fast path for fullscreen clears and no triangles.
205 execute_clears( struct lp_setup_context
*setup
)
207 LP_DBG(DEBUG_SETUP
, "%s\n", __FUNCTION__
);
209 begin_binning( setup
);
210 lp_setup_rasterize_scene( setup
);
215 set_scene_state( struct lp_setup_context
*setup
,
216 enum setup_state new_state
)
218 unsigned old_state
= setup
->state
;
220 if (old_state
== new_state
)
223 LP_DBG(DEBUG_SETUP
, "%s old %d new %d\n", __FUNCTION__
, old_state
, new_state
);
227 begin_binning( setup
);
231 if (old_state
== SETUP_ACTIVE
) {
238 if (old_state
== SETUP_CLEARED
)
239 execute_clears( setup
);
241 lp_setup_rasterize_scene( setup
);
245 assert(0 && "invalid setup state mode");
248 setup
->state
= new_state
;
253 * \param flags bitmask of PIPE_FLUSH_x flags
256 lp_setup_flush( struct lp_setup_context
*setup
,
259 LP_DBG(DEBUG_SETUP
, "%s\n", __FUNCTION__
);
262 struct lp_scene
*scene
= lp_setup_get_current_scene(setup
);
263 union lp_rast_cmd_arg dummy
= {0};
265 if (flags
& (PIPE_FLUSH_SWAPBUFFERS
|
267 /* Store colors in the linear color buffer(s).
268 * If we don't do this here, we'll end up converting the tiled
269 * data to linear in the texture_unmap() function, which will
270 * not be a parallel/threaded operation as here.
272 lp_scene_bin_everywhere(scene
, lp_rast_store_color
, dummy
);
276 set_scene_state( setup
, SETUP_FLUSHED
);
281 lp_setup_bind_framebuffer( struct lp_setup_context
*setup
,
282 const struct pipe_framebuffer_state
*fb
)
284 LP_DBG(DEBUG_SETUP
, "%s\n", __FUNCTION__
);
286 /* Flush any old scene.
288 set_scene_state( setup
, SETUP_FLUSHED
);
290 /* Set new state. This will be picked up later when we next need a
293 util_copy_framebuffer_state(&setup
->fb
, fb
);
298 lp_setup_clear( struct lp_setup_context
*setup
,
304 struct lp_scene
*scene
= lp_setup_get_current_scene(setup
);
307 LP_DBG(DEBUG_SETUP
, "%s state %d\n", __FUNCTION__
, setup
->state
);
310 if (flags
& PIPE_CLEAR_COLOR
) {
311 for (i
= 0; i
< 4; ++i
)
312 setup
->clear
.color
.clear_color
[i
] = float_to_ubyte(color
[i
]);
315 if (flags
& PIPE_CLEAR_DEPTHSTENCIL
) {
316 setup
->clear
.zstencil
.clear_zstencil
=
317 util_pack_z_stencil(setup
->fb
.zsbuf
->format
,
322 if (setup
->state
== SETUP_ACTIVE
) {
323 /* Add the clear to existing scene. In the unusual case where
324 * both color and depth-stencil are being cleared when there's
325 * already been some rendering, we could discard the currently
326 * binned scene and start again, but I don't see that as being
329 if (flags
& PIPE_CLEAR_COLOR
) {
330 lp_scene_bin_everywhere( scene
,
332 setup
->clear
.color
);
333 scene
->has_color_clear
= TRUE
;
336 if (setup
->clear
.flags
& PIPE_CLEAR_DEPTHSTENCIL
) {
337 lp_scene_bin_everywhere( scene
,
338 lp_rast_clear_zstencil
,
339 setup
->clear
.zstencil
);
340 scene
->has_depth_clear
= TRUE
;
345 /* Put ourselves into the 'pre-clear' state, specifically to try
346 * and accumulate multiple clears to color and depth_stencil
347 * buffers which the app or state-tracker might issue
350 set_scene_state( setup
, SETUP_CLEARED
);
352 setup
->clear
.flags
|= flags
;
360 struct pipe_fence_handle
*
361 lp_setup_fence( struct lp_setup_context
*setup
)
363 if (setup
->num_threads
== 0) {
367 struct lp_scene
*scene
= lp_setup_get_current_scene(setup
);
368 const unsigned rank
= lp_scene_get_num_bins( scene
); /* xxx */
369 struct lp_fence
*fence
= lp_fence_create(rank
);
371 LP_DBG(DEBUG_SETUP
, "%s rank %u\n", __FUNCTION__
, rank
);
373 set_scene_state( setup
, SETUP_ACTIVE
);
375 /* insert the fence into all command bins */
376 lp_scene_bin_everywhere( scene
,
378 lp_rast_arg_fence(fence
) );
380 return (struct pipe_fence_handle
*) fence
;
386 lp_setup_set_triangle_state( struct lp_setup_context
*setup
,
388 boolean ccw_is_frontface
,
390 boolean gl_rasterization_rules
)
392 LP_DBG(DEBUG_SETUP
, "%s\n", __FUNCTION__
);
394 setup
->ccw_is_frontface
= ccw_is_frontface
;
395 setup
->cullmode
= cull_mode
;
396 setup
->triangle
= first_triangle
;
397 setup
->scissor_test
= scissor
;
398 setup
->pixel_offset
= gl_rasterization_rules
? 0.5f
: 0.0f
;
404 lp_setup_set_fs_inputs( struct lp_setup_context
*setup
,
405 const struct lp_shader_input
*input
,
408 LP_DBG(DEBUG_SETUP
, "%s %p %u\n", __FUNCTION__
, (void *) input
, nr
);
410 memcpy( setup
->fs
.input
, input
, nr
* sizeof input
[0] );
411 setup
->fs
.nr_inputs
= nr
;
415 lp_setup_set_fs_functions( struct lp_setup_context
*setup
,
416 lp_jit_frag_func jit_function0
,
417 lp_jit_frag_func jit_function1
,
420 LP_DBG(DEBUG_SETUP
, "%s %p\n", __FUNCTION__
, (void *) jit_function0
);
421 /* FIXME: reference count */
423 setup
->fs
.current
.jit_function
[0] = jit_function0
;
424 setup
->fs
.current
.jit_function
[1] = jit_function1
;
425 setup
->fs
.current
.opaque
= opaque
;
426 setup
->dirty
|= LP_SETUP_NEW_FS
;
430 lp_setup_set_fs_constants(struct lp_setup_context
*setup
,
431 struct pipe_resource
*buffer
)
433 LP_DBG(DEBUG_SETUP
, "%s %p\n", __FUNCTION__
, (void *) buffer
);
435 pipe_resource_reference(&setup
->constants
.current
, buffer
);
437 setup
->dirty
|= LP_SETUP_NEW_CONSTANTS
;
442 lp_setup_set_alpha_ref_value( struct lp_setup_context
*setup
,
443 float alpha_ref_value
)
445 LP_DBG(DEBUG_SETUP
, "%s %f\n", __FUNCTION__
, alpha_ref_value
);
447 if(setup
->fs
.current
.jit_context
.alpha_ref_value
!= alpha_ref_value
) {
448 setup
->fs
.current
.jit_context
.alpha_ref_value
= alpha_ref_value
;
449 setup
->dirty
|= LP_SETUP_NEW_FS
;
454 lp_setup_set_stencil_ref_values( struct lp_setup_context
*setup
,
455 const ubyte refs
[2] )
457 LP_DBG(DEBUG_SETUP
, "%s %d %d\n", __FUNCTION__
, refs
[0], refs
[1]);
459 if (setup
->fs
.current
.jit_context
.stencil_ref_front
!= refs
[0] ||
460 setup
->fs
.current
.jit_context
.stencil_ref_back
!= refs
[1]) {
461 setup
->fs
.current
.jit_context
.stencil_ref_front
= refs
[0];
462 setup
->fs
.current
.jit_context
.stencil_ref_back
= refs
[1];
463 setup
->dirty
|= LP_SETUP_NEW_FS
;
468 lp_setup_set_blend_color( struct lp_setup_context
*setup
,
469 const struct pipe_blend_color
*blend_color
)
471 LP_DBG(DEBUG_SETUP
, "%s\n", __FUNCTION__
);
475 if(memcmp(&setup
->blend_color
.current
, blend_color
, sizeof *blend_color
) != 0) {
476 memcpy(&setup
->blend_color
.current
, blend_color
, sizeof *blend_color
);
477 setup
->dirty
|= LP_SETUP_NEW_BLEND_COLOR
;
483 lp_setup_set_scissor( struct lp_setup_context
*setup
,
484 const struct pipe_scissor_state
*scissor
)
486 LP_DBG(DEBUG_SETUP
, "%s\n", __FUNCTION__
);
490 if (memcmp(&setup
->scissor
.current
, scissor
, sizeof(*scissor
)) != 0) {
491 setup
->scissor
.current
= *scissor
; /* struct copy */
492 setup
->dirty
|= LP_SETUP_NEW_SCISSOR
;
498 lp_setup_set_flatshade_first( struct lp_setup_context
*setup
,
499 boolean flatshade_first
)
501 setup
->flatshade_first
= flatshade_first
;
506 lp_setup_set_vertex_info( struct lp_setup_context
*setup
,
507 struct vertex_info
*vertex_info
)
509 /* XXX: just silently holding onto the pointer:
511 setup
->vertex_info
= vertex_info
;
516 * Called during state validation when LP_NEW_SAMPLER_VIEW is set.
519 lp_setup_set_fragment_sampler_views(struct lp_setup_context
*setup
,
521 struct pipe_sampler_view
**views
)
525 LP_DBG(DEBUG_SETUP
, "%s\n", __FUNCTION__
);
527 assert(num
<= PIPE_MAX_SAMPLERS
);
529 for (i
= 0; i
< PIPE_MAX_SAMPLERS
; i
++) {
530 struct pipe_sampler_view
*view
= i
< num
? views
[i
] : NULL
;
533 struct pipe_resource
*tex
= view
->texture
;
534 struct llvmpipe_resource
*lp_tex
= llvmpipe_resource(tex
);
535 struct lp_jit_texture
*jit_tex
;
536 jit_tex
= &setup
->fs
.current
.jit_context
.textures
[i
];
537 jit_tex
->width
= tex
->width0
;
538 jit_tex
->height
= tex
->height0
;
539 jit_tex
->depth
= tex
->depth0
;
540 jit_tex
->last_level
= tex
->last_level
;
542 /* We're referencing the texture's internal data, so save a
545 pipe_resource_reference(&setup
->fs
.current_tex
[i
], tex
);
548 /* regular texture - setup array of mipmap level pointers */
550 for (j
= 0; j
<= tex
->last_level
; j
++) {
552 llvmpipe_get_texture_image_all(lp_tex
, j
, LP_TEX_USAGE_READ
,
553 LP_TEX_LAYOUT_LINEAR
);
554 jit_tex
->row_stride
[j
] = lp_tex
->row_stride
[j
];
555 jit_tex
->img_stride
[j
] = lp_tex
->img_stride
[j
];
559 /* display target texture/surface */
561 * XXX: Where should this be unmapped?
564 struct llvmpipe_screen
*screen
= llvmpipe_screen(tex
->screen
);
565 struct sw_winsys
*winsys
= screen
->winsys
;
566 jit_tex
->data
[0] = winsys
->displaytarget_map(winsys
, lp_tex
->dt
,
568 jit_tex
->row_stride
[0] = lp_tex
->row_stride
[0];
569 jit_tex
->img_stride
[0] = lp_tex
->img_stride
[0];
570 assert(jit_tex
->data
[0]);
575 setup
->dirty
|= LP_SETUP_NEW_FS
;
580 * Is the given texture referenced by any scene?
581 * Note: we have to check all scenes including any scenes currently
582 * being rendered and the current scene being built.
585 lp_setup_is_resource_referenced( const struct lp_setup_context
*setup
,
586 const struct pipe_resource
*texture
)
590 /* check the render targets */
591 for (i
= 0; i
< setup
->fb
.nr_cbufs
; i
++) {
592 if (setup
->fb
.cbufs
[i
]->texture
== texture
)
593 return PIPE_REFERENCED_FOR_READ
| PIPE_REFERENCED_FOR_WRITE
;
595 if (setup
->fb
.zsbuf
&& setup
->fb
.zsbuf
->texture
== texture
) {
596 return PIPE_REFERENCED_FOR_READ
| PIPE_REFERENCED_FOR_WRITE
;
599 /* check textures referenced by the scene */
600 for (i
= 0; i
< Elements(setup
->scenes
); i
++) {
601 if (lp_scene_is_resource_referenced(setup
->scenes
[i
], texture
)) {
602 return PIPE_REFERENCED_FOR_READ
;
606 return PIPE_UNREFERENCED
;
611 * Called by vbuf code when we're about to draw something.
614 lp_setup_update_state( struct lp_setup_context
*setup
)
616 struct lp_scene
*scene
;
618 LP_DBG(DEBUG_SETUP
, "%s\n", __FUNCTION__
);
620 setup_check_scene_size_and_flush(setup
);
622 scene
= lp_setup_get_current_scene(setup
);
624 assert(setup
->fs
.current
.jit_function
);
626 /* Some of the 'draw' pipeline stages may have changed some driver state.
627 * Make sure we've processed those state changes before anything else.
629 * XXX this is the only place where llvmpipe_context is used in the
630 * setup code. This may get refactored/changed...
633 struct llvmpipe_context
*lp
= llvmpipe_context(scene
->pipe
);
635 llvmpipe_update_derived(lp
);
637 assert(lp
->dirty
== 0);
640 if(setup
->dirty
& LP_SETUP_NEW_BLEND_COLOR
) {
644 stored
= lp_scene_alloc_aligned(scene
, 4 * 16, 16);
646 /* smear each blend color component across 16 ubyte elements */
647 for (i
= 0; i
< 4; ++i
) {
648 uint8_t c
= float_to_ubyte(setup
->blend_color
.current
.color
[i
]);
649 for (j
= 0; j
< 16; ++j
)
650 stored
[i
*16 + j
] = c
;
653 setup
->blend_color
.stored
= stored
;
655 setup
->fs
.current
.jit_context
.blend_color
= setup
->blend_color
.stored
;
656 setup
->dirty
|= LP_SETUP_NEW_FS
;
659 if (setup
->dirty
& LP_SETUP_NEW_SCISSOR
) {
662 stored
= lp_scene_alloc_aligned(scene
, 4 * sizeof(int32_t), 16);
664 stored
[0] = (float) setup
->scissor
.current
.minx
;
665 stored
[1] = (float) setup
->scissor
.current
.miny
;
666 stored
[2] = (float) setup
->scissor
.current
.maxx
;
667 stored
[3] = (float) setup
->scissor
.current
.maxy
;
669 setup
->scissor
.stored
= stored
;
671 setup
->fs
.current
.jit_context
.scissor_xmin
= stored
[0];
672 setup
->fs
.current
.jit_context
.scissor_ymin
= stored
[1];
673 setup
->fs
.current
.jit_context
.scissor_xmax
= stored
[2];
674 setup
->fs
.current
.jit_context
.scissor_ymax
= stored
[3];
676 setup
->dirty
|= LP_SETUP_NEW_FS
;
679 if(setup
->dirty
& LP_SETUP_NEW_CONSTANTS
) {
680 struct pipe_resource
*buffer
= setup
->constants
.current
;
683 unsigned current_size
= buffer
->width0
;
684 const void *current_data
= llvmpipe_resource_data(buffer
);
686 /* TODO: copy only the actually used constants? */
688 if(setup
->constants
.stored_size
!= current_size
||
689 !setup
->constants
.stored_data
||
690 memcmp(setup
->constants
.stored_data
,
692 current_size
) != 0) {
695 stored
= lp_scene_alloc(scene
, current_size
);
700 setup
->constants
.stored_size
= current_size
;
701 setup
->constants
.stored_data
= stored
;
706 setup
->constants
.stored_size
= 0;
707 setup
->constants
.stored_data
= NULL
;
710 setup
->fs
.current
.jit_context
.constants
= setup
->constants
.stored_data
;
711 setup
->dirty
|= LP_SETUP_NEW_FS
;
715 if(setup
->dirty
& LP_SETUP_NEW_FS
) {
716 if(!setup
->fs
.stored
||
717 memcmp(setup
->fs
.stored
,
719 sizeof setup
->fs
.current
) != 0) {
720 /* The fs state that's been stored in the scene is different from
721 * the new, current state. So allocate a new lp_rast_state object
722 * and append it to the bin's setup data buffer.
725 struct lp_rast_state
*stored
=
726 (struct lp_rast_state
*) lp_scene_alloc(scene
, sizeof *stored
);
730 sizeof setup
->fs
.current
);
731 setup
->fs
.stored
= stored
;
733 /* put the state-set command into all bins */
734 lp_scene_bin_state_command( scene
,
736 lp_rast_arg_state(setup
->fs
.stored
) );
739 /* The scene now references the textures in the rasterization
740 * state record. Note that now.
742 for (i
= 0; i
< Elements(setup
->fs
.current_tex
); i
++) {
743 if (setup
->fs
.current_tex
[i
])
744 lp_scene_add_resource_reference(scene
, setup
->fs
.current_tex
[i
]);
751 assert(setup
->fs
.stored
);
756 /* Only caller is lp_setup_vbuf_destroy()
759 lp_setup_destroy( struct lp_setup_context
*setup
)
763 reset_context( setup
);
765 util_unreference_framebuffer_state(&setup
->fb
);
767 for (i
= 0; i
< Elements(setup
->fs
.current_tex
); i
++) {
768 pipe_resource_reference(&setup
->fs
.current_tex
[i
], NULL
);
771 pipe_resource_reference(&setup
->constants
.current
, NULL
);
773 /* free the scenes in the 'empty' queue */
775 struct lp_scene
*scene
= lp_scene_dequeue(setup
->empty_scenes
, FALSE
);
778 lp_scene_destroy(scene
);
781 lp_rast_destroy( setup
->rast
);
788 * Create a new primitive tiling engine. Plug it into the backend of
789 * the draw module. Currently also creates a rasterizer to use with
792 struct lp_setup_context
*
793 lp_setup_create( struct pipe_context
*pipe
,
794 struct draw_context
*draw
)
796 struct llvmpipe_screen
*screen
= llvmpipe_screen(pipe
->screen
);
797 struct lp_setup_context
*setup
= CALLOC_STRUCT(lp_setup_context
);
803 lp_setup_init_vbuf(setup
);
805 setup
->empty_scenes
= lp_scene_queue_create();
806 if (!setup
->empty_scenes
)
809 /* XXX: move this to the screen and share between contexts:
811 setup
->num_threads
= screen
->num_threads
;
812 setup
->rast
= lp_rast_create(screen
->num_threads
);
816 setup
->vbuf
= draw_vbuf_stage(draw
, &setup
->base
);
820 draw_set_rasterize_stage(draw
, setup
->vbuf
);
821 draw_set_render(draw
, &setup
->base
);
823 /* create some empty scenes */
824 for (i
= 0; i
< MAX_SCENES
; i
++) {
825 setup
->scenes
[i
] = lp_scene_create( pipe
, setup
->empty_scenes
);
827 lp_scene_enqueue(setup
->empty_scenes
, setup
->scenes
[i
]);
830 setup
->triangle
= first_triangle
;
831 setup
->line
= first_line
;
832 setup
->point
= first_point
;
840 lp_rast_destroy( setup
->rast
);
845 if (setup
->empty_scenes
)
846 lp_scene_queue_destroy(setup
->empty_scenes
);