From b39f15b88f4ef585f260db689294c12b1aee41f2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 28 Feb 2008 16:04:54 -0800 Subject: [PATCH] [965] Fix conditional sequencing to allow the frame_buffer_texobj case. Previously the frame_buffer_texobj case would have been bound as a normal texture, at best resulting in no surface data being associated with it. --- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 7bb8e4d1185..f2ae210c386 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -392,19 +392,17 @@ static void upload_wm_surfaces(struct brw_context *brw ) for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { struct gl_texture_unit *texUnit = &brw->attribs.Texture->Unit[i]; - /* _NEW_TEXTURE, BRW_NEW_TEXDATA - */ - if (texUnit->_ReallyEnabled) { - brw_update_texture_surface(ctx, i); - brw->wm.nr_surfaces = i+2; - } - else if( texUnit->_ReallyEnabled && - texUnit->_Current == intel->frame_buffer_texobj ) + /* _NEW_TEXTURE, BRW_NEW_TEXDATA */ + if(texUnit->_ReallyEnabled && + texUnit->_Current == intel->frame_buffer_texobj) { dri_bo_unreference(brw->wm.surf_bo[i+1]); brw->wm.surf_bo[i+1] = brw->wm.surf_bo[0]; dri_bo_reference(brw->wm.surf_bo[i+1]); brw->wm.nr_surfaces = i+2; + } else if (texUnit->_ReallyEnabled) { + brw_update_texture_surface(ctx, i); + brw->wm.nr_surfaces = i+2; } else { dri_bo_unreference(brw->wm.surf_bo[i+1]); brw->wm.surf_bo[i+1] = NULL; -- 2.30.2