-
- /* Iterate the varyings and emit the corresponding descriptor */
- for (unsigned i = 0; i < state->varying_count; ++i) {
- unsigned location = p_varyings[i];
-
- /* Default to a vec4 varying */
- struct mali_attr_meta v = {
- .format = p_varying_type[i],
- .swizzle = default_vec4_swizzle,
- .unknown1 = 0x2,
- };
-
- /* Check for special cases, otherwise assume general varying */
-
- if (location == VARYING_SLOT_POS) {
- if (stage == MESA_SHADER_FRAGMENT)
- state->reads_frag_coord = true;
- else
- v.format = MALI_VARYING_POS;
- } else if (location == VARYING_SLOT_PSIZ) {
- v.format = MALI_R16F;
- v.swizzle = default_vec1_swizzle;
-
- state->writes_point_size = true;
- } else if (location == VARYING_SLOT_PNTC) {
- v.format = MALI_RG16F;
- v.swizzle = default_vec2_swizzle;
-
- state->reads_point_coord = true;
- } else if (location == VARYING_SLOT_FACE) {
- v.format = MALI_R32I;
- v.swizzle = default_vec1_swizzle;
-
- state->reads_face = true;
- }
-
- state->varyings[i] = v;
- state->varyings_loc[i] = location;
- }