LLVMBuilderRef builder = bld->gallivm->builder;
const unsigned stencilMax = 255; /* XXX fix */
struct lp_type type = bld->type;
- LLVMValueRef res;
/*
* SSE2 has intrinsics for signed comparisons, but not unsigned ones. Values
stencilVals = LLVMBuildAnd(builder, stencilVals, valuemask, "");
}
- res = lp_build_cmp(bld, stencil->func, stencilRef, stencilVals);
-
+ LLVMValueRef res = lp_build_cmp(bld, stencil->func,
+ stencilRef, stencilVals);
return res;
}
{
LLVMBuilderRef builder = bld->gallivm->builder;
struct lp_type type = bld->type;
- LLVMValueRef res;
LLVMValueRef max = lp_build_const_int_vec(bld->gallivm, type, 0xff);
- unsigned stencil_op;
assert(type.sign);
+ unsigned stencil_op;
switch (op) {
case S_FAIL_OP:
stencil_op = stencil->fail_op;
stencil_op = PIPE_STENCIL_OP_KEEP;
}
+ LLVMValueRef res;
switch (stencil_op) {
case PIPE_STENCIL_OP_KEEP:
res = stencilVals;
mask = LLVMBuildAnd(builder, mask, writemask, "");
/* res = (res & mask) | (stencilVals & ~mask) */
res = lp_build_select_bitwise(bld, mask, res, stencilVals);
- }
- else {
+ } else {
/* res = mask ? res : stencilVals */
res = lp_build_select(bld, mask, res, stencilVals);
}
count = lp_build_intrinsic_unary(builder, popcntintr,
LLVMInt32TypeInContext(context), bits);
count = LLVMBuildZExt(builder, count, LLVMIntTypeInContext(context, 64), "");
- }
- else {
+ } else {
LLVMValueRef countv = LLVMBuildAnd(builder, maskvalue, countmask, "countv");
LLVMTypeRef counttype = LLVMIntTypeInContext(context, type.length * 8);
LLVMTypeRef i8vntype = LLVMVectorType(LLVMInt8TypeInContext(context), type.length * 4);
for (unsigned i = 0; i < 4; i++) {
shuffles[i] = lp_build_const_int32(gallivm, i);
}
- }
- else {
+ } else {
unsigned i;
LLVMValueRef loopx2 = LLVMBuildShl(builder, loop_counter,
lp_build_const_int32(gallivm, 1), "");
LLVMValueRef zs_dst2;
if (is_1d) {
zs_dst2 = lp_build_undef(gallivm, zs_load_type);
- }
- else {
+ } else {
zs_dst_ptr = LLVMBuildGEP2(builder, int8_type, depth_ptr, &depth_offset2, 1, "");
zs_dst_ptr = LLVMBuildBitCast(builder, zs_dst_ptr, load_ptr_type, "");
zs_dst2 = LLVMBuildLoad2(builder, zs_dst_type, zs_dst_ptr, "");
depth_offset1 = LLVMBuildMul(builder, looplsb,
lp_build_const_int32(gallivm, depth_bytes * 2), "");
depth_offset1 = LLVMBuildAdd(builder, depth_offset1, offset2, "");
- }
- else {
+ } else {
LLVMValueRef loopx2 = LLVMBuildShl(builder, loop_counter,
lp_build_const_int32(gallivm, 1), "");
assert(z_src_type.length == 8);
if (z_src_type.length == 4) {
zs_dst1 = lp_build_extract_range(gallivm, z_value, 0, 2);
zs_dst2 = lp_build_extract_range(gallivm, z_value, 2, 2);
- }
- else {
+ } else {
assert(z_src_type.length == 8);
zs_dst1 = LLVMBuildShuffleVector(builder, z_value, z_value,
LLVMConstVector(&shuffles[0],
LLVMConstVector(&shuffles[4],
zs_load_type.length), "");
}
- }
- else {
+ } else {
if (z_src_type.length == 4) {
zs_dst1 = lp_build_interleave2(gallivm, z_type,
z_value, s_value, 0);
zs_dst2 = lp_build_interleave2(gallivm, z_type,
z_value, s_value, 1);
- }
- else {
+ } else {
LLVMValueRef shuffles[LP_MAX_VECTOR_LENGTH / 2];
assert(z_src_type.length == 8);
for (unsigned i = 0; i < 8; i++) {
z_src_type.sign = FALSE;
z_src_type.norm = TRUE;
}
- }
- else {
+ } else {
assert(!z_src_type.sign);
assert(z_src_type.norm);
}
assert(format_desc->channel[z_swizzle].type ==
UTIL_FORMAT_TYPE_FLOAT);
assert(format_desc->channel[z_swizzle].size == 32);
- }
- else {
+ } else {
assert(format_desc->channel[z_swizzle].type ==
UTIL_FORMAT_TYPE_UNSIGNED);
assert(format_desc->channel[z_swizzle].normalized);
stencil_refs, stencil_vals,
z_pass_mask, front_facing);
}
- }
- else {
+ } else {
/* No depth test: apply Z-pass operator to stencil buffer values which
* passed the stencil test.
*/
else
*z_value = stencil_vals;
*s_value = *z_value;
- }
- else {
+ } else {
*z_value = z_dst;
*s_value = stencil_vals;
}