* \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,
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),
"");
(*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,
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,
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,
* 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 */
BEGIN_JIT_CALL(state);
variant->jit_function[RAST_WHOLE]( &state->jit_context,
x, y,
- inputs->facing,
+ inputs->frontfacing,
inputs->a0,
inputs->dadx,
inputs->dady,
*/
setup_line_coefficients( setup, line, &info);
- line->inputs.facing = 1.0F;
+ line->inputs.frontfacing = TRUE;
line->inputs.disable = FALSE;
line->inputs.opaque = FALSE;
*/
setup_point_coefficients(setup, point, &info);
- point->inputs.facing = 1.0F;
+ point->inputs.frontfacing = TRUE;
point->inputs.disable = FALSE;
point->inputs.opaque = FALSE;
*/
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;
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 */