diff options
author | Timothy Arceri <[email protected]> | 2019-06-28 22:25:57 +1000 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-08-01 16:12:37 -0700 |
commit | 2afedfaf9aa161f8e8acbd1e8048a540db5fcfc8 (patch) | |
tree | cc4718ac28d97ab70241e1d1221015d524e4e8bb /src/gallium/drivers/iris/iris_program.c | |
parent | 00b5bf2d729f6c23525c4496552036c71d05479e (diff) |
iris: add support for gl_ClipVertex in tess eval shaders
Required for OpenGL compat support.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/gallium/drivers/iris/iris_program.c')
-rw-r--r-- | src/gallium/drivers/iris/iris_program.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index 1453390b02d..d5986f4809c 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -1246,6 +1246,15 @@ iris_compile_tes(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); + nir_shader_gather_info(nir, impl); + } + iris_setup_uniforms(compiler, mem_ctx, nir, prog_data, &system_values, &num_system_values, &num_cbufs); @@ -1307,7 +1316,7 @@ iris_update_compiled_tes(struct iris_context *ice) struct brw_tes_prog_key key = { KEY_INIT(devinfo->gen) }; get_unified_tess_slots(ice, &key.inputs_read, &key.patch_inputs_read); - ice->vtbl.populate_tes_key(ice, &key); + ice->vtbl.populate_tes_key(ice, &ish->nir->info, last_vue_stage(ice), &key); struct iris_compiled_shader *old = ice->shaders.prog[IRIS_CACHE_TES]; struct iris_compiled_shader *shader = @@ -2011,6 +2020,10 @@ iris_create_tes_state(struct pipe_context *ctx, struct iris_uncompiled_shader *ish = iris_create_shader_state(ctx, state); struct shader_info *info = &ish->nir->info; + /* User clip planes */ + if (ish->nir->info.clip_distance_array_size == 0) + ish->nos |= (1ull << IRIS_NOS_RASTERIZER); + if (screen->precompile) { const struct gen_device_info *devinfo = &screen->devinfo; struct brw_tes_prog_key key = { |