freedreno: a2xx: fix fast clear not being used for Z24X8 buffers
[mesa.git] / src / gallium / drivers / freedreno / freedreno_batch.h
index d4feadd55904b73245e7a2a2a2646e7537b2210a..edf0840825be470855be6c77bc112d1512b9aad7 100644 (file)
@@ -122,8 +122,10 @@ struct fd_batch {
 
                FD_GMEM_BLEND_ENABLED        = 0x10,
                FD_GMEM_LOGICOP_ENABLED      = 0x20,
+               FD_GMEM_FB_READ              = 0x40,
        } gmem_reason;
        unsigned num_draws;   /* number of draws in current batch */
+       unsigned num_vertices;   /* number of vertices in current batch */
 
        /* Track the maximal bounds of the scissor of all the draws within a
         * batch.  Used at the tile rendering step (fd_gmem_render_tiles(),
@@ -136,6 +138,9 @@ struct fd_batch {
         */
        struct util_dynarray draw_patches;
 
+       /* texture state that needs patching for fb_read: */
+       struct util_dynarray fb_read_patches;
+
        /* Keep track of writes to RB_RENDER_CONTROL which need to be patched
         * once we know whether or not to use GMEM, and GMEM tile pitch.
         *
@@ -144,6 +149,18 @@ struct fd_batch {
         */
        struct util_dynarray rbrc_patches;
 
+       /* Keep track of GMEM related values that need to be patched up once we
+        * know the gmem layout:
+        */
+       struct util_dynarray gmem_patches;
+
+       /* Keep track of pointer to start of MEM exports for a20x binning shaders
+        *
+        * this is so the end of the shader can be cut off at the right point
+        * depending on the GMEM configuration
+        */
+       struct util_dynarray shader_patches;
+
        struct pipe_framebuffer_state framebuffer;
 
        struct fd_submit *submit;
@@ -212,7 +229,7 @@ struct fd_batch * fd_batch_create(struct fd_context *ctx, bool nondraw);
 
 void fd_batch_reset(struct fd_batch *batch);
 void fd_batch_sync(struct fd_batch *batch);
-void fd_batch_flush(struct fd_batch *batch, bool sync, bool force);
+void fd_batch_flush(struct fd_batch *batch, bool sync);
 void fd_batch_add_dep(struct fd_batch *batch, struct fd_batch *dep);
 void fd_batch_resource_used(struct fd_batch *batch, struct fd_resource *rsc, bool write);
 void fd_batch_check_size(struct fd_batch *batch);
@@ -230,6 +247,10 @@ void __fd_batch_destroy(struct fd_batch *batch);
  * WARNING the _locked() version can briefly drop the lock.  Without
  * recursive mutexes, I'm not sure there is much else we can do (since
  * __fd_batch_destroy() needs to unref resources)
+ *
+ * WARNING you must acquire the screen->lock and use the _locked()
+ * version in case that the batch being ref'd can disappear under
+ * you.
  */
 
 /* fwd-decl prototypes to untangle header dependency :-/ */