#include "draw/draw_vbuf.h"
-/** XXX temporary value, temporary here */
-#define MAX_SCENES 2
-
-
static void set_scene_state( struct setup_context *, unsigned );
/**
- * Is the given texture referenced in the setup module's current scene?
+ * Is the given texture referenced by any scene?
+ * Note: we have to check all scenes including any scenes currently
+ * being rendered and the current scene being built.
*/
boolean
lp_setup_is_texture_referenced( const struct setup_context *setup,
const struct pipe_texture *texture )
{
- const struct lp_scene *scene = setup->scene;
- if (scene && lp_scene_is_textured_referenced(scene, texture)) {
- return PIPE_REFERENCED_FOR_READ;
+ unsigned i;
+ for (i = 0; i < Elements(setup->scenes); i++) {
+ if (lp_scene_is_textured_referenced(setup->scenes[i], texture)) {
+ return PIPE_REFERENCED_FOR_READ;
+ }
}
return PIPE_UNREFERENCED;
}
/* create some empty scenes */
for (i = 0; i < MAX_SCENES; i++) {
- struct lp_scene *scene = lp_scene_create();
- lp_scene_enqueue(setup->empty_scenes, scene);
+ setup->scenes[i] = lp_scene_create();
+ lp_scene_enqueue(setup->empty_scenes, setup->scenes[i]);
}
setup->triangle = first_triangle;
struct lp_scene_queue;
+/** Max number of scenes */
+#define MAX_SCENES 2
+
+
+
/**
* Point/line/triangle setup context.
* Note: "stored" below indicates data which is stored in the bins,
*/
struct draw_stage *vbuf;
struct lp_rasterizer *rast;
+ struct lp_scene *scenes[MAX_SCENES]; /**< all the scenes */
struct lp_scene *scene; /**< current scene being built */
struct lp_scene_queue *empty_scenes; /**< queue of empty scenes */