nir: add a pass to optimize "gl_FragDepth = gl_FragCoord.z" away
gl_FragDepth default value is gl_FragCoord.z so if a shader does: gl_FragDepth = gl_FragCoord.z we can drop this assignment. v2: use nir_ssa_scalar_resolved and don't do this is gl_FragDepth is wrote multiple times (Jason) v3: - move to its own pass (Jason) - handle var = NULL (Rhys) v4: refactoring (Jason) Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10697>
This commit is contained in:
@@ -223,6 +223,7 @@ files_libnir = files(
|
||||
'nir_opt_dead_cf.c',
|
||||
'nir_opt_dead_write_vars.c',
|
||||
'nir_opt_find_array_copies.c',
|
||||
'nir_opt_fragdepth.c',
|
||||
'nir_opt_gcm.c',
|
||||
'nir_opt_idiv_const.c',
|
||||
'nir_opt_if.c',
|
||||
|
Reference in New Issue
Block a user