#define lp_jit_context_alpha_ref_value(_builder, _ptr) \
lp_build_struct_get(_builder, _ptr, LP_JIT_CTX_ALPHA_REF, "alpha_ref_value")
-#define lp_jit_context_stencil_ref_value(_builder, _ptr) \
+#define lp_jit_context_stencil_ref_values(_builder, _ptr) \
lp_build_struct_get(_builder, _ptr, LP_JIT_CTX_STENCIL_REF, "stencil_ref")
#define lp_jit_context_scissor_xmin_value(_builder, _ptr) \
const struct lp_fragment_shader_variant_key *key,
struct lp_type src_type,
struct lp_build_mask_context *mask,
+ LLVMValueRef stencil_refs,
LLVMValueRef src,
LLVMValueRef dst_ptr)
{
dst_type,
format_desc,
mask,
+ stencil_refs,
src,
dst_ptr);
}
LLVMValueRef consts_ptr;
LLVMValueRef outputs[PIPE_MAX_SHADER_OUTPUTS][NUM_CHANNELS];
LLVMValueRef z = interp->pos[2];
+ LLVMValueRef stencil_refs;
struct lp_build_flow_context *flow;
struct lp_build_mask_context mask;
boolean early_depth_test;
assert(i < 4);
+ stencil_refs = lp_jit_context_stencil_ref_values(builder, context_ptr);
+
elem_type = lp_build_elem_type(type);
vec_type = lp_build_vec_type(type);
int_vec_type = lp_build_int_vec_type(type);
if(early_depth_test)
generate_depth(builder, key,
type, &mask,
- z, depth_ptr);
+ stencil_refs, z, depth_ptr);
lp_build_tgsi_soa(builder, tokens, type, &mask,
consts_ptr, interp->pos, interp->inputs,
if(!early_depth_test)
generate_depth(builder, key,
type, &mask,
- z, depth_ptr);
+ stencil_refs, z, depth_ptr);
lp_build_mask_end(&mask);
memset(key, 0, sizeof *key);
- if(lp->framebuffer.zsbuf &&
- lp->depth_stencil->depth.enabled) {
- key->zsbuf_format = lp->framebuffer.zsbuf->format;
- memcpy(&key->depth, &lp->depth_stencil->depth, sizeof key->depth);
+ if (lp->framebuffer.zsbuf) {
+ if (lp->depth_stencil->depth.enabled) {
+ key->zsbuf_format = lp->framebuffer.zsbuf->format;
+ memcpy(&key->depth, &lp->depth_stencil->depth, sizeof key->depth);
+ }
+ if (lp->depth_stencil->stencil[0].enabled) {
+ key->zsbuf_format = lp->framebuffer.zsbuf->format;
+ memcpy(&key->stencil, &lp->depth_stencil->stencil, sizeof key->stencil);
+ }
}
key->alpha.enabled = lp->depth_stencil->alpha.enabled;