nir: Work around MSVC x86 internal compiler error
authorJesse Natalie <jenatali@microsoft.com>
Tue, 19 Jan 2021 19:23:39 +0000 (11:23 -0800)
committerMarge Bot <eric+marge@anholt.net>
Wed, 20 Jan 2021 20:42:48 +0000 (20:42 +0000)
Fixes: 1fd8b466 ("nir,spirv: add sparse image loads")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4108
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8581>

src/compiler/nir/nir_lower_input_attachments.c

index f18aac0..2380b0c 100644 (file)
@@ -151,8 +151,9 @@ try_lower_input_load(nir_function_impl *impl, nir_intrinsic_instr *load,
 
    if (tex->is_sparse) {
       unsigned load_result_size = load->dest.ssa.num_components - 1;
+      unsigned load_result_mask = BITFIELD_MASK(load_result_size);
       nir_ssa_def *res = nir_channels(
-         &b, &tex->dest.ssa, BITFIELD_MASK(load_result_size) | 0x10);
+         &b, &tex->dest.ssa, load_result_mask | 0x10);
 
       nir_ssa_def_rewrite_uses(&load->dest.ssa, nir_src_for_ssa(res));
    } else {