{
/* User clip planes from curbe:
*/
- if (c->key.nr_userclip) {
+ if (c->key.nr_userclip && !c->key.uses_clip_distance) {
if (intel->gen >= 6) {
for (int i = 0; i < c->key.nr_userclip; i++) {
c->userplane[i] = stride(brw_vec4_grf(reg + i / 2,
*/
key.program_string_id = vp->id;
key.nr_userclip = brw_count_bits(ctx->Transform.ClipPlanesEnabled);
+ key.uses_clip_distance = vp->program.UsesClipDistance;
key.copy_edgeflag = (ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL);
const struct brw_vertex_program *vp =
brw_vertex_program_const(brw->vertex_program);
unsigned int nr_params = brw->vs.prog_data->nr_params / 4;
+ bool uses_clip_distance = vp->program.UsesClipDistance;
if (brw->vertex_program->IsNVProgram)
_mesa_load_tracked_matrices(ctx);
/* This should be loaded like any other param, but it's ad-hoc
* until we redo the VS backend.
*/
- for (i = 0; i < MAX_CLIP_PLANES; i++) {
- if (ctx->Transform.ClipPlanesEnabled & (1 << i)) {
- memcpy(param, ctx->Transform._ClipUserPlane[i], 4 * sizeof(float));
- param += 4;
- params_uploaded++;
- }
+ if (!uses_clip_distance) {
+ for (i = 0; i < MAX_CLIP_PLANES; i++) {
+ if (ctx->Transform.ClipPlanesEnabled & (1 << i)) {
+ memcpy(param, ctx->Transform._ClipUserPlane[i], 4 * sizeof(float));
+ param += 4;
+ params_uploaded++;
+ }
+ }
}
/* Align to a reg for convenience for brw_vs_emit.c */
if (params_uploaded & 1) {