mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
pco, pvr: account for early frag testing
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
This commit is contained in:
parent
3c6ed32d3c
commit
380bf224dc
4 changed files with 10 additions and 2 deletions
|
|
@ -87,6 +87,7 @@ typedef struct _pco_fs_data {
|
|||
bool fbfetch; /** Whether the shader fetches from the framebuffer. */
|
||||
bool depth_feedback;
|
||||
bool discard;
|
||||
bool early_frag;
|
||||
} uses;
|
||||
} pco_fs_data;
|
||||
|
||||
|
|
|
|||
|
|
@ -237,6 +237,7 @@ static void gather_fs_data(nir_shader *nir, pco_data *data)
|
|||
}
|
||||
|
||||
data->fs.uses.fbfetch = nir->info.fs.uses_fbfetch_output;
|
||||
data->fs.uses.early_frag = nir->info.fs.early_fragment_tests;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1317,7 +1317,13 @@ static pco_instr *trans_intr(trans_ctx *tctx, nir_intrinsic_instr *intr)
|
|||
break;
|
||||
|
||||
case nir_intrinsic_depthf_pco:
|
||||
instr = pco_depthf(&tctx->b, pco_ref_drc(PCO_DRC_0), src[0]);
|
||||
assert(tctx->stage == MESA_SHADER_FRAGMENT);
|
||||
if (tctx->shader->data.fs.uses.depth_feedback &&
|
||||
!tctx->shader->data.fs.uses.early_frag) {
|
||||
instr = pco_depthf(&tctx->b, pco_ref_drc(PCO_DRC_0), src[0]);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
case nir_intrinsic_terminate:
|
||||
|
|
|
|||
|
|
@ -1232,7 +1232,7 @@ static void pvr_fragment_state_save(struct pvr_graphics_pipeline *gfx_pipeline,
|
|||
|
||||
/* TODO: add selection for other values of pass type and sample rate. */
|
||||
|
||||
if (shader_data->fs.uses.depth_feedback)
|
||||
if (shader_data->fs.uses.depth_feedback && !shader_data->fs.uses.early_frag)
|
||||
fragment_state->pass_type = ROGUE_TA_PASSTYPE_DEPTH_FEEDBACK;
|
||||
else if (shader_data->fs.uses.discard)
|
||||
fragment_state->pass_type = ROGUE_TA_PASSTYPE_PUNCH_THROUGH;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue