From 2fa2dd3908c783663ca421134cde82e9b6a38a0d Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Mon, 5 May 2008 13:15:01 +0800 Subject: i965: Don't cast the result of brw_prepare_vertices to an unsigned value. Negative value means other errors, not aperture overflow. fix bug #15752 --- src/mesa/drivers/dri/i965/brw_draw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/i965') diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 6124ab6b0f..5ccf4f4128 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -257,10 +257,12 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx, struct intel_context *intel = intel_context(ctx); struct brw_context *brw = brw_context(ctx); GLboolean retval = GL_FALSE; - GLuint i, ret; + GLuint i; GLuint ib_offset; dri_bo *ib_bo; GLboolean force_flush = GL_FALSE; + int ret; + if (ctx->NewState) _mesa_update_state( ctx ); -- cgit v1.2.3 From 17adf04e5c1da72a51815f3fdb9de2f3a8149c1a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 6 May 2008 18:52:47 +1000 Subject: i965: fix googleearth in classic mode. In classic mode googleearth triggered a case where vbos weren't getting accounted properly. --- src/mesa/drivers/dri/i965/brw_draw_upload.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri/i965') diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index aa985d68b6..2d99238ddc 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -404,6 +404,7 @@ int brw_prepare_vertices( struct brw_context *brw, */ copy_array_to_vbo_array(brw, upload[0], interleave); + ret |= dri_bufmgr_check_aperture_space(upload[0]->bo); for (i = 1; i < nr_uploads; i++) { /* Then, just point upload[i] at upload[0]'s buffer. */ upload[i]->stride = interleave; @@ -416,13 +417,13 @@ int brw_prepare_vertices( struct brw_context *brw, else { /* Upload non-interleaved arrays */ for (i = 0; i < nr_uploads; i++) { - copy_array_to_vbo_array(brw, upload[i], upload[i]->element_size); + copy_array_to_vbo_array(brw, upload[i], upload[i]->element_size); + if (upload[i]->bo) { + ret |= dri_bufmgr_check_aperture_space(upload[i]->bo); + } } } - if (brw->vb.upload.bo) { - ret |= dri_bufmgr_check_aperture_space(brw->vb.upload.bo); - } if (ret) return 1; -- cgit v1.2.3 From c6b36e5498cf6593daf001123cacec4ccaf305ca Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Tue, 20 May 2008 13:28:42 +0800 Subject: i965: Check fallback before accounting for index/vertex buffer size. fix #16028. --- src/mesa/drivers/dri/i965/brw_draw.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/mesa/drivers/dri/i965') diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 5ccf4f4128..f90c5f7b08 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -318,6 +318,14 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx, goto flush; } + /* Various fallback checks: + */ + if (brw->intel.Fallback) + goto out; + + if (check_fallbacks( brw, prim, nr_prims )) + goto out; + /* need to account for index buffer and vertex buffer */ if (ib) { ret = brw_prepare_indices( brw, ib , &ib_bo, &ib_offset); @@ -335,16 +343,6 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx, force_flush = GL_TRUE; goto flush; } - - - - /* Various fallback checks: - */ - if (brw->intel.Fallback) - goto out; - - if (check_fallbacks( brw, prim, nr_prims )) - goto out; /* Upload index, vertex data: */ -- cgit v1.2.3