case nir_intrinsic_load_local_invocation_id:
case nir_intrinsic_load_num_work_groups:
case nir_intrinsic_load_invocation_id:
+ case nir_intrinsic_load_front_face:
bld_base->sysval_intrin(bld_base, instr, result);
break;
case nir_intrinsic_discard_if:
case nir_intrinsic_load_invocation_id:
result[0] = lp_build_broadcast_scalar(&bld_base->uint_bld, bld->system_values.invocation_id);
break;
+ case nir_intrinsic_load_front_face:
+ result[0] = lp_build_broadcast_scalar(&bld_base->uint_bld, bld->system_values.front_facing);
+ break;
default:
break;
}
LLVMValueRef thread_id;
LLVMValueRef block_id;
LLVMValueRef grid_size;
+ LLVMValueRef front_facing;
};
atype = TGSI_TYPE_UNSIGNED;
break;
+ case TGSI_SEMANTIC_FACE:
+ res = lp_build_broadcast_scalar(&bld_base->uint_bld, bld->system_values.front_facing);
+ break;
+
default:
assert(!"unexpected semantic in emit_fetch_system_value");
res = bld_base->base.zero;
case PIPE_CAP_MULTI_DRAW_INDIRECT:
case PIPE_CAP_MULTI_DRAW_INDIRECT_PARAMS:
case PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL:
- case PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL:
case PIPE_CAP_INVALIDATE_BUFFER:
case PIPE_CAP_GENERATE_MIPMAP:
case PIPE_CAP_STRING_MARKER:
return LP_MAX_TGSI_SHADER_BUFFER_SIZE;
case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
case PIPE_CAP_TGSI_TG4_COMPONENT_IN_SWIZZLE:
+ case PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL:
return 1;
case PIPE_CAP_LOAD_CONSTBUF:
case PIPE_CAP_PACKED_UNIFORMS:
memset(&system_values, 0, sizeof(system_values));
+ /* truncate then sign extend. */
+ system_values.front_facing = LLVMBuildTrunc(gallivm->builder, facing, LLVMInt1TypeInContext(gallivm->context), "");
+ system_values.front_facing = LLVMBuildSExt(gallivm->builder, system_values.front_facing, LLVMInt32TypeInContext(gallivm->context), "");
+
if (key->depth.enabled ||
key->stencil[0].enabled) {