From 28cc2ed79c1ba7f994a3459de5d11102403e8187 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 19 Mar 2020 14:10:31 +1000 Subject: [PATCH] gallivm: add mask api to force mask For per-sample shading the mask needs to be forced for each iteration of the fragment shader. Just adds the API for now. Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_flow.c | 10 ++++++++++ src/gallium/auxiliary/gallivm/lp_bld_flow.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_flow.c b/src/gallium/auxiliary/gallivm/lp_bld_flow.c index 3bd24b4ba87..d5d903f66f2 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_flow.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_flow.c @@ -200,6 +200,16 @@ lp_build_mask_update(struct lp_build_mask_context *mask, LLVMBuildStore(mask->skip.gallivm->builder, value, mask->var); } +/* + * Update boolean mask with given value. + * Used for per-sample shading to force per-sample execution masks. + */ +void +lp_build_mask_force(struct lp_build_mask_context *mask, + LLVMValueRef value) +{ + LLVMBuildStore(mask->skip.gallivm->builder, value, mask->var); +} /** * End section of code which is predicated on a mask. diff --git a/src/gallium/auxiliary/gallivm/lp_bld_flow.h b/src/gallium/auxiliary/gallivm/lp_bld_flow.h index ddb3fdfd7b7..c4ffa833e2a 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_flow.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_flow.h @@ -94,6 +94,10 @@ void lp_build_mask_update(struct lp_build_mask_context *mask, LLVMValueRef value); +void +lp_build_mask_force(struct lp_build_mask_context *mask, + LLVMValueRef value); + void lp_build_mask_check(struct lp_build_mask_context *mask); -- 2.30.2