Skip to content

Conversation

@llvm-beanz
Copy link
Collaborator

@llvm-beanz llvm-beanz commented Oct 15, 2025

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.

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.
@bogner
Copy link
Collaborator

bogner commented Oct 15, 2025

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.

@llvm-beanz llvm-beanz changed the title [0037] Updates from design meeting discussion [0037] Only restrict nesting cbuffer and namespace decls Oct 15, 2025
Copy link
Member

@hekota hekota left a comment

Choose a reason for hiding this comment

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

Couple of comments

Comment on lines +79 to +83
\define{cbuffer-member-declaration}\br
block-declaration\br
function-definition\br
template-declaration\br
empty-declaration
Copy link
Member

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?

Copy link
Collaborator Author

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

Copy link
Member

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>
Copy link
Member

@hekota hekota left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants