#define LP_SCENE_H
#include "os/os_thread.h"
-#include "lp_tile_soa.h"
#include "lp_rast.h"
#include "lp_debug.h"
#define TILES_Y (LP_MAX_HEIGHT / TILE_SIZE)
-#define CMD_BLOCK_MAX 128
+/* Commands per command block (ideally so sizeof(cmd_block) is a power of
+ * two in size.)
+ */
+#define CMD_BLOCK_MAX 29
+
+/* Bytes per data block.
+ */
#define DATA_BLOCK_SIZE (64 * 1024)
/* Scene temporary storage is clamped to this size:
*/
-#define LP_SCENE_MAX_SIZE (4*1024*1024)
+#define LP_SCENE_MAX_SIZE (9*1024*1024)
/* The maximum amount of texture storage referenced by a scene is
* clamped ot this size:
struct cmd_block *next;
};
-struct cmd_block_list {
- struct cmd_block *head;
- struct cmd_block *tail;
-};
struct data_block {
ubyte data[DATA_BLOCK_SIZE];
* For each screen tile we have one of these bins.
*/
struct cmd_bin {
- ushort x;
- ushort y;
const struct lp_rast_state *last_state; /* most recent state set in bin */
struct cmd_block *head;
struct cmd_block *tail;
struct pipe_context *pipe;
struct lp_fence *fence;
+ /* The queries still active at end of scene */
+ struct llvmpipe_query *active_queries[LP_MAX_ACTIVE_BINNED_QUERIES];
+ unsigned num_active_queries;
+ /* If queries were either active or there were begin/end query commands */
+ boolean had_queries;
+
/* Framebuffer mappings - valid only between begin_rasterization()
* and end_rasterization().
*/
struct {
uint8_t *map;
unsigned stride;
- unsigned blocksize;
+ unsigned layer_stride;
} zsbuf, cbufs[PIPE_MAX_COLOR_BUFS];
-
+
+ /* The amount of layers in the fb (minimum of all attachments) */
+ unsigned fb_max_layer;
+
/** the framebuffer to render the scene into */
struct pipe_framebuffer_state fb;
unsigned resource_reference_size;
boolean alloc_failed;
- boolean has_depthstencil_clear;
-
+ boolean discard;
/**
* Number of active tiles in each dimension.
* This basically the framebuffer size divided by tile size
lp_scene_bin_iter_begin( struct lp_scene *scene );
struct cmd_bin *
-lp_scene_bin_iter_next( struct lp_scene *scene );
+lp_scene_bin_iter_next( struct lp_scene *scene, int *x, int *y );
*/
void
lp_scene_begin_binning( struct lp_scene *scene,
- struct pipe_framebuffer_state *fb );
+ struct pipe_framebuffer_state *fb,
+ boolean discard );
void
lp_scene_end_binning( struct lp_scene *scene );