mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
nir: fix NIR_DEBUG=extended_validation
This broke after divergence became metadata because the divergence analysis pass does not support all instructions. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Marek Olšák <maraeo@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069>
This commit is contained in:
parent
026e2527bf
commit
706ba80057
3 changed files with 18 additions and 6 deletions
|
|
@ -50,7 +50,7 @@ static const struct debug_named_value nir_debug_control[] = {
|
|||
{ "novalidate", NIR_DEBUG_NOVALIDATE,
|
||||
"Disable shader validation at each successful lowering/optimization call" },
|
||||
{ "extended_validation", NIR_DEBUG_EXTENDED_VALIDATION,
|
||||
"Validate even if a pass does not make progress and test that it properly preserves all types of metadata. This can be very slow" },
|
||||
"Validate even if a pass does not make progress and test that it properly preserves most types of metadata. This can be very slow" },
|
||||
{ "invalidate_metadata", NIR_DEBUG_INVALIDATE_METADATA,
|
||||
"Invalidate metadata before passes to try to find passes which don't require metadata that they use. This overrides NIR_DEBUG=extended_validation somewhat" },
|
||||
{ "tgsi", NIR_DEBUG_TGSI,
|
||||
|
|
|
|||
|
|
@ -4716,7 +4716,7 @@ void nir_validate_shader(nir_shader *shader, const char *when);
|
|||
void nir_validate_ssa_dominance(nir_shader *shader, const char *when);
|
||||
void nir_metadata_set_validation_flag(nir_shader *shader);
|
||||
void nir_metadata_check_validation_flag(nir_shader *shader);
|
||||
void nir_metadata_require_all(nir_shader *shader);
|
||||
void nir_metadata_require_most(nir_shader *shader);
|
||||
|
||||
static inline bool
|
||||
should_skip_nir(const char *name)
|
||||
|
|
@ -4769,7 +4769,7 @@ nir_metadata_check_validation_flag(nir_shader *shader)
|
|||
(void)shader;
|
||||
}
|
||||
static inline void
|
||||
nir_metadata_require_all(nir_shader *shader)
|
||||
nir_metadata_require_most(nir_shader *shader)
|
||||
{
|
||||
(void)shader;
|
||||
}
|
||||
|
|
@ -4794,7 +4794,7 @@ should_print_nir(UNUSED nir_shader *shader)
|
|||
if (NIR_DEBUG(INVALIDATE_METADATA)) \
|
||||
nir_metadata_invalidate(nir); \
|
||||
else if (NIR_DEBUG(EXTENDED_VALIDATION)) \
|
||||
nir_metadata_require_all(nir); \
|
||||
nir_metadata_require_most(nir); \
|
||||
do_pass if (NIR_DEBUG(CLONE)) \
|
||||
{ \
|
||||
nir_shader *_clone = nir_shader_clone(ralloc_parent(nir), nir);\
|
||||
|
|
|
|||
|
|
@ -180,12 +180,24 @@ nir_metadata_check_validation_flag(nir_shader *shader)
|
|||
}
|
||||
|
||||
void
|
||||
nir_metadata_require_all(nir_shader *shader)
|
||||
nir_metadata_require_most(nir_shader *shader)
|
||||
{
|
||||
bool force_unroll_sampler_indirect = shader->options->force_indirect_unrolling_sampler;
|
||||
nir_variable_mode indirect_mask = shader->options->force_indirect_unrolling;
|
||||
nir_foreach_function_impl(impl, shader) {
|
||||
nir_metadata_require(impl, nir_metadata_all, indirect_mask,
|
||||
nir_metadata md = nir_metadata_all;
|
||||
|
||||
/* We don't know if divergence analysis supports this shader. */
|
||||
md &= ~nir_metadata_divergence;
|
||||
|
||||
if (!impl->structured) {
|
||||
/* These don't support unstructured control flow. */
|
||||
md &= ~nir_metadata_instr_index;
|
||||
md &= ~nir_metadata_loop_analysis;
|
||||
md &= ~nir_metadata_live_defs;
|
||||
}
|
||||
|
||||
nir_metadata_require(impl, md, indirect_mask,
|
||||
(int)force_unroll_sampler_indirect);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue