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

Make structured buffers illegal parameter types in WGSL #5483

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

aleino-nv
Copy link
Collaborator

Structured buffer types translate to array types in the WGSL emitter. WGSL doesn't allow passing runtime-sized arrays to functions.

This closes issue #5228.

@aleino-nv aleino-nv added the pr: non-breaking PRs without breaking changes label Nov 4, 2024
@aleino-nv aleino-nv requested a review from csyonghe November 4, 2024 13:02
@aleino-nv aleino-nv requested a review from a team as a code owner November 5, 2024 07:37
@aleino-nv
Copy link
Collaborator Author

/format

@slangbot
Copy link
Contributor

slangbot commented Nov 5, 2024

🌈 Formatted, please merge the changes from this PR

aleino-nv added a commit to aleino-nv/slang that referenced this pull request Nov 5, 2024
@aleino-nv aleino-nv requested a review from csyonghe November 5, 2024 08:58
expipiplus1
expipiplus1 previously approved these changes Nov 5, 2024
@csyonghe
Copy link
Collaborator

csyonghe commented Nov 5, 2024

/format

@slangbot
Copy link
Contributor

slangbot commented Nov 5, 2024

🌈 Formatted, please merge the changes from this PR

@aleino-nv
Copy link
Collaborator Author

/format

@slangbot
Copy link
Contributor

slangbot commented Nov 6, 2024

🌈 Formatted, please merge the changes from this PR

aleino-nv added a commit to aleino-nv/slang that referenced this pull request Nov 6, 2024
@aleino-nv aleino-nv removed the request for review from csyonghe November 6, 2024 07:25
…targeting WGSL

Structured buffer types translate to array types in the WGSL emitter.
WGSL doesn't allow passing runtime-sized arrays to functions.
Similarly for pointers to texture handles.
Also, structured buffers (runtime-sized arrays) cannot be returned in WGSL.

This closes issue shader-slang#5228, issue shader-slang#5278 and issue shader-slang#5288 by enabling specialized functions
to be generated in these cases, in order to work around these constraints.
@aleino-nv aleino-nv merged commit f829420 into shader-slang:master Nov 6, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants