Skip to content

Restrict Initializers for Workgroup OpVariables - #1638

Merged
bashbaug merged 1 commit into
KhronosGroup:mainfrom
svenvh:restrict-workgroup-init
Oct 28, 2026
Merged

bashbaug merged 1 commit into
KhronosGroup:mainfrom
svenvh:restrict-workgroup-init

Conversation

@svenvh

@svenvh svenvh commented Oct 27, 2026

Copy link
Copy Markdown
Member

The OpenCL C specification states that a local variable must not have an initializer. Add a similar restriction to the OpenCL SPIR-V Environment specification.

Fixes #554

The OpenCL C specification states that a local variable must not have
an initializer.  Add a similar restriction to the OpenCL SPIR-V
Environment specification.

Fixes KhronosGroup#554

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>

@bashbaug bashbaug left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

Does spirv-val already check for this? If not, might be worth adding a SPIRV-Tools issue to track it.

@svenvh

svenvh commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Does spirv-val already check for this? If not, might be worth adding a SPIRV-Tools issue to track it.

I've opened KhronosGroup/SPIRV-Tools#7006 to add the check.

@bashbaug

Copy link
Copy Markdown
Contributor

This should be non-controversial, so I'm going to go ahead and merge this. If more discussion is needed for some reason, we can always revisit. Thanks!

@bashbaug
bashbaug merged commit e7c313b into KhronosGroup:main Oct 28, 2026
2 checks passed
@svenvh
svenvh deleted the restrict-workgroup-init branch October 29, 2026 08:27
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

Successfully merging this pull request may close these issues.

SPIR-V: Which storage classes allow initializers?

2 participants