mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 12:28:07 +02:00
nir: Add support for load_frag_coord_zw to nir_opt_fragdepth.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25190>
This commit is contained in:
parent
3b28604be2
commit
908bfb2ac9
1 changed files with 8 additions and 4 deletions
|
|
@ -40,11 +40,15 @@ nir_def_is_frag_coord_z(nir_def *def)
|
|||
return false;
|
||||
|
||||
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
|
||||
if (intrin->intrinsic != nir_intrinsic_load_frag_coord)
|
||||
switch (intrin->intrinsic) {
|
||||
case nir_intrinsic_load_frag_coord:
|
||||
/* Depth is gl_FragCoord.z */
|
||||
return scalar.comp == 2;
|
||||
case nir_intrinsic_load_frag_coord_z:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
||||
/* Depth is gl_FragCoord.z */
|
||||
return scalar.comp == 2;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue