summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTopi Pohjolainen <topi.pohjolainen@intel.com>2018-04-13 23:14:21 -0400
committerTopi Pohjolainen <topi.pohjolainen@intel.com>2018-04-13 23:14:21 -0400
commit066c3267d0b19c20e6ff999933d1b1cfefc59fb3 (patch)
treebabb6ade92510b0a55cd304982bcdca0def7990c
parentb2ef7f9518adbe3fcac94bddc47c9ec06cc3b6f9 (diff)
batchbuffer: dbg
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
-rw-r--r--src/mesa/drivers/dri/i965/intel_batchbuffer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
index 55889be732..66dfe1fa3d 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
@@ -1159,6 +1159,8 @@ brw_state_batch_size(struct brw_context *brw, uint32_t offset)
return entry ? (uintptr_t) entry->data : 0;
}
+#define VS_GS_HS_DS_EXTRA (27 * ((9 * 4) + (10 * 4) + (9 * 4) + (11 * 4)))
+
/**
* Reserve some space in the statebuffer, or flush.
*
@@ -1168,7 +1170,7 @@ brw_state_batch_size(struct brw_context *brw, uint32_t offset)
void
brw_require_statebuffer_space(struct brw_context *brw, int size)
{
- if (brw->batch.state_used + size >= STATE_SZ)
+ if (brw->batch.state_used + size + VS_GS_HS_DS_EXTRA >= STATE_SZ)
intel_batchbuffer_flush(brw);
}
@@ -1187,10 +1189,10 @@ brw_state_batch(struct brw_context *brw,
uint32_t offset = ALIGN(batch->state_used, alignment);
- if (offset + size >= STATE_SZ && !batch->no_wrap) {
+ if (offset + size + VS_GS_HS_DS_EXTRA >= STATE_SZ && !batch->no_wrap) {
intel_batchbuffer_flush(brw);
offset = ALIGN(batch->state_used, alignment);
- } else if (offset + size >= batch->state.bo->size) {
+ } else if (offset + size + VS_GS_HS_DS_EXTRA >= batch->state.bo->size) {
const unsigned new_size =
MIN2(batch->state.bo->size + batch->state.bo->size / 2,
MAX_STATE_SIZE);