Skip to content
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

Add Location Component chapter #292

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

spencer-lunarg
Copy link
Contributor

@spencer-lunarg spencer-lunarg commented Feb 10, 2025

@Tobski @alan-baker - Here is a simple chapter around our favorite topic of Location/Component

  1. Please review and make sure we all agree
  2. Please suggest other possible "fun" cases to add here for help in future references

(latest commit rendered version - https://github.com/KhronosGroup/Vulkan-Guide/blob/04c334e94c08470961bf4ebfc13520b907acc884/chapters/location_component_interface.adoc)

Copy link

@Tobski Tobski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments for clarity and a few fixes. I think it would also be a good idea to have a 64-bit example, particularly a 64-bit vec3/4, showing how these consume multiple locations, and how these have to be aligned to even components.


[source,glsl]
----
layout(location=0) in f64vec3 a;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would also be a good idea to have a 64-bit example, particularly a 64-bit vec3/4

Here is that example

Copy link
Contributor

@alan-baker alan-baker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this chapter provide guidance on whether the number of locations ought to be minimized? Maybe it should also mention that you can't mix interpolation within a location?

+ layout(location=0, component=2) in float in_f;
----

== Array
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once Vulkan issue 4180 is clarified it would be good to expand this section I think

@spencer-lunarg
Copy link
Contributor Author

Should this chapter provide guidance on whether the number of locations ought to be minimized? Maybe it should also mention that you can't mix interpolation within a location?

  1. Yes, can add a thing at the top explaining the desire to use less if possible (and also there are limit values)
  2. I forgot about the interpolation case, will add that

@spencer-lunarg spencer-lunarg force-pushed the spencer-lunarg-locations branch from 08fe7d5 to 04c334e Compare February 18, 2025 21:47
@spencer-lunarg
Copy link
Contributor Author

@alan-baker for the

that you can't mix interpolation within a location?

Did you mean between two stages? (I plan to have another possible guide about connecting the Location)

As for what I think you mean, it seems that GLSL disallows it, but not spirv-val (https://godbolt.org/z/EohPberKd)

@alan-baker
Copy link
Contributor

@alan-baker for the

that you can't mix interpolation within a location?

Did you mean between two stages? (I plan to have another possible guide about connecting the Location)

As for what I think you mean, it seems that GLSL disallows it, but not spirv-val (https://godbolt.org/z/EohPberKd)

Yes, I know spirv-val doesn't check it. It's good that glslang does, but it's one of those things for new frontends that is sort of a gotcha that's not easy to find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants