diff options
author | Erik Faye-Lund <[email protected]> | 2019-10-02 16:19:08 -0400 |
---|---|---|
committer | Erik Faye-Lund <[email protected]> | 2019-10-17 10:41:36 +0200 |
commit | eb3047c094abfa03e071453d7c373e9c2c574370 (patch) | |
tree | 2be3fea726a40dc3334160ce8b72e83eb66439f0 /src/gallium/drivers | |
parent | 28543f1640d459404413c244740291fe68a75a5c (diff) |
nir: support lowering clipdist to arrays
This allows us to make sure clipdist is emitted as a scalar array rather
than two vec4s. This matches SPIR-V semantics, and will be useful for
Zink.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/iris/iris_program.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/vc4/vc4_program.c | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index fbf6d685382..fc4f2d2949d 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -938,7 +938,8 @@ iris_compile_vs(struct iris_context *ice, 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_clip_vs(nir, (1 << key->nr_userclip_plane_consts) - 1, true, + false); nir_lower_io_to_temporaries(nir, impl, true, false); nir_lower_global_vars_to_local(nir); nir_lower_vars_to_ssa(nir); @@ -1281,7 +1282,8 @@ iris_compile_tes(struct iris_context *ice, 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_clip_vs(nir, (1 << key->nr_userclip_plane_consts) - 1, true, + false); nir_lower_io_to_temporaries(nir, impl, true, false); nir_lower_global_vars_to_local(nir); nir_lower_vars_to_ssa(nir); @@ -1401,7 +1403,7 @@ iris_compile_gs(struct iris_context *ice, if (key->nr_userclip_plane_consts) { nir_function_impl *impl = nir_shader_get_entrypoint(nir); - nir_lower_clip_gs(nir, (1 << key->nr_userclip_plane_consts) - 1); + nir_lower_clip_gs(nir, (1 << key->nr_userclip_plane_consts) - 1, false); nir_lower_io_to_temporaries(nir, impl, true, false); nir_lower_global_vars_to_local(nir); nir_lower_vars_to_ssa(nir); diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 08487bea3a6..4568100c104 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -2313,10 +2313,11 @@ vc4_shader_ntq(struct vc4_context *vc4, enum qstage stage, if (c->key->ucp_enables) { if (stage == QSTAGE_FRAG) { - NIR_PASS_V(c->s, nir_lower_clip_fs, c->key->ucp_enables); + NIR_PASS_V(c->s, nir_lower_clip_fs, + c->key->ucp_enables, false); } else { NIR_PASS_V(c->s, nir_lower_clip_vs, - c->key->ucp_enables, false); + c->key->ucp_enables, false, false); NIR_PASS_V(c->s, nir_lower_io_to_scalar, nir_var_shader_out); } |