nir/validate: Assert txf(_ms) matches dimension

We can't txf_ms on non-MS images and we can't txf on MS images. This would have
caught a regression on Asahi.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23892>
This commit is contained in:
Alyssa Rosenzweig 2023-06-27 14:01:58 -04:00 committed by Marge Bot
parent 5099137612
commit e81b5b972e

View file

@ -930,6 +930,14 @@ validate_tex_instr(nir_tex_instr *instr, validate_state *state)
}
}
bool msaa = (instr->sampler_dim == GLSL_SAMPLER_DIM_MS ||
instr->sampler_dim == GLSL_SAMPLER_DIM_SUBPASS_MS);
if (msaa)
validate_assert(state, instr->op != nir_texop_txf);
else
validate_assert(state, instr->op != nir_texop_txf_ms);
if (instr->op != nir_texop_tg4)
validate_assert(state, instr->component == 0);