summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZou Nan hai <[email protected]>2006-12-12 14:56:59 +0800
committerZou Nan hai <[email protected]>2006-12-13 13:29:20 -0800
commit4720cd00507f2c13becf318709f7c1fe24ba5146 (patch)
treeb5ca7ccf82090a7c1bf265a5909f5c3aa2471b42
parentc9795c6ca253b25b2b15967b064f32d9b822a1c8 (diff)
fix bug #99.
prim_count overflow when there is more than 1 cliprect (cherry picked from 84b958d66fe7d3fe03ed12b493e3f3197f656531 commit)
-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 470fa6f4177..8b243c60842 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