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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user