llvmpipe: Don't store display the alpha ref value in the key.
It's never used.
This commit is contained in:
@@ -44,21 +44,20 @@
|
||||
|
||||
void
|
||||
lp_build_alpha_test(LLVMBuilderRef builder,
|
||||
const struct pipe_alpha_state *state,
|
||||
unsigned func,
|
||||
struct lp_type type,
|
||||
struct lp_build_mask_context *mask,
|
||||
LLVMValueRef alpha,
|
||||
LLVMValueRef ref)
|
||||
{
|
||||
struct lp_build_context bld;
|
||||
LLVMValueRef test;
|
||||
|
||||
lp_build_context_init(&bld, builder, type);
|
||||
|
||||
if(state->enabled) {
|
||||
LLVMValueRef test = lp_build_cmp(&bld, state->func, alpha, ref);
|
||||
test = lp_build_cmp(&bld, func, alpha, ref);
|
||||
|
||||
lp_build_name(test, "alpha_mask");
|
||||
lp_build_name(test, "alpha_mask");
|
||||
|
||||
lp_build_mask_update(mask, test);
|
||||
}
|
||||
lp_build_mask_update(mask, test);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ struct lp_build_mask_context;
|
||||
|
||||
void
|
||||
lp_build_alpha_test(LLVMBuilderRef builder,
|
||||
const struct pipe_alpha_state *state,
|
||||
unsigned func,
|
||||
struct lp_type type,
|
||||
struct lp_build_mask_context *mask,
|
||||
LLVMValueRef alpha,
|
||||
|
||||
@@ -332,14 +332,13 @@ generate_fs(struct llvmpipe_context *lp,
|
||||
lp_build_name(out, "color%u.%u.%c", i, attrib, "rgba"[chan]);
|
||||
|
||||
/* Alpha test */
|
||||
/* XXX: should the alpha reference value be passed separately? */
|
||||
/* XXX: should only test the final assignment to alpha */
|
||||
if(cbuf == 0 && chan == 3) {
|
||||
if (cbuf == 0 && chan == 3 && key->alpha.enabled) {
|
||||
LLVMValueRef alpha = out;
|
||||
LLVMValueRef alpha_ref_value;
|
||||
alpha_ref_value = lp_jit_context_alpha_ref_value(builder, context_ptr);
|
||||
alpha_ref_value = lp_build_broadcast(builder, vec_type, alpha_ref_value);
|
||||
lp_build_alpha_test(builder, &key->alpha, type,
|
||||
lp_build_alpha_test(builder, key->alpha.func, type,
|
||||
&mask, alpha, alpha_ref_value);
|
||||
}
|
||||
|
||||
@@ -750,7 +749,6 @@ dump_fs_variant_key(const struct lp_fragment_shader_variant_key *key)
|
||||
|
||||
if (key->alpha.enabled) {
|
||||
debug_printf("alpha.func = %s\n", util_dump_func(key->alpha.func, TRUE));
|
||||
debug_printf("alpha.ref_value = %f\n", key->alpha.ref_value);
|
||||
}
|
||||
|
||||
if (key->blend.logicop_enable) {
|
||||
|
||||
@@ -49,9 +49,13 @@ struct lp_fragment_shader_variant_key
|
||||
{
|
||||
struct pipe_depth_state depth;
|
||||
struct pipe_stencil_state stencil[2];
|
||||
struct pipe_alpha_state alpha;
|
||||
struct pipe_blend_state blend;
|
||||
|
||||
struct {
|
||||
unsigned enabled:1;
|
||||
unsigned func:3;
|
||||
} alpha;
|
||||
|
||||
unsigned nr_cbufs:8;
|
||||
unsigned nr_samplers:8; /* actually derivable from just the shader */
|
||||
unsigned flatshade:1;
|
||||
|
||||
Reference in New Issue
Block a user