mesa/st: Lower user clip planes for tess eval too

The logic in st_atom_shader.c leads me to believe this was supposed
to work, but was incomplete to actually finish it. This fixes
compatibility tess tests on d3d12.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14662>
This commit is contained in:
Jesse Natalie 2022-01-22 14:35:16 -08:00
parent c85df67f27
commit 0b6caed85c
3 changed files with 5 additions and 3 deletions

View file

@ -296,7 +296,8 @@ st_update_common_program(struct st_context *st, struct gl_program *prog,
VARYING_SLOT_BFC1));
if (st->lower_ucp && st_user_clip_planes_enabled(st->ctx) &&
pipe_shader == PIPE_SHADER_GEOMETRY)
(pipe_shader == PIPE_SHADER_GEOMETRY ||
!st->ctx->GeometryProgram._Current))
key.lower_ucp = st->ctx->Transform.ClipPlanesEnabled;
if (st->lower_point_size) {

View file

@ -439,7 +439,7 @@ st_init_driver_flags(struct st_context *st)
f->NewClipPlaneEnable = ST_NEW_RASTERIZER;
if (st->lower_ucp)
f->NewClipPlaneEnable |= ST_NEW_VS_STATE | ST_NEW_GS_STATE;
f->NewClipPlaneEnable |= ST_NEW_VS_STATE | ST_NEW_GS_STATE | ST_NEW_TES_STATE;
if (st->emulate_gl_clamp)
f->NewSamplersWithClamp = ST_NEW_SAMPLERS |

View file

@ -741,7 +741,8 @@ lower_ucp(struct st_context *st,
_mesa_add_state_reference(params, clipplane_state[i]);
}
if (nir->info.stage == MESA_SHADER_VERTEX) {
if (nir->info.stage == MESA_SHADER_VERTEX ||
nir->info.stage == MESA_SHADER_TESS_EVAL) {
NIR_PASS_V(nir, nir_lower_clip_vs, ucp_enables,
true, can_compact, clipplane_state);
} else if (nir->info.stage == MESA_SHADER_GEOMETRY) {