mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
nir: eliminate nir_metadata_preserve
Everybody uses the wrapper now. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33722>
This commit is contained in:
parent
24d088104f
commit
593308a685
2 changed files with 12 additions and 15 deletions
|
|
@ -3893,24 +3893,16 @@ nir_function_impl *nir_cf_node_get_function(nir_cf_node *node);
|
|||
|
||||
/** requests that the given pieces of metadata be generated */
|
||||
void nir_metadata_require(nir_function_impl *impl, nir_metadata required, ...);
|
||||
/** dirties all but the preserved metadata */
|
||||
void nir_metadata_preserve(nir_function_impl *impl, nir_metadata preserved);
|
||||
/** Preserves all metadata for the given shader */
|
||||
void nir_shader_preserve_all_metadata(nir_shader *shader);
|
||||
/** dirties all metadata and fills it with obviously wrong information */
|
||||
void nir_metadata_invalidate(nir_shader *shader);
|
||||
|
||||
static inline bool
|
||||
nir_progress(bool progress, nir_function_impl *impl, nir_metadata preserved)
|
||||
{
|
||||
if (progress) {
|
||||
nir_metadata_preserve(impl, preserved);
|
||||
} else {
|
||||
nir_metadata_preserve(impl, nir_metadata_all);
|
||||
}
|
||||
|
||||
return progress;
|
||||
}
|
||||
/**
|
||||
* Indicate progress on an implementation, preserving only the specified
|
||||
* metadata. The supplied progress is returned to improve ergonomics.
|
||||
*/
|
||||
bool nir_progress(bool progress, nir_function_impl *impl, nir_metadata preserved);
|
||||
|
||||
/** Indicate that there is no progress. All metadata is preserved. */
|
||||
static inline bool
|
||||
|
|
|
|||
|
|
@ -66,9 +66,13 @@ nir_metadata_require(nir_function_impl *impl, nir_metadata required, ...)
|
|||
impl->valid_metadata |= required;
|
||||
}
|
||||
|
||||
void
|
||||
nir_metadata_preserve(nir_function_impl *impl, nir_metadata preserved)
|
||||
bool
|
||||
nir_progress(bool progress, nir_function_impl *impl, nir_metadata preserved)
|
||||
{
|
||||
/* If we do not make progress, we preserve all metadata. */
|
||||
if (!progress)
|
||||
preserved = nir_metadata_all;
|
||||
|
||||
/* If we discard valid liveness information, immediately free the
|
||||
* liveness information for each block. For large shaders, it can
|
||||
* consume a huge amount of memory, and it's usually not immediately
|
||||
|
|
@ -83,6 +87,7 @@ nir_metadata_preserve(nir_function_impl *impl, nir_metadata preserved)
|
|||
}
|
||||
|
||||
impl->valid_metadata &= preserved;
|
||||
return progress;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue