#include "nvc0_context.h"
+#if 0
static void
nvc0_validate_zcull(struct nvc0_context *nvc0)
{
BEGIN_NVC0(push, NVC0_3D(ZCULL_INVALIDATE), 1);
PUSH_DATA (push, 0);
}
+#endif
static void
nvc0_validate_fb(struct nvc0_context *nvc0)
if (serialize)
IMMED_NVC0(push, NVC0_3D(SERIALIZE), 0);
+
+ NOUVEAU_DRV_STAT(&nvc0->screen->base, gpu_serialize_count, serialize);
}
static void
nvc0_check_program_ucps(nvc0, vp, clip_enable);
if (nvc0->dirty & (NVC0_NEW_CLIP | (NVC0_NEW_VERTPROG << stage)))
- if (vp->vp.num_ucps <= PIPE_MAX_CLIP_PLANES)
+ if (vp->vp.num_ucps > 0 && vp->vp.num_ucps <= PIPE_MAX_CLIP_PLANES)
nvc0_upload_uclip_planes(nvc0, stage);
clip_enable &= vp->vp.clip_enable;
PUSH_DATA (push, 0x01);
}
+void
+nvc0_validate_global_residents(struct nvc0_context *nvc0,
+ struct nouveau_bufctx *bctx, int bin)
+{
+ unsigned i;
+
+ for (i = 0; i < nvc0->global_residents.size / sizeof(struct pipe_resource *);
+ ++i) {
+ struct pipe_resource *res = *util_dynarray_element(
+ &nvc0->global_residents, struct pipe_resource *, i);
+ if (res)
+ nvc0_add_resident(bctx, bin, nv04_resource(res), NOUVEAU_BO_RDWR);
+ }
+}
+
static void
nvc0_validate_derived_1(struct nvc0_context *nvc0)
{
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
boolean rasterizer_discard;
- rasterizer_discard = (!nvc0->fragprog || !nvc0->fragprog->hdr[18]) &&
- !nvc0->zsa->pipe.depth.enabled && !nvc0->zsa->pipe.stencil[0].enabled;
- rasterizer_discard = rasterizer_discard ||
- nvc0->rast->pipe.rasterizer_discard;
+ if (nvc0->rast && nvc0->rast->pipe.rasterizer_discard) {
+ rasterizer_discard = TRUE;
+ } else {
+ boolean zs = nvc0->zsa &&
+ (nvc0->zsa->pipe.depth.enabled || nvc0->zsa->pipe.stencil[0].enabled);
+ rasterizer_discard = !zs &&
+ (!nvc0->fragprog || !nvc0->fragprog->hdr[18]);
+ }
if (rasterizer_discard != nvc0->state.rasterizer_discard) {
nvc0->state.rasterizer_discard = rasterizer_discard;
{ nvc0_validate_samplers, NVC0_NEW_SAMPLERS },
{ nve4_set_tex_handles, NVC0_NEW_TEXTURES | NVC0_NEW_SAMPLERS },
{ nvc0_vertex_arrays_validate, NVC0_NEW_VERTEX | NVC0_NEW_ARRAYS },
+ { nvc0_validate_surfaces, NVC0_NEW_SURFACES },
{ nvc0_idxbuf_validate, NVC0_NEW_IDXBUF },
{ nvc0_tfb_validate, NVC0_NEW_TFB_TARGETS | NVC0_NEW_GMTYPROG }
};