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 datalayout for constant buffers. #5608

Merged
merged 9 commits into from
Nov 21, 2024
Merged

Conversation

csyonghe
Copy link
Collaborator

@csyonghe csyonghe commented Nov 20, 2024

Closes #5598.
Closes #5595.

This PR adds support for specifying data layout for constant buffers, and fixes the default layout of push constant buffer to be std430.

ConstantBuffer can now be specified with a buffer layout, similar to StructuredBuffer:

ConstantBuffer<T, Std430DataLayout> buffer;

Also fixes a bug that incorrectly causes specialization constants to occupy space 0.

@csyonghe csyonghe requested a review from a team as a code owner November 20, 2024 07:36
@csyonghe csyonghe added the pr: non-breaking PRs without breaking changes label Nov 20, 2024
@csyonghe csyonghe force-pushed the spirv branch 2 times, most recently from 552e00a to 8d64ce3 Compare November 21, 2024 00:03
@cheneym2
Copy link
Collaborator

Closes #5598. Closes #5595.

This PR adds support for specifying data layout for constant buffers, and fixes the default layout of push constant buffer to be std430.

ConstantBuffer can now be specified with a buffer layout, similar to StructuredBuffer:

ConstantBuffer<T, Std430DataLayout> buffer;

Also fixes a bug that incorrectly causes specialization constants to occupy space 0.

Sorry if I'm misunderstanding, but I can't tell that the test changes are using the option to specify buffer layouts like in this commit description.

@cheneym2
Copy link
Collaborator

Looks good, but AFAICT a test for the feature to add a type to the ConstantBuffer declaration is not here.

@CLAassistant
Copy link

CLAassistant commented Nov 21, 2024

CLA assistant check
All committers have signed the CLA.

@csyonghe csyonghe merged commit fdf061e into shader-slang:master Nov 21, 2024
15 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
4 participants