#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:
+ * clamped to this size:
*/
#define LP_SCENE_MAX_RESOURCE_SIZE (64*1024*1024)
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;
+ unsigned format_bytes;
} 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.
unsigned tiles_x, tiles_y;
int curr_x, curr_y; /**< for iterating over bins */
- pipe_mutex mutex;
+ mtx_t mutex;
struct cmd_bin tile[TILES_X][TILES_Y];
struct data_block_list data;
* Allocate space for a command/data in the bin's data buffer.
* Grow the block list if needed.
*/
-static INLINE void *
+static inline void *
lp_scene_alloc( struct lp_scene *scene, unsigned size)
{
struct data_block_list *list = &scene->data;
/**
* As above, but with specific alignment.
*/
-static INLINE void *
+static inline void *
lp_scene_alloc_aligned( struct lp_scene *scene, unsigned size,
unsigned alignment )
{
/* Put back data if we decide not to use it, eg. culled triangles.
*/
-static INLINE void
+static inline void
lp_scene_putback_data( struct lp_scene *scene, unsigned size)
{
struct data_block_list *list = &scene->data;
/** Return pointer to a particular tile's bin. */
-static INLINE struct cmd_bin *
+static inline struct cmd_bin *
lp_scene_get_bin(struct lp_scene *scene, unsigned x, unsigned y)
{
return &scene->tile[x][y];
/* Add a command to bin[x][y].
*/
-static INLINE boolean
+static inline boolean
lp_scene_bin_command( struct lp_scene *scene,
unsigned x, unsigned y,
unsigned cmd,
}
-static INLINE boolean
+static inline boolean
lp_scene_bin_cmd_with_state( struct lp_scene *scene,
unsigned x, unsigned y,
const struct lp_rast_state *state,
/* Add a command to all active bins.
*/
-static INLINE boolean
+static inline boolean
lp_scene_bin_everywhere( struct lp_scene *scene,
unsigned cmd,
const union lp_rast_cmd_arg arg )
}
-static INLINE unsigned
+static inline unsigned
lp_scene_get_num_bins( const struct lp_scene *scene )
{
return scene->tiles_x * scene->tiles_y;
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 );