summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2007-02-16 19:17:15 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2007-02-16 19:17:15 +0000
commit137b35ce1cbbeaeee62d969d1de27c0edd62be10 (patch)
tree5496a5189dc6781f4ad6640e53da6fde02200514
parent54ef4398484f0c11b55d3fa66666b76ebd35ea73 (diff)
Fix a couple more clipping bugs.
-rw-r--r--src/mesa/tnl/t_draw.c2
-rw-r--r--src/mesa/tnl/t_vb_index.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c
index c97cf5f7b2..197fe32ea1 100644
--- a/src/mesa/tnl/t_draw.c
+++ b/src/mesa/tnl/t_draw.c
@@ -344,7 +344,7 @@ void _tnl_draw_prims( GLcontext *ctx,
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
const GLuint TEST_SPLIT = 0;
- const GLint max = TEST_SPLIT ? 8 : tnl->vb.Size - MAX_CLIPPED_VERTICES;
+ const GLint max = TEST_SPLIT ? 8 : (tnl->vb.Size - MAX_CLIPPED_VERTICES) * .8;
if (0)
{
diff --git a/src/mesa/tnl/t_vb_index.c b/src/mesa/tnl/t_vb_index.c
index 240b25fde0..444a81056d 100644
--- a/src/mesa/tnl/t_vb_index.c
+++ b/src/mesa/tnl/t_vb_index.c
@@ -167,7 +167,7 @@ static void check_flush( struct idx_context *idx,
assert(idx->nr_prims <= IDX_MAX_PRIM);
assert(idx->nr_indices <= idx->index_buffer_size);
- if (idx->hw_max_indexable_verts < idx->VB->Count + MAX_CLIPPED_VERTICES) {
+ if (idx->hw_max_indexable_verts <= idx->VB->Count + MAX_CLIPPED_VERTICES) {
flush( idx );
}
@@ -484,6 +484,9 @@ static GLboolean run_index_render( GLcontext *ctx,
&idx->hw_max_indices))
return GL_TRUE;
+ if (idx->hw_max_indexable_verts > VB->Size)
+ idx->hw_max_indexable_verts = VB->Size;
+
idx->orig_VB_count = VB->Count;
idx->nr_prims = 0;
idx->nr_indices = 0;