i965: always call dri_emit_reloc when creating clip unit state
authorXiang, Haihao <haihao.xiang@intel.com>
Thu, 17 Jan 2008 03:05:24 +0000 (11:05 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Thu, 17 Jan 2008 03:08:56 +0000 (11:08 +0800)
This fix ensures it gets the starting location of the clip program
if a clip unit state is same as a unit which is created when metaops
is actived and it doesn't impact metaops because the clip state offset
isn't emitted when metaops is actived.

src/mesa/drivers/dri/i965/brw_clip_state.c

index e6e9fceb14da810cfeae880f210ce319ad7bf665..4694ccde9aed8910843e13e843137daaf62d8e98 100644 (file)
@@ -113,14 +113,13 @@ clip_unit_create_from_key(struct brw_context *brw,
                         &clip, sizeof(clip),
                         NULL, NULL);
 
-   if (!brw->metaops.active) {
-      /* Emit clip program relocation */
-      dri_emit_reloc(bo,
-                    DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
-                    clip.thread0.grf_reg_count << 1,
-                    offsetof(struct brw_clip_unit_state, thread0),
-                    brw->clip.prog_bo);
-   }
+   /* Emit clip program relocation */
+   assert(brw->clip.prog_bo);
+   dri_emit_reloc(bo,
+                        DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
+                        clip.thread0.grf_reg_count << 1,
+                        offsetof(struct brw_clip_unit_state, thread0),
+                        brw->clip.prog_bo);
 
    return bo;
 }