summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-26 18:27:37 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-26 18:27:37 -0700
commit8dc597290813f58e2f2b7ddcb4ad762ea379c1f7 (patch)
treef04eb04e3fe0f7bb01d5fbec514193c330b1a70d
parent651e8e9a73b4f0c3424a78b978f710d098f47ae2 (diff)
Cell: added cell_batch_free_space()
-rw-r--r--src/mesa/pipe/cell/ppu/cell_batch.c11
-rw-r--r--src/mesa/pipe/cell/ppu/cell_batch.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_batch.c b/src/mesa/pipe/cell/ppu/cell_batch.c
index 5a25f1b266..c894ef8608 100644
--- a/src/mesa/pipe/cell/ppu/cell_batch.c
+++ b/src/mesa/pipe/cell/ppu/cell_batch.c
@@ -96,6 +96,15 @@ cell_batch_flush(struct cell_context *cell)
}
+uint
+cell_batch_free_space(const struct cell_context *cell)
+{
+ uint free = CELL_BATCH_BUFFER_SIZE
+ - cell->batch_buffer_size[cell->cur_batch];
+ return free;
+}
+
+
/**
* \param cmd command to append
* \param length command size in bytes
@@ -129,6 +138,8 @@ cell_batch_alloc(struct cell_context *cell, uint bytes)
void *pos;
uint size;
+ ASSERT(bytes % 4 == 0);
+
assert(cell->cur_batch >= 0);
size = cell->batch_buffer_size[cell->cur_batch];
diff --git a/src/mesa/pipe/cell/ppu/cell_batch.h b/src/mesa/pipe/cell/ppu/cell_batch.h
index 47e3287626..c4ba7feb3d 100644
--- a/src/mesa/pipe/cell/ppu/cell_batch.h
+++ b/src/mesa/pipe/cell/ppu/cell_batch.h
@@ -38,6 +38,9 @@ struct cell_context;
extern void
cell_batch_flush(struct cell_context *cell);
+extern uint
+cell_batch_free_space(const struct cell_context *cell);
+
extern void
cell_batch_append(struct cell_context *cell, const void *cmd, uint length);