key->vsaturate_s | key->vsaturate_t | key->vsaturate_r |
key->ucp_enables | key->color_two_side |
key->fclamp_color | key->vclamp_color |
- key->has_gs;
+ key->tessellation | key->has_gs;
}
#define OPT(nir, pass, ...) ({ \
unsigned rasterflat : 1;
unsigned fclamp_color : 1;
+ /* Indicates that this is a tessellation pipeline which requires a
+ * whole different kind of vertex shader. In case of
+ * tessellation, this field also tells us which kind of output
+ * topology the TES uses, which the TCS needs to know.
+ */
+#define IR3_TESS_NONE 0
+#define IR3_TESS_TRIANGLES 1
+#define IR3_TESS_QUADS 2
+#define IR3_TESS_ISOLINES 3
+ unsigned tessellation : 2;
+
unsigned has_gs : 1;
};
uint32_t global;
key->vastc_srgb = 0;
key->vsamples = 0;
key->has_gs = false; /* FS doesn't care */
+ key->tessellation = IR3_TESS_NONE;
}
break;
case MESA_SHADER_VERTEX:
key->fastc_srgb = 0;
key->fsamples = 0;
}
+
+ /* VS and GS only care about whether or not we're tessellating. */
+ key->tessellation = !!key->tessellation;
+ break;
+ case MESA_SHADER_TESS_CTRL:
+ case MESA_SHADER_TESS_EVAL:
+ key->color_two_side = false;
+ key->half_precision = false;
+ key->rasterflat = false;
+ if (key->has_per_samp) {
+ key->fsaturate_s = 0;
+ key->fsaturate_t = 0;
+ key->fsaturate_r = 0;
+ key->fastc_srgb = 0;
+ key->fsamples = 0;
+ key->vsaturate_s = 0;
+ key->vsaturate_t = 0;
+ key->vsaturate_r = 0;
+ key->vastc_srgb = 0;
+ key->vsamples = 0;
+ }
break;
default:
/* TODO */
.sprite_coord_mode = ctx->rasterizer->sprite_coord_mode,
};
+ if (info->mode == PIPE_PRIM_PATCHES) {
+ shader_info *ds_info = &emit.key.ds->nir->info;
+ switch (ds_info->tess.primitive_mode) {
+ case GL_ISOLINES:
+ emit.key.key.tessellation = IR3_TESS_ISOLINES;
+ break;
+ case GL_TRIANGLES:
+ emit.key.key.tessellation = IR3_TESS_TRIANGLES;
+ break;
+ case GL_QUADS:
+ emit.key.key.tessellation = IR3_TESS_QUADS;
+ break;
+ default:
+ unreachable("bad tessmode");
+ }
+ }
+
if (emit.key.gs)
emit.key.key.has_gs = true;