-/* Layout of LS outputs / TCS inputs
- * [0:12] = stride between patches in dwords = num_inputs * num_vertices * 4, max = 32*32*4
- * [13:20] = stride between vertices in dwords = num_inputs * 4, max = 32*4
- */
-#define SI_PARAM_TCS_IN_LAYOUT 7 /* TCS only */
-#define SI_PARAM_LS_OUT_LAYOUT 8 /* same value as TCS_IN_LAYOUT, LS only */
-
-/* TCS only parameters. */
-#define SI_PARAM_TESS_FACTOR_OFFSET 8
-#define SI_PARAM_PATCH_ID 9
-#define SI_PARAM_REL_IDS 10
-
-/* GS only parameters */
-#define SI_PARAM_GS2VS_OFFSET 5
-#define SI_PARAM_GS_WAVE_ID 6
-#define SI_PARAM_VTX0_OFFSET 7
-#define SI_PARAM_VTX1_OFFSET 8
-#define SI_PARAM_PRIMITIVE_ID 9
-#define SI_PARAM_VTX2_OFFSET 10
-#define SI_PARAM_VTX3_OFFSET 11
-#define SI_PARAM_VTX4_OFFSET 12
-#define SI_PARAM_VTX5_OFFSET 13
-#define SI_PARAM_GS_INSTANCE_ID 14
-
-/* PS only parameters */
-#define SI_PARAM_ALPHA_REF 5
-#define SI_PARAM_PRIM_MASK 6
-#define SI_PARAM_PERSP_SAMPLE 7
-#define SI_PARAM_PERSP_CENTER 8
-#define SI_PARAM_PERSP_CENTROID 9
-#define SI_PARAM_PERSP_PULL_MODEL 10
-#define SI_PARAM_LINEAR_SAMPLE 11
-#define SI_PARAM_LINEAR_CENTER 12
-#define SI_PARAM_LINEAR_CENTROID 13
-#define SI_PARAM_LINE_STIPPLE_TEX 14
-#define SI_PARAM_POS_X_FLOAT 15
-#define SI_PARAM_POS_Y_FLOAT 16
-#define SI_PARAM_POS_Z_FLOAT 17
-#define SI_PARAM_POS_W_FLOAT 18
-#define SI_PARAM_FRONT_FACE 19
-#define SI_PARAM_ANCILLARY 20
-#define SI_PARAM_SAMPLE_COVERAGE 21
-#define SI_PARAM_POS_FIXED_PT 22
-
-#define SI_NUM_PARAMS (SI_PARAM_POS_FIXED_PT + 9) /* +8 for COLOR[0..1] */
+ /* Offsets where TCS outputs and TCS patch outputs live in LDS:
+ * [0:15] = TCS output patch0 offset / 16, max = NUM_PATCHES * 32 * 32
+ * [16:31] = TCS output patch0 offset for per-patch / 16, max = NUM_PATCHES*32*32* + 32*32
+ */
+ SI_PARAM_TCS_OUT_OFFSETS,
+
+ /* Layout of TCS outputs / TES inputs:
+ * [0:12] = stride between output patches in dwords, num_outputs * num_vertices * 4, max = 32*32*4
+ * [13:20] = stride between output vertices in dwords = num_inputs * 4, max = 32*4
+ * [26:31] = gl_PatchVerticesIn, max = 32
+ */
+ SI_PARAM_TCS_OUT_LAYOUT,
+
+ /* Layout of LS outputs / TCS inputs
+ * [0:12] = stride between patches in dwords = num_inputs * num_vertices * 4, max = 32*32*4
+ * [13:20] = stride between vertices in dwords = num_inputs * 4, max = 32*4
+ */
+ SI_PARAM_TCS_IN_LAYOUT,
+
+ SI_PARAM_TCS_OC_LDS,
+ SI_PARAM_TESS_FACTOR_OFFSET,
+ SI_PARAM_PATCH_ID,
+ SI_PARAM_REL_IDS,
+
+ /* GS only parameters */
+ SI_PARAM_GS2VS_OFFSET = SI_NUM_RESOURCE_PARAMS,
+ SI_PARAM_GS_WAVE_ID,
+ SI_PARAM_VTX0_OFFSET,
+ SI_PARAM_VTX1_OFFSET,
+ SI_PARAM_PRIMITIVE_ID,
+ SI_PARAM_VTX2_OFFSET,
+ SI_PARAM_VTX3_OFFSET,
+ SI_PARAM_VTX4_OFFSET,
+ SI_PARAM_VTX5_OFFSET,
+ SI_PARAM_GS_INSTANCE_ID,
+
+ /* PS only parameters */
+ SI_PARAM_ALPHA_REF = SI_NUM_RESOURCE_PARAMS,
+ SI_PARAM_PRIM_MASK,
+ SI_PARAM_PERSP_SAMPLE,
+ SI_PARAM_PERSP_CENTER,
+ SI_PARAM_PERSP_CENTROID,
+ SI_PARAM_PERSP_PULL_MODEL,
+ SI_PARAM_LINEAR_SAMPLE,
+ SI_PARAM_LINEAR_CENTER,
+ SI_PARAM_LINEAR_CENTROID,
+ SI_PARAM_LINE_STIPPLE_TEX,
+ SI_PARAM_POS_X_FLOAT,
+ SI_PARAM_POS_Y_FLOAT,
+ SI_PARAM_POS_Z_FLOAT,
+ SI_PARAM_POS_W_FLOAT,
+ SI_PARAM_FRONT_FACE,
+ SI_PARAM_ANCILLARY,
+ SI_PARAM_SAMPLE_COVERAGE,
+ SI_PARAM_POS_FIXED_PT,
+
+ /* CS only parameters */
+ SI_PARAM_GRID_SIZE = SI_NUM_RESOURCE_PARAMS,
+ SI_PARAM_BLOCK_ID,
+ SI_PARAM_THREAD_ID,
+
+ SI_NUM_PARAMS = SI_PARAM_POS_FIXED_PT + 9, /* +8 for COLOR[0..1] */
+};
+
+/* SI-specific system values. */
+enum {
+ TGSI_SEMANTIC_DEFAULT_TESSOUTER_SI = TGSI_SEMANTIC_COUNT,
+ TGSI_SEMANTIC_DEFAULT_TESSINNER_SI,
+};