summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon/radeon_common.c
diff options
context:
space:
mode:
authorPauli Nieminen <suokkos@gmail.com>2009-08-11 23:43:35 +0300
committerPauli Nieminen <suokkos@gmail.com>2009-08-21 19:12:29 +0300
commitfb1d0bfd47fb8790e0b350a0fad7bc0af39e70f4 (patch)
treec30d9e7c9860338a1aca6fbddd57ceed2bb101b7 /src/mesa/drivers/dri/radeon/radeon_common.c
parent7f8f486b36dc42a3818546c704321320fcdbc94b (diff)
r200: Prevent flush in middle of rendering.
Patch adds prediction functionthat tries to predict emit size to the smallest possible values that is quarenteed to be higher than worst case scenario in rendering pipeline. State emit size prediction code is in place but fix for emit sizes is included in next patch. Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_common.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_common.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c
index b5b4fed8fa..20cf1f9a56 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common.c
+++ b/src/mesa/drivers/dri/radeon/radeon_common.c
@@ -946,6 +946,29 @@ static void radeon_print_state_atom_kmm(radeonContextPtr radeon, struct radeon_s
}
}
+/**
+ * Count total size for next state emit.
+ **/
+GLuint radeonCountEmitSize(radeonContextPtr radeon)
+{
+ struct radeon_state_atom *atom;
+ int dwords = 0;
+ /* check if we are going to emit full state */
+ if (radeon->cmdbuf.cs->cdw && !radeon->hw.all_dirty) {
+ if (!radeon->hw.is_dirty)
+ return dwords;
+ foreach(atom, &radeon->hw.atomlist) {
+ if (atom->dirty)
+ dwords += atom->check(radeon->glCtx, atom);
+ }
+ } else {
+ foreach(atom, &radeon->hw.atomlist) {
+ dwords += atom->check(radeon->glCtx, atom);
+ }
+ }
+ return dwords;
+}
+
static INLINE void radeonEmitAtoms(radeonContextPtr radeon, GLboolean dirty)
{
BATCH_LOCALS(radeon);