Why does C3D_FVec have reversed order of components

Post Reply
SamoZ256
Posts: 1
Joined: Thu Jul 11, 2024 9:13 am

Why does C3D_FVec have reversed order of components

Post by SamoZ256 » Thu Jul 11, 2024 9:22 am

The C3D_FVec has reversed order of components (wzyx instead of xyzw), and I don't get why. The types.h has this comment before C3D_FVec declaration: /**
* @struct C3D_FVec
* @brief Float vector
*
* Matches PICA layout
*/
However, I have all my vertex data in the regular order (xyzw) and it works just fine. So why is the order reversed? Am I missing something obvious or is the comment just wrong?

User avatar
fincs
( ͡° ͜ʖ ͡°)
Posts: 103
Joined: Mon Jul 12, 2010 9:45 pm
Location: Seville, Spain
Contact:

Re: Why does C3D_FVec have reversed order of components

Post by fincs » Tue Jul 23, 2024 5:14 pm

The PICA200 expects floating point 4-component vector uniforms to be uploaded in reverse order (w z y x). For efficiency reasons citro3d defines its C3D_FVec to match the expected layout. On the other hand, vertex data is processed by the PICA200 in the usual order (x y z w).
Donate to devkitPro - help us stay alive!

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests