radeonsi: force NaNs to 0
[mesa.git] / src / gallium / drivers / llvmpipe / lp_scene.h
index 622c522f11a01bc72ae84e55a37078b57b255b49..19a38115afeb55eea491831ccc52594b70b999e2 100644 (file)
@@ -36,7 +36,6 @@
 #define LP_SCENE_H
 
 #include "os/os_thread.h"
-#include "lp_tile_soa.h"
 #include "lp_rast.h"
 #include "lp_debug.h"
 
@@ -50,12 +49,18 @@ struct lp_rast_state;
 #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:
@@ -76,10 +81,6 @@ struct cmd_block {
    struct cmd_block *next;
 };
 
-struct cmd_block_list {
-   struct cmd_block *head;
-   struct cmd_block *tail;
-};
 
 struct data_block {
    ubyte data[DATA_BLOCK_SIZE];
@@ -93,8 +94,6 @@ struct data_block {
  * 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;
@@ -130,15 +129,24 @@ struct lp_scene {
    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;
 
@@ -157,8 +165,7 @@ struct lp_scene {
    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
@@ -374,7 +381,7 @@ void
 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 );
 
 
 
@@ -382,7 +389,8 @@ lp_scene_bin_iter_next( struct lp_scene *scene );
  */
 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 );