system_value("gs_header_ir3", 1)
system_value("primitive_location_ir3", 1, indices=[DRIVER_LOCATION])
+# System values for freedreno tessellation shaders.
+system_value("hs_patch_stride_ir3", 1)
+system_value("tess_factor_base_ir3", 2)
+system_value("tess_param_base_ir3", 2)
+system_value("tcs_header_ir3", 1)
+
# IR3-specific load/store intrinsics. These access a buffer used to pass data
# between geometry stages - perhaps it's explicit access to the vertex cache.
ENUM(SYSTEM_VALUE_BARYCENTRIC_CENTROID),
ENUM(SYSTEM_VALUE_BARYCENTRIC_SIZE),
ENUM(SYSTEM_VALUE_GS_HEADER_IR3),
+ ENUM(SYSTEM_VALUE_TCS_HEADER_IR3),
};
STATIC_ASSERT(ARRAY_SIZE(names) == SYSTEM_VALUE_MAX);
return NAME(sysval);
SYSTEM_VALUE_BARYCENTRIC_SIZE,
/**
- * IR3 specific geometry shader system value that packs invocation id,
- * thread id and vertex id. Having this as a nir level system value lets
- * us do the unpacking in nir.
+ * IR3 specific geometry shader and tesselation control shader system
+ * values that packs invocation id, thread id and vertex id. Having this
+ * as a nir level system value lets us do the unpacking in nir.
*/
SYSTEM_VALUE_GS_HEADER_IR3,
+ SYSTEM_VALUE_TCS_HEADER_IR3,
SYSTEM_VALUE_MAX /**< Number of values */
} gl_system_value;
case nir_intrinsic_load_vs_vertex_stride_ir3:
dst[0] = create_uniform(b, primitive_param + 1);
break;
+ case nir_intrinsic_load_hs_patch_stride_ir3:
+ dst[0] = create_uniform(b, primitive_param + 2);
+ break;
+ case nir_intrinsic_load_patch_vertices_in:
+ dst[0] = create_uniform(b, primitive_param + 3);
+ break;
+ case nir_intrinsic_load_tess_param_base_ir3:
+ dst[0] = create_uniform(b, primitive_param + 4);
+ dst[1] = create_uniform(b, primitive_param + 5);
+ break;
+ case nir_intrinsic_load_tess_factor_base_ir3:
+ dst[0] = create_uniform(b, primitive_param + 6);
+ dst[1] = create_uniform(b, primitive_param + 7);
+ break;
+
case nir_intrinsic_load_primitive_location_ir3:
idx = nir_intrinsic_driver_location(intr);
dst[0] = create_uniform(b, primitive_map + idx);
case nir_intrinsic_load_gs_header_ir3:
dst[0] = ctx->gs_header;
break;
+ case nir_intrinsic_load_tcs_header_ir3:
+ dst[0] = ctx->tcs_header;
+ break;
case nir_intrinsic_load_primitive_id:
dst[0] = ctx->primitive_id;
struct ir3_instruction *primitive_id;
struct ir3_instruction *gs_header;
+ /* For tessellation shaders: */
+ struct ir3_instruction *patch_vertices_in;
+ struct ir3_instruction *tcs_header;
+ struct ir3_instruction *tess_coord;
+
/* Compute shader inputs: */
struct ir3_instruction *local_invocation_id, *work_group_id;
return "GS_HEADER";
case VARYING_SLOT_GS_VERTEX_FLAGS_IR3:
return "GS_VERTEX_FLAGS";
+ case VARYING_SLOT_TCS_HEADER_IR3:
+ return "TCS_HEADER";
default:
return gl_varying_slot_name(so->outputs[i].slot);
}
#define VARYING_SLOT_GS_HEADER_IR3 (VARYING_SLOT_MAX + 0)
#define VARYING_SLOT_GS_VERTEX_FLAGS_IR3 (VARYING_SLOT_MAX + 1)
+#define VARYING_SLOT_TCS_HEADER_IR3 (VARYING_SLOT_MAX + 2)
static inline uint32_t