Skip to content

[Bug] mat3x3 UBO incorrect shader index access #9240

Answered by ibgreen
mcost45 asked this question in Q&A
Discussion options

You must be logged in to vote
  • I suspect that you are hitting some tricky layout rules for uniform buffers.
  • I believe that each row in the matrix needs to be aligned to a 4 element boundary adding an unused value in each row.
[11, 12, 13, X, 
 21, 22, 23, X,  
 21, 22, 23, X]
  • though this may not be the full explanation. I would expect the shift be in the opposite direction.
  • FWIW, these pesky alignment issues should go away if you use 2x2 or 4x4 matrices

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mcost45
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #9239 on November 08, 2024 16:05.