i965/nir: enable lowering of texture gradient for shadow samplers
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 13 Dec 2016 09:24:19 +0000 (10:24 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Tue, 13 Dec 2016 09:33:14 +0000 (10:33 +0100)
This gets the lowering on the Vulkan driver too, which is required for
hardware that does not have the sample_l_d message (up to IvyBridge).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_nir.c

index f6bcd452656caa835345055f91bb8273ad71c134..55b16cf851b059fc7bcb63edbbaf8042fee01ff7 100644 (file)
@@ -596,6 +596,9 @@ brw_nir_apply_sampler_key(nir_shader *nir,
          tex_options.swizzles[s][c] = GET_SWZ(key_tex->swizzles[s], c);
    }
 
+   /* Prior to Haswell, we have to lower gradients on shadow samplers */
+   tex_options.lower_txd_shadow = devinfo->gen < 8 && !devinfo->is_haswell;
+
    tex_options.lower_y_uv_external = key_tex->y_uv_image_mask;
    tex_options.lower_y_u_v_external = key_tex->y_u_v_image_mask;
    tex_options.lower_yx_xuxv_external = key_tex->yx_xuxv_image_mask;