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

[Documentation] Default values on struct members #5951

Closed
NoxWings opened this issue Dec 29, 2024 · 1 comment
Closed

[Documentation] Default values on struct members #5951

NoxWings opened this issue Dec 29, 2024 · 1 comment

Comments

@NoxWings
Copy link

https://shader-slang.com/slang/user-guide/conventional-features.html

On this page there is a note mentioning

Note
Slang currently does not allow default values on struct members, but we intend to support them in the future.

But then later on
https://shader-slang.com/slang/user-guide/convenience-features.html

Member Init Expressions
Slang supports member init expressions:

struct MyType
{
    int myVal = 5;
}

Aren't they referring to the same thing? should the docs be updated?

@csyonghe
Copy link
Collaborator

The current semantics around initializers is not consistent or sound. There is an ongoing work to clean this up, and this will be fully supported once that work is complete.

See PR: #5215

And language design: https://github.com/shader-slang/slang/blob/master/docs/proposals/004-initialization.md

@NoxWings NoxWings closed this as completed Jan 2, 2025
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

No branches or pull requests

2 participants