case nir_intrinsic_load_tess_level_outer:
case nir_intrinsic_load_tess_level_inner:
case nir_intrinsic_load_patch_vertices_in:
+ case nir_intrinsic_load_sample_id:
+ case nir_intrinsic_load_sample_pos:
bld_base->sysval_intrin(bld_base, instr, result);
break;
case nir_intrinsic_load_helper_invocation:
case nir_intrinsic_load_patch_vertices_in:
result[0] = bld->system_values.vertices_in;
break;
+ case nir_intrinsic_load_sample_id:
+ result[0] = lp_build_broadcast_scalar(&bld_base->uint_bld, bld->system_values.sample_id);
+ break;
+ case nir_intrinsic_load_sample_pos:
+ for (unsigned i = 0; i < 2; i++) {
+ LLVMValueRef idx = LLVMBuildMul(gallivm->builder, bld->system_values.sample_id, lp_build_const_int32(gallivm, 2), "");
+ idx = LLVMBuildAdd(gallivm->builder, idx, lp_build_const_int32(gallivm, i), "");
+ LLVMValueRef val = LLVMBuildGEP(gallivm->builder, bld->system_values.sample_pos, &idx, 1, "");
+ result[i] = lp_build_broadcast_scalar(&bld_base->base, LLVMBuildLoad(gallivm->builder, val, ""));
+ }
+ break;
}
}