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

Allow specialization constant length arrays #2396

Merged
merged 4 commits into from
Mar 19, 2024

Conversation

victor-eds
Copy link
Contributor

SPIR-V arrays can have their length specified via a specialization constant. In case an alloca instruction uses a specialization constant s as length, generate an array variable of length s.

@victor-eds victor-eds force-pushed the spec-const-len-arr branch from 71be466 to afd3075 Compare March 4, 2024 10:20
test/SpecConstants/spec-constant-length-array.ll Outdated Show resolved Hide resolved
test/SpecConstants/spec-constant-length-array.ll Outdated Show resolved Hide resolved
lib/SPIRV/SPIRVWriter.cpp Show resolved Hide resolved
@victor-eds victor-eds requested a review from MrSidims March 4, 2024 16:49
@victor-eds
Copy link
Contributor Author

@MrSidims any further comments on my findings?

SPIR-V arrays can have their length specified via a specialization
constant. In case an `alloca` instruction uses a specialization
constant `s` as length, generate an array variable of length `s`.

Signed-off-by: Victor Perez <[email protected]>
Signed-off-by: Victor Perez <[email protected]>
@victor-eds
Copy link
Contributor Author

@MrSidims rebased on #2439 for SPIR-V validity.

Copy link
Contributor

@MrSidims MrSidims left a comment

Choose a reason for hiding this comment

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

Thanks!

@MrSidims MrSidims requested a review from svenvh March 19, 2024 11:06
@MrSidims MrSidims merged commit 9fdddf0 into KhronosGroup:main Mar 19, 2024
9 checks passed
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