intel: Reserve enough space to finish occlusion queries on Gen6.
[mesa.git] / src / mesa / drivers / dri / intel / intel_batchbuffer.h
index d2744e44ac22a9d7f7fe42596134c3276de8a589..b8b60cd862ba206cb5a785c4c849dee5692ab2b6 100644 (file)
 extern "C" {
 #endif
 
-#define BATCH_RESERVED 16
+/**
+ * Number of bytes to reserve for commands necessary to complete a batch.
+ *
+ * This includes:
+ * - MI_BATCHBUFFER_END (4 bytes)
+ * - Optional MI_NOOP for ensuring the batch length is qword aligned (4 bytes)
+ * - Any state emitted by vtbl->finish_batch()
+ *   - On 965+, this means ending occlusion queries (on Gen6, which has the
+ *     most workaround flushes, this can be as much as (4+4+5)*4 = 52 bytes)
+ */
+#define BATCH_RESERVED 60
 
 struct intel_batchbuffer;