for (b = 0; b < nvc0->num_tfbbufs; ++b) {
struct nvc0_so_target *targ = nvc0_so_target(nvc0->tfbbuf[b]);
- struct nv04_resource *buf = nv04_resource(targ->pipe.buffer);
+ struct nv04_resource *buf;
+
+ if (!targ) {
+ IMMED_NVC0(push, NVC0_3D(TFB_BUFFER_ENABLE(b)), 0);
+ continue;
+ }
if (tfb)
targ->stride = tfb->stride[b];
if (!(nvc0->tfbbuf_dirty & (1 << b)))
continue;
+ buf = nv04_resource(targ->pipe.buffer);
+
if (!targ->clean)
nvc0_query_fifo_wait(push, targ->pq);
BEGIN_NVC0(push, NVC0_3D(TFB_BUFFER_ENABLE(b)), 5);
pipe_so_target_reference(&nvc0->tfbbuf[i], targets[i]);
}
for (; i < nvc0->num_tfbbufs; ++i) {
- nvc0->tfbbuf_dirty |= 1 << i;
- nvc0_so_target_save_offset(pipe, nvc0->tfbbuf[i], i, &serialize);
- pipe_so_target_reference(&nvc0->tfbbuf[i], NULL);
+ if (nvc0->tfbbuf[i]) {
+ nvc0->tfbbuf_dirty |= 1 << i;
+ nvc0_so_target_save_offset(pipe, nvc0->tfbbuf[i], i, &serialize);
+ pipe_so_target_reference(&nvc0->tfbbuf[i], NULL);
+ }
}
nvc0->num_tfbbufs = num_targets;