nir_shader *
brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir)
{
+ const struct gen_device_info *devinfo = compiler->devinfo;
bool progress; /* Written by OPT and OPT_V */
(void)progress;
if (nir->stage == MESA_SHADER_GEOMETRY)
OPT(nir_lower_gs_intrinsics);
- if (compiler->precise_trig)
+ /* See also brw_nir_trig_workarounds.py */
+ if (compiler->precise_trig &&
+ !(devinfo->gen >= 10 || devinfo->is_kabylake))
OPT(brw_nir_apply_trig_workarounds);
static const nir_lower_tex_options tex_options = {
import nir_algebraic
-# The SIN and COS instructions on Intel hardware can produce values
-# slightly outside of the [-1.0, 1.0] range for a small set of values.
-# Obviously, this can break everyone's expectations about trig functions.
+# Prior to Kaby Lake, The SIN and COS instructions on Intel hardware can
+# produce values slightly outside of the [-1.0, 1.0] range for a small set of
+# values. Obviously, this can break everyone's expectations about trig
+# functions. This appears to be fixed in Kaby Lake.
#
# According to an internal presentation, the COS instruction can produce
# a value up to 1.000027 for inputs in the range (0.08296, 0.09888). One