summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZou Nan hai <nanhai.zou@intel.com>2006-12-12 15:00:27 +0800
committerKeith Packard <keithp@neko.keithp.com>2007-01-06 15:18:23 -0800
commit652ae2c3765a471f94ca7b7328a0d572182bb127 (patch)
tree5abef1c2b9f69728fb532a46cb967fdd9577acd9 /src
parent4068e2d1b766a9ccedcb8d7cd07c49d22dff39f0 (diff)
i965: Take clip rects into account when computing max prim
Signed-off-by: Keith Packard <keithp@neko.keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_exec_api.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_exec_api.c b/src/mesa/drivers/dri/i965/brw_exec_api.c
index 470fa6f417..8b243c6084 100644
--- a/src/mesa/drivers/dri/i965/brw_exec_api.c
+++ b/src/mesa/drivers/dri/i965/brw_exec_api.c
@@ -42,6 +42,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "dispatch.h"
#include "brw_exec.h"
+#include "intel_context.h"
+
static void reset_attrfv( struct brw_exec_context *exec );
@@ -522,6 +524,14 @@ static void GLAPIENTRY brw_exec_Begin( GLenum mode )
}
+static GLuint brw_max_prim( GLcontext *ctx )
+{
+ struct intel_context *intel = intel_context( ctx );
+ if (intel->numClipRects <= 1)
+ return BRW_MAX_PRIM;
+ return BRW_MAX_PRIM/intel->numClipRects;
+}
+
static void GLAPIENTRY brw_exec_End( void )
{
GET_CURRENT_CONTEXT( ctx );
@@ -536,7 +546,7 @@ static void GLAPIENTRY brw_exec_End( void )
ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1;
- if (exec->vtx.prim_count == BRW_MAX_PRIM)
+ if (exec->vtx.prim_count >= brw_max_prim(ctx))
brw_exec_vtx_flush( exec );
}
else