OSDN Git Service

i965: Align gen6 push constant size to dispatch width.
authorEric Anholt <eric@anholt.net>
Sat, 4 Dec 2010 00:50:19 +0000 (16:50 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 6 Dec 2010 08:14:23 +0000 (00:14 -0800)
The FS backend is fine with register level granularity.  But for the
brw_wm_emit.c backend, it expects pairs of regs to be used for the
constants, because the whole world is pairs of regs.  If an odd number
got used, we went looking for interpolation in the wrong place.

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

index 0d839de..8968cae 100644 (file)
@@ -105,7 +105,8 @@ upload_wm_state(struct brw_context *brw)
                (5 - 2));
       OUT_RELOC(brw->wm.push_const_bo,
                I915_GEM_DOMAIN_RENDER, 0, /* XXX: bad domain */
-               ALIGN(brw->wm.prog_data->nr_params, 8) / 8 - 1);
+               ALIGN(brw->wm.prog_data->nr_params,
+                     brw->wm.prog_data->dispatch_width) / 8 - 1);
       OUT_BATCH(0);
       OUT_BATCH(0);
       OUT_BATCH(0);