}
 }
 
+/* Currently we do not do binning for tess.  And for GS there is no
+ * cross-stage VS+GS optimization, so the full VS+GS is used in
+ * the binning pass.
+ */
+static inline bool
+ir3_has_binning_vs(const struct ir3_shader_key *key)
+{
+       if (key->tessellation || key->has_gs)
+               return false;
+       return true;
+}
 
 /**
  * Represents a shader at the API level, before state-specific variants are
 
    const struct tu_shader *vs = builder->shaders[MESA_SHADER_VERTEX];
    struct ir3_shader_variant *variant;
 
-   if (vs->ir3_shader->stream_output.num_outputs) {
+   if (vs->ir3_shader->stream_output.num_outputs ||
+       !ir3_has_binning_vs(&key)) {
       variant = builder->variants[MESA_SHADER_VERTEX];
    } else {
       bool created;
 
        OUT_PKT4(ring, REG_A6XX_HLSQ_UPDATE_CNTL, 1);
        OUT_RING(ring, 0xff);        /* XXX */
 
-       if (state->ds)
-               debug_assert(state->ds->constlen >= state->bs->constlen);
-       else
-               debug_assert(state->vs->constlen >= state->bs->constlen);
+       debug_assert(state->vs->constlen >= state->bs->constlen);
 
        OUT_PKT4(ring, REG_A6XX_HLSQ_VS_CNTL, 4);
        OUT_RING(ring, A6XX_HLSQ_VS_CNTL_CONSTLEN(state->vs->constlen) |
 
                }
        }
 
-       /* For tessellation, the binning shader is derived from the DS. */
        struct ir3_shader_variant *bs;
-       if (key->ds) {
-               shader_key.safe_constlen = !!(safe_constlens & (1 << MESA_SHADER_TESS_EVAL));
-               bs = ir3_shader_variant(key->ds, shader_key, true, debug);
-       } else {
+
+       if (ir3_has_binning_vs(&key->key)) {
                shader_key.safe_constlen = !!(safe_constlens & (1 << MESA_SHADER_VERTEX));
-               bs = ir3_shader_variant(key->vs, shader_key, true, debug);
+               bs = ir3_shader_variant(key->vs, key->key, true, debug);
+               if (!bs)
+                       return NULL;
+       } else {
+               bs = variants[MESA_SHADER_VERTEX];
        }
-       if (!bs)
-               return NULL;
 
        struct ir3_program_state *state =
                cache->funcs->create_state(cache->data, bs,