uint32_t get_hw_prim_for_gl_prim(int mode);
-void
-brw_setup_vue_key_clip_info(struct brw_context *brw,
- struct brw_vue_prog_key *key,
- bool program_uses_clip_distance);
-
void
gen6_upload_push_constants(struct brw_context *brw,
const struct gl_program *prog,
GLbitfield64 outputs_written = gp->program.Base.OutputsWritten;
- /* In order for legacy clipping to work, we need to populate the clip
- * distance varying slots whenever clipping is enabled, even if the vertex
- * shader doesn't write to gl_ClipDistance.
- */
- if (c.key.base.userclip_active) {
- outputs_written |= BITFIELD64_BIT(VARYING_SLOT_CLIP_DIST0);
- outputs_written |= BITFIELD64_BIT(VARYING_SLOT_CLIP_DIST1);
- }
-
brw_compute_vue_map(brw->intelScreen->devinfo,
&c.prog_data.base.vue_map, outputs_written);
memset(key, 0, sizeof(*key));
key->base.program_string_id = gp->id;
- brw_setup_vue_key_clip_info(brw, &key->base,
- gp->program.Base.UsesClipDistanceOut);
/* _NEW_TEXTURE */
brw_populate_sampler_prog_key_data(ctx, prog, stage_state->sampler_count,
}
}
-
-void
-brw_setup_vue_key_clip_info(struct brw_context *brw,
- struct brw_vue_prog_key *key,
- bool program_uses_clip_distance)
-{
- struct gl_context *ctx = &brw->ctx;
-
- key->userclip_active = (ctx->Transform.ClipPlanesEnabled != 0);
- if (key->userclip_active && !program_uses_clip_distance) {
- key->nr_userclip_plane_consts
- = _mesa_logbase2(ctx->Transform.ClipPlanesEnabled) + 1;
- }
-}
-
static bool
brw_vs_state_dirty(struct brw_context *brw)
{
* the inputs it asks for, whether they are varying or not.
*/
key->base.program_string_id = vp->id;
- brw_setup_vue_key_clip_info(brw, &key->base,
- vp->program.Base.UsesClipDistanceOut);
+
+ if (ctx->Transform.ClipPlanesEnabled != 0) {
+ key->base.userclip_active = true;
+ if (!vp->program.Base.UsesClipDistanceOut) {
+ key->base.nr_userclip_plane_consts =
+ _mesa_logbase2(ctx->Transform.ClipPlanesEnabled) + 1;
+ }
+ }
/* _NEW_POLYGON */
if (brw->gen < 6) {