From a4c8508c375f929e330fe033426cb05f65b3d0d6 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Wed, 8 Dec 2021 10:50:41 +0100 Subject: [PATCH] microsoft/compiler: textureLoad() doesn't take a LOD on MS textures Make sure the LOD is zero in that case. Signed-off-by: Boris Brezillon Reviewed-by: Jesse Natalie Part-of: --- src/microsoft/compiler/nir_to_dxil.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index 9c1990e6930..e2f0e265470 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -4640,6 +4640,11 @@ emit_tex(struct ntd_context *ctx, nir_tex_instr *instr) case nir_tex_src_lod: assert(nir_src_num_components(instr->src[i].src) == 1); + if (instr->op == nir_texop_txf_ms) { + assert(nir_src_as_int(instr->src[i].src) == 0); + break; + } + /* Buffers don't have a LOD */ if (instr->sampler_dim != GLSL_SAMPLER_DIM_BUF) params.lod_or_sample = get_src(ctx, &instr->src[i].src, 0, type);