OSDN Git Service

[965] Fix conditional sequencing to allow the frame_buffer_texobj case.
authorEric Anholt <eric@anholt.net>
Fri, 29 Feb 2008 00:04:54 +0000 (16:04 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 29 Feb 2008 00:04:54 +0000 (16:04 -0800)
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

index 7bb8e4d..f2ae210 100644 (file)
@@ -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;