Update Location Chapter for matrix#321
Open
spencer-lunarg wants to merge 1 commit intoKhronosGroup:mainfrom
Open
Update Location Chapter for matrix#321spencer-lunarg wants to merge 1 commit intoKhronosGroup:mainfrom
spencer-lunarg wants to merge 1 commit intoKhronosGroup:mainfrom
Conversation
Tobski
reviewed
Jun 26, 2025
Tobski
left a comment
There was a problem hiding this comment.
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.
Suggested change
| 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.
Suggested change
| 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.
Suggested change
| 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?
Comment on lines
+162
to
+163
| 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.
Suggested change
| 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.
Contributor
|
Hi @spencer-lunarg, anything you need to get this ready to merge? Thx |
Contributor
Author
this is still pending spec clarification which is pending CTS... so might be open for a bit long |
ahamed661177-8
approved these changes
Jan 28, 2026
ahamed661177-8
approved these changes
Feb 2, 2026
ahamedg409-bit
approved these changes
Feb 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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