-
Notifications
You must be signed in to change notification settings - Fork 51
[0037] Only restrict nesting cbuffer and namespace decls #685
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
base: main
Are you sure you want to change the base?
[0037] Only restrict nesting cbuffer and namespace decls #685
Conversation
This slightly scales back the proposal to restricting namespaces in cbuffers and restricting nesting of cbuffers. This is likely a safe change for HLSL 202x, and we'll consider more significant changes in subsequent language updates.
|
Better if the PR title says what this does ("Only restrict nested namespaces and cbuffers inside of cbuffers") rather than how we decided to do that. Mentioning that this came out of a design meeting is better suited as part of the commit body. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of comments
| \define{cbuffer-member-declaration}\br | ||
| block-declaration\br | ||
| function-definition\br | ||
| template-declaration\br | ||
| empty-declaration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did the variable-declaration disappear? And what is block-declaration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block-declaration is any declaration that can occur at block scope (i.e. any declaration you could have inside a function). That includes variables, but also aliases, static asserts, and other "simple" declarations like functions and classes.
The draft language spec PR includes some wider changes to the declarations chapter and grammars:
https://github.com/microsoft/hlsl-specs/pull/684/files#diff-11b83f8183acd1a33489925bf65fbeb9d420609588c72b0075263be859f6d186
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see :) That's why I could not find it in the current version of the spec.
Co-authored-by: Helena Kotas <hekotas@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This slightly scales back the proposal to restricting namespaces in cbuffers and restricting nesting of cbuffers. This is likely a safe change for HLSL 202x, and we'll consider more significant changes in subsequent language updates.
This conclusion came out of the language design meeting discussion from 10/13/2025.
The language spec updates are posted in a draft as #684.