From: Dave Airlie Date: Tue, 10 Mar 2020 03:06:30 +0000 (+1000) Subject: llvmpipe/jit: pass fragment sample mask via jit context. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c070af85114e37e4e1e28791528f336266c93261;p=mesa.git llvmpipe/jit: pass fragment sample mask via jit context. The incoming sample mask for the fragment shader can be passed via the jit context Reviewed-by: Roland Scheidegger Part-of: --- diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c index 4ec83480c05..3786c50e990 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.c +++ b/src/gallium/drivers/llvmpipe/lp_jit.c @@ -226,6 +226,7 @@ lp_jit_create_types(struct lp_fragment_shader_variant *lp) elem_types[LP_JIT_CTX_IMAGES] = LLVMArrayType(image_type, PIPE_MAX_SHADER_IMAGES); elem_types[LP_JIT_CTX_ALPHA_REF] = LLVMFloatTypeInContext(lc); + elem_types[LP_JIT_CTX_SAMPLE_MASK] = elem_types[LP_JIT_CTX_STENCIL_REF_FRONT] = elem_types[LP_JIT_CTX_STENCIL_REF_BACK] = LLVMInt32TypeInContext(lc); elem_types[LP_JIT_CTX_U8_BLEND_COLOR] = LLVMPointerType(LLVMInt8TypeInContext(lc), 0); @@ -277,6 +278,9 @@ lp_jit_create_types(struct lp_fragment_shader_variant *lp) LP_CHECK_MEMBER_OFFSET(struct lp_jit_context, num_ssbos, gallivm->target, context_type, LP_JIT_CTX_NUM_SSBOS); + LP_CHECK_MEMBER_OFFSET(struct lp_jit_context, sample_mask, + gallivm->target, context_type, + LP_JIT_CTX_SAMPLE_MASK); LP_CHECK_STRUCT_SIZE(struct lp_jit_context, gallivm->target, context_type); diff --git a/src/gallium/drivers/llvmpipe/lp_jit.h b/src/gallium/drivers/llvmpipe/lp_jit.h index d7960e21d30..fbf33116e1c 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.h +++ b/src/gallium/drivers/llvmpipe/lp_jit.h @@ -166,6 +166,8 @@ struct lp_jit_context const uint32_t *ssbos[LP_MAX_TGSI_SHADER_BUFFERS]; int num_ssbos[LP_MAX_TGSI_SHADER_BUFFERS]; + + uint32_t sample_mask; }; @@ -187,6 +189,7 @@ enum { LP_JIT_CTX_VIEWPORTS, LP_JIT_CTX_SSBOS, LP_JIT_CTX_NUM_SSBOS, + LP_JIT_CTX_SAMPLE_MASK, LP_JIT_CTX_COUNT }; @@ -230,6 +233,9 @@ enum { #define lp_jit_context_num_ssbos(_gallivm, _ptr) \ lp_build_struct_get_ptr(_gallivm, _ptr, LP_JIT_CTX_NUM_SSBOS, "num_ssbos") +#define lp_jit_context_sample_mask(_gallivm, _ptr) \ + lp_build_struct_get_ptr(_gallivm, _ptr, LP_JIT_CTX_SAMPLE_MASK, "sample_mask") + struct lp_jit_thread_data { struct lp_build_format_cache *cache;