#include "pipe/p_state.h"
-#include "lp_bld_type.h"
-#include "lp_bld_const.h"
-#include "lp_bld_arit.h"
-#include "lp_bld_logic.h"
-#include "lp_bld_flow.h"
-#include "lp_bld_debug.h"
+#include "gallivm/lp_bld_type.h"
+#include "gallivm/lp_bld_const.h"
+#include "gallivm/lp_bld_logic.h"
+#include "gallivm/lp_bld_flow.h"
+#include "gallivm/lp_bld_debug.h"
+
#include "lp_bld_alpha.h"
void
lp_build_alpha_test(LLVMBuilderRef builder,
- const struct pipe_alpha_state *state,
- union lp_type type,
+ unsigned func,
+ struct lp_type type,
struct lp_build_mask_context *mask,
- LLVMValueRef alpha)
+ LLVMValueRef alpha,
+ LLVMValueRef ref,
+ boolean do_branch)
{
struct lp_build_context bld;
+ LLVMValueRef test;
lp_build_context_init(&bld, builder, type);
- if(state->enabled) {
- LLVMValueRef ref = lp_build_const_uni(type, state->ref_value);
- 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);
- }
+ if (do_branch)
+ lp_build_mask_check(mask);
}