#define NVC0_3D_LINE_WIDTH_SEPARATE 0x0000020c
-#define NVC0_3D_EARLY_FRAGMENT_TESTS 0x00000210
+#define NVC0_3D_FORCE_EARLY_FRAGMENT_TESTS 0x00000210
#define NVC0_3D_MEM_BARRIER 0x0000021c
#define NVC0_3D_MEM_BARRIER_UNK0 0x00000001
struct {
boolean flushed;
boolean rasterizer_discard;
- boolean early_z;
+ boolean early_z_forced;
boolean prim_restart;
uint32_t instance_elts; /* bitmask of per-instance elements */
uint32_t instance_base;
}
fp->fp.early_z = info->prop.fp.earlyFragTests;
- if (fp->fp.early_z == FALSE && fp->code_size >= 0x400)
- fp->fp.early_z = !(info->prop.fp.writesDepth ||
- info->prop.fp.usesDiscard ||
- (info->io.globalAccess & 2));
return 0;
}
return;
nvc0_program_update_context_state(nvc0, fp, 4);
+ if (fp->fp.early_z != nvc0->state.early_z_forced) {
+ nvc0->state.early_z_forced = fp->fp.early_z;
+ IMMED_NVC0(push, NVC0_3D(FORCE_EARLY_FRAGMENT_TESTS), fp->fp.early_z);
+ }
+
BEGIN_NVC0(push, NVC0_3D(SP_SELECT(5)), 2);
PUSH_DATA (push, 0x51);
PUSH_DATA (push, fp->code_base);
nvc0_validate_derived_1(struct nvc0_context *nvc0)
{
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
- boolean early_z;
boolean rasterizer_discard;
- early_z = nvc0->fragprog->fp.early_z && !nvc0->zsa->pipe.alpha.enabled;
-
- if (early_z != nvc0->state.early_z) {
- nvc0->state.early_z = early_z;
- IMMED_NVC0(push, NVC0_3D(EARLY_FRAGMENT_TESTS), early_z);
- }
-
rasterizer_discard = (!nvc0->fragprog || !nvc0->fragprog->hdr[18]) &&
!nvc0->zsa->pipe.depth.enabled && !nvc0->zsa->pipe.stencil[0].enabled;
rasterizer_discard = rasterizer_discard ||