This fixes some warnings which appear because the driver assumes a wrong cs size (13 vs 16 register writes in some cases).

Mathias Gottschlag
>From 5c13ba2753ecd9d149acb980fe65ed085dbd9096 Mon Sep 17 00:00:00 2001
From: Mathias Gottschlag <[email protected]>
Date: Mon, 20 Apr 2009 22:06:31 +0200
Subject: [PATCH] r300-gallium: Fix CS size mismatch.

---
 src/gallium/drivers/r300/r300_emit.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index a3d8337..417d5f6 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -340,7 +340,11 @@ void r300_emit_vertex_shader(struct r300_context* r300,
         return;
     }
 
-    BEGIN_CS(13 + (vs->instruction_count * 4) + (constants->count * 4));
+    if (constants->count) {
+        BEGIN_CS(16 + (vs->instruction_count * 4) + (constants->count * 4));
+    } else {
+        BEGIN_CS(13 + (vs->instruction_count * 4) + (constants->count * 4));
+    }
 
     OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_0, R300_PVS_FIRST_INST(0) |
             R300_PVS_LAST_INST(vs->instruction_count - 1));
-- 
1.6.0.4

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to