X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fnouveau%2Fnvc0%2Fnvc0_shader_state.c;h=697bf491a01523bc9f84638aea95d2a1f95100a2;hb=91924453eedf3d4e0d57e0c2458db4560122b096;hp=0ae4bb1be343de01fab50ad9f2eadc87c47f7490;hpb=3df8615dcd67af4cbe1a65bcb15231320202f4e8;p=mesa.git diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c index 0ae4bb1be34..697bf491a01 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c @@ -60,7 +60,7 @@ nvc0_program_validate(struct nvc0_context *nvc0, struct nvc0_program *prog) } if (likely(prog->code_size)) - return nvc0_program_upload_code(nvc0, prog); + return nvc0_program_upload(nvc0, prog); return true; /* stream output info only */ } @@ -146,6 +146,11 @@ nvc0_fragprog_validate(struct nvc0_context *nvc0) nvc0->state.early_z_forced = fp->fp.early_z; IMMED_NVC0(push, NVC0_3D(FORCE_EARLY_FRAGMENT_TESTS), fp->fp.early_z); } + if (fp->fp.post_depth_coverage != nvc0->state.post_depth_coverage) { + nvc0->state.post_depth_coverage = fp->fp.post_depth_coverage; + IMMED_NVC0(push, NVC0_3D(POST_DEPTH_COVERAGE), + fp->fp.post_depth_coverage); + } BEGIN_NVC0(push, NVC0_3D(SP_SELECT(5)), 2); PUSH_DATA (push, 0x51); @@ -220,18 +225,13 @@ nvc0_gmtyprog_validate(struct nvc0_context *nvc0) /* we allow GPs with no code for specifying stream output state only */ if (gp && nvc0_program_validate(nvc0, gp) && gp->code_size) { - const bool gp_selects_layer = !!(gp->hdr[13] & (1 << 9)); - BEGIN_NVC0(push, NVC0_3D(MACRO_GP_SELECT), 1); PUSH_DATA (push, 0x41); BEGIN_NVC0(push, NVC0_3D(SP_START_ID(4)), 1); PUSH_DATA (push, gp->code_base); BEGIN_NVC0(push, NVC0_3D(SP_GPR_ALLOC(4)), 1); PUSH_DATA (push, gp->num_gprs); - BEGIN_NVC0(push, NVC0_3D(LAYER), 1); - PUSH_DATA (push, gp_selects_layer ? NVC0_3D_LAYER_USE_GP : 0); } else { - IMMED_NVC0(push, NVC0_3D(LAYER), 0); BEGIN_NVC0(push, NVC0_3D(MACRO_GP_SELECT), 1); PUSH_DATA (push, 0x40); } @@ -251,6 +251,27 @@ nvc0_compprog_validate(struct nvc0_context *nvc0) PUSH_DATA (push, NVC0_COMPUTE_FLUSH_CODE); } +void +nvc0_layer_validate(struct nvc0_context *nvc0) +{ + struct nouveau_pushbuf *push = nvc0->base.pushbuf; + struct nvc0_program *last; + bool prog_selects_layer = false; + + if (nvc0->gmtyprog) + last = nvc0->gmtyprog; + else if (nvc0->tevlprog) + last = nvc0->tevlprog; + else + last = nvc0->vertprog; + + if (last) + prog_selects_layer = !!(last->hdr[13] & (1 << 9)); + + BEGIN_NVC0(push, NVC0_3D(LAYER), 1); + PUSH_DATA (push, prog_selects_layer ? NVC0_3D_LAYER_USE_GP : 0); +} + void nvc0_tfb_validate(struct nvc0_context *nvc0) {