From: Alyssa Rosenzweig Date: Tue, 27 Jun 2023 18:01:58 +0000 (-0400) Subject: nir/validate: Assert txf(_ms) matches dimension X-Git-Tag: upstream/23.3.3~6314 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e81b5b972ec318241be99a2eb14859f9f7831249;p=platform%2Fupstream%2Fmesa.git 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 Reviewed-by: Emma Anholt Part-of: --- diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c index 1776bad..3ac014d 100644 --- a/src/compiler/nir/nir_validate.c +++ b/src/compiler/nir/nir_validate.c @@ -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);