iris: lower user clip planes
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 9 Nov 2018 09:08:36 +0000 (01:08 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:09 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_program.c

index 773d4e5ebb3268291e67347cd2a26e6609361965..10e0161f851cb5d30443b69fae7283f2298b1dee 100644 (file)
@@ -540,6 +540,14 @@ iris_compile_vs(struct iris_context *ice,
 
    nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
 
+   if (key->nr_userclip_plane_consts) {
+      nir_function_impl *impl = nir_shader_get_entrypoint(nir);
+      nir_lower_clip_vs(nir, (1 << key->nr_userclip_plane_consts) - 1, true);
+      nir_lower_io_to_temporaries(nir, impl, true, false);
+      nir_lower_global_vars_to_local(nir);
+      nir_lower_vars_to_ssa(nir);
+   }
+
    // XXX: alt mode
    assign_common_binding_table_offsets(devinfo, nir, prog_data, 0);