gallivm/nir: add sample_mask_in support
authorDave Airlie <airlied@redhat.com>
Thu, 26 Mar 2020 02:32:24 +0000 (12:32 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 19 May 2020 00:26:46 +0000 (10:26 +1000)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5050>

src/gallium/auxiliary/gallivm/lp_bld_nir.c
src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c
src/gallium/auxiliary/gallivm/lp_bld_tgsi.h

index d31d0408374065c426810b152030e42bb64d58ca..93234ac37b2d701160dfc1632324f8efed594db2 100644 (file)
@@ -1386,6 +1386,7 @@ static void visit_intrinsic(struct lp_build_nir_context *bld_base,
    case nir_intrinsic_load_patch_vertices_in:
    case nir_intrinsic_load_sample_id:
    case nir_intrinsic_load_sample_pos:
+   case nir_intrinsic_load_sample_mask_in:
       bld_base->sysval_intrin(bld_base, instr, result);
       break;
    case nir_intrinsic_load_helper_invocation:
index d3f34be86031859cf3820257f212fc5fec5dd7af..09ba52935461434e0fcca6daca4ceee28142b5b2 100644 (file)
@@ -1386,6 +1386,9 @@ static void emit_sysval_intrin(struct lp_build_nir_context *bld_base,
          result[i] = lp_build_broadcast_scalar(&bld_base->base, val);
       }
       break;
+   case nir_intrinsic_load_sample_mask_in:
+      result[0] = bld->system_values.sample_mask_in;
+      break;
    }
 }
 
index b1b619e34d219353c92ce711d611e2884737c773..de5cd4187ddb7acdbaa10aca547a0ab447af524f 100644 (file)
@@ -185,6 +185,7 @@ struct lp_bld_tgsi_system_values {
    LLVMValueRef vertices_in;
    LLVMValueRef sample_id;
    LLVMValueRef sample_pos;
+   LLVMValueRef sample_mask_in;
 };