Thank you very much for your help. This information is extremely valuable.
I would have spent much longer on this feature if I hadn't gotten frustrated and turned to easier alternatives.
The core issue was understanding what's in the buffer. The method you provided is correct. However, please allow me to continue using my current approach—recalculating the relevant vertices each time. I understand there could be a better solution: finding the relationship between Attachment/triangle and buffer index (assuming the order is fixed, though unverified—I didn't spend more time investigating the code) and using the cached relationship along with the vertices buffer to retrieve data.
Regarding the mapping part, each triangle has a 3-point correspondence, which means it's an affine transformation. Barycentric coordinates are preserved under affine transformations. I didn't calculate the transformation matrix itself; instead, I calculated the transformed point directly, and the solution worked. I'm sure there are better solutions, but please allow me to move on and continue with the next feature.
I really appreciate your replies.
P.S. As for the shader issue, please forgive my recklessness.