!st_point_size_per_vertex(st->ctx);
/* _NEW_TRANSFORM */
- if (st->lower_ucp && st_user_clip_planes_enabled(st->ctx))
+ if (st->lower_ucp && st_user_clip_planes_enabled(st->ctx) &&
+ !st->ctx->GeometryProgram._Current)
key.lower_ucp = st->ctx->Transform.ClipPlanesEnabled;
st->vp_variant = st_get_vp_variant(st, stvp, &key);
key.clip_negative_one_to_one =
st->ctx->Transform.ClipDepthMode == GL_NEGATIVE_ONE_TO_ONE;
+ if (st->lower_ucp && st_user_clip_planes_enabled(st->ctx) &&
+ pipe_shader == PIPE_SHADER_GEOMETRY)
+ key.lower_ucp = st->ctx->Transform.ClipPlanesEnabled;
}
return st_get_common_variant(st, stp, &key)->driver_shader;
}
if (st->lower_ucp)
- f->NewClipPlaneEnable = ST_NEW_VS_STATE;
+ f->NewClipPlaneEnable = ST_NEW_VS_STATE | ST_NEW_GS_STATE;
else
f->NewClipPlaneEnable = ST_NEW_RASTERIZER;
assert(!ctx->Extensions.OES_geometry_shader || !st->lower_point_size);
assert(!ctx->Extensions.ARB_tessellation_shader || !st->lower_point_size);
- /* FIXME: add support for geometry and tessellation shaders for
- * lower_ucp
- */
- assert(!ctx->Extensions.OES_geometry_shader || !st->lower_ucp);
+ /* FIXME: add support for tessellation shaders for lower_ucp */
assert(!ctx->Extensions.ARB_tessellation_shader || !st->lower_ucp);
if (st_have_perfmon(st)) {
st->shader_has_one_variant[MESA_SHADER_GEOMETRY] =
st->has_shareable_shaders &&
!st->clamp_frag_depth_in_shader &&
- !st->clamp_vert_color_in_shader;
+ !st->clamp_vert_color_in_shader &&
+ !st->lower_ucp;
st->shader_has_one_variant[MESA_SHADER_COMPUTE] = st->has_shareable_shaders;
st->bitmap.cache.empty = true;
_mesa_add_state_reference(params, clipplane_state[i]);
}
- NIR_PASS_V(nir, nir_lower_clip_vs, ucp_enables,
- true, can_compact, clipplane_state);
+ if (nir->info.stage == MESA_SHADER_VERTEX) {
+ NIR_PASS_V(nir, nir_lower_clip_vs, ucp_enables,
+ true, can_compact, clipplane_state);
+ } else if (nir->info.stage == MESA_SHADER_GEOMETRY) {
+ NIR_PASS_V(nir, nir_lower_clip_gs, ucp_enables,
+ can_compact, clipplane_state);
+ }
+
NIR_PASS_V(nir, nir_lower_io_to_temporaries,
nir_shader_get_entrypoint(nir), true, false);
NIR_PASS_V(nir, nir_lower_global_vars_to_local);
struct pipe_context *pipe = st->pipe;
struct st_variant *v;
struct pipe_shader_state state = {0};
+ struct gl_program_parameter_list *params = prog->Base.Parameters;
/* Search for existing variant */
for (v = prog->variants; v; v = v->next) {
finalize = true;
}
+ if (key->lower_ucp) {
+ lower_ucp(st, state.ir.nir, key->lower_ucp, params);
+ finalize = true;
+ }
+
state.stream_output = prog->state.stream_output;
if (finalize || !st->allow_st_finalize_nir_twice) {