@@ -446,7 +446,7 @@ lp_build_occlusion_count(LLVMBuilderRef builder, | |||
* \param stencil_refs the front/back stencil ref values (scalar) | |||
* \param z_src the incoming depth/stencil values (a 2x2 quad, float32) | |||
* \param zs_dst_ptr pointer to depth/stencil values in framebuffer | |||
* \param facing contains float value indicating front/back facing polygon | |||
* \param facing contains boolean value indicating front/back facing polygon | |||
*/ | |||
void | |||
lp_build_depth_stencil_test(LLVMBuilderRef builder, | |||
@@ -576,10 +576,10 @@ lp_build_depth_stencil_test(LLVMBuilderRef builder, | |||
if (stencil[0].enabled) { | |||
if (face) { | |||
LLVMValueRef zero = LLVMConstReal(LLVMFloatType(), 0.0); | |||
LLVMValueRef zero = LLVMConstInt(LLVMInt32Type(), 0, 0); | |||
/* front_facing = face > 0.0 ? ~0 : 0 */ | |||
front_facing = LLVMBuildFCmp(builder, LLVMRealUGT, face, zero, ""); | |||
/* front_facing = face != 0 ? ~0 : 0 */ | |||
front_facing = LLVMBuildICmp(builder, LLVMIntNE, face, zero, ""); | |||
front_facing = LLVMBuildSExt(builder, front_facing, | |||
LLVMIntType(s_bld.type.length*s_bld.type.width), | |||
""); |
@@ -144,7 +144,7 @@ typedef void | |||
(*lp_jit_frag_func)(const struct lp_jit_context *context, | |||
uint32_t x, | |||
uint32_t y, | |||
float facing, | |||
uint32_t facing, | |||
const void *a0, | |||
const void *dadx, | |||
const void *dady, |
@@ -365,7 +365,7 @@ lp_rast_shade_tile(struct lp_rasterizer_task *task, | |||
BEGIN_JIT_CALL(state); | |||
variant->jit_function[RAST_WHOLE]( &state->jit_context, | |||
tile_x + x, tile_y + y, | |||
inputs->facing, | |||
inputs->frontfacing, | |||
inputs->a0, | |||
inputs->dadx, | |||
inputs->dady, | |||
@@ -446,7 +446,7 @@ lp_rast_shade_quads_mask(struct lp_rasterizer_task *task, | |||
BEGIN_JIT_CALL(state); | |||
variant->jit_function[RAST_EDGE_TEST](&state->jit_context, | |||
x, y, | |||
inputs->facing, | |||
inputs->frontfacing, | |||
inputs->a0, | |||
inputs->dadx, | |||
inputs->dady, |
@@ -78,7 +78,7 @@ struct lp_rast_state { | |||
* These pointers point into the bin data buffer. | |||
*/ | |||
struct lp_rast_shader_inputs { | |||
float facing; /** Positive for front-facing, negative for back-facing */ | |||
unsigned frontfacing; /** One for front-facing */ | |||
unsigned disable:1; /** Partially binned, disable this command */ | |||
unsigned opaque:1; /** Is opaque */ | |||
@@ -261,7 +261,7 @@ lp_rast_shade_quads_all( struct lp_rasterizer_task *task, | |||
BEGIN_JIT_CALL(state); | |||
variant->jit_function[RAST_WHOLE]( &state->jit_context, | |||
x, y, | |||
inputs->facing, | |||
inputs->frontfacing, | |||
inputs->a0, | |||
inputs->dadx, | |||
inputs->dady, |
@@ -596,7 +596,7 @@ try_setup_line( struct lp_setup_context *setup, | |||
*/ | |||
setup_line_coefficients( setup, line, &info); | |||
line->inputs.facing = 1.0F; | |||
line->inputs.frontfacing = TRUE; | |||
line->inputs.disable = FALSE; | |||
line->inputs.opaque = FALSE; | |||
@@ -373,7 +373,7 @@ try_setup_point( struct lp_setup_context *setup, | |||
*/ | |||
setup_point_coefficients(setup, point, &info); | |||
point->inputs.facing = 1.0F; | |||
point->inputs.frontfacing = TRUE; | |||
point->inputs.disable = FALSE; | |||
point->inputs.opaque = FALSE; | |||
@@ -319,7 +319,7 @@ do_triangle_ccw(struct lp_setup_context *setup, | |||
*/ | |||
lp_setup_tri_coef( setup, &tri->inputs, v0, v1, v2, frontfacing ); | |||
tri->inputs.facing = frontfacing ? 1.0F : -1.0F; | |||
tri->inputs.frontfacing = frontfacing; | |||
tri->inputs.disable = FALSE; | |||
tri->inputs.opaque = setup->fs.current.variant->opaque; | |||
@@ -579,7 +579,7 @@ generate_fragment(struct llvmpipe_context *lp, | |||
arg_types[0] = screen->context_ptr_type; /* context */ | |||
arg_types[1] = LLVMInt32Type(); /* x */ | |||
arg_types[2] = LLVMInt32Type(); /* y */ | |||
arg_types[3] = LLVMFloatType(); /* facing */ | |||
arg_types[3] = LLVMInt32Type(); /* facing */ | |||
arg_types[4] = LLVMPointerType(fs_elem_type, 0); /* a0 */ | |||
arg_types[5] = LLVMPointerType(fs_elem_type, 0); /* dadx */ | |||
arg_types[6] = LLVMPointerType(fs_elem_type, 0); /* dady */ |