-
Notifications
You must be signed in to change notification settings - Fork 185
Update Location Chapter for matrix #321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update Location Chapter for matrix #321
Conversation
Tobski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending resolution of the internal MR but this is a necessary update if/when that lands.
| A matrix is viewed as an array, which consume all 4 components. | ||
|
|
||
| So something like | ||
| A matrix is viewed as an array of vector, this means something like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| A matrix is viewed as an array of vector, this means something like | |
| A matrix is stored as an array of vector, this means something like |
"Viewed as" implies something else.
| ---- | ||
|
|
||
| From a `Location`/`Component` point-of-view looks like | ||
| from a `Location`/`Component` point-of-view looks like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| from a `Location`/`Component` point-of-view looks like | |
| consumes locations and components identically to |
| ---- | ||
|
|
||
| As stated above, arrays consume the whole `Location` so the following is **not** allowed. | ||
| Just like vector, depending on the size, it may not consume the whole `Location`. This means the following is allowed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Just like vector, depending on the size, it may not consume the whole `Location`. This means the following is allowed. | |
| which in turn is stored identically to | |
| [source,glsl] | |
| ---- | |
| // Each vector consumes only the first 2 components of each location | |
| layout(location = 0) vec2 a0; | |
| layout(location = 1) vec2 a1; | |
| layout(location = 2) vec2 a2; | |
| ---- | |
| This means the following is allowed: |
Also the "Arrays consume whole location" comment above is wrong - where did that come from?
| You don't need to worry about things going "in front" of a matrix because the `Component` decoration | ||
| link:https://godbolt.org/z/f81PvP538[can not be applied on a matrix type]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| You don't need to worry about things going "in front" of a matrix because the `Component` decoration | |
| link:https://godbolt.org/z/f81PvP538[can not be applied on a matrix type]. | |
| Unlike arrays or independent vectors, link:https://godbolt.org/z/f81PvP538[matrices cannot be decorated with `Component`], so will always be packed from component 0. |
Maybe? "In front" seems overly vague to me.
|
Hi @spencer-lunarg, anything you need to get this ready to merge? Thx |
this is still pending spec clarification which is pending CTS... so might be open for a bit long |
More updates from https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/7455
cc @alan-baker @Tobski hopefully this is the final chapter of the Location saga