Skip to content

Format code for PR #7711 #7765

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

Conversation

slangbot
Copy link
Contributor

Automated code formatting for #7711

@slangbot slangbot requested a review from a team as a code owner July 15, 2025 05:17
@csyonghe csyonghe merged commit 4219884 into shader-slang:claude/issue-7701-20250710_213741 Jul 15, 2025
1 check passed
github-merge-queue bot pushed a commit that referenced this pull request Jul 16, 2025
* Add diagnostic for const/uniform global variables with initializers

Global const and uniform variables without the static modifier are
treated as uniform parameters in HLSL, which cannot have default values.
This change adds error 31224 to catch this case early and provide clear
guidance to users.

Fixes #7701

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Yong He <[email protected]>

* Add test case for global const/uniform variable diagnostic

Add test for diagnostic 31224 which catches global const and uniform
variables with initializers that aren't declared static. The test
verifies both error cases and valid cases to ensure the diagnostic
works correctly.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Yong He <[email protected]>

* Fix failing tests due to new global const diagnostic

Add 'static' keyword to global const variables with initializers
to resolve diagnostic 31224: "global const variable with initializer
must be declared static"

Co-authored-by: Jay Kwak <[email protected]>

* Allow specialization constants with initializers without static

- Modified diagnostic logic in slang-check-decl.cpp to allow specialization
  constants (SpecializationConstantAttribute and VkConstantIdAttribute) to
  have initializers without requiring the static keyword
- Updated 8 SPIRV test files to remove unnecessary static keywords from
  specialization constant declarations
- Enhanced diagnostic test case to include specialization constant examples
- All tests passing with the new behavior

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Yong He <[email protected]>

* format code (#7765)

Co-authored-by: slangbot <[email protected]>

* Remove static keyword from specialization constants and add comprehensive test cases

- Remove static from specialization constants in test files as they are semantically meaningless
- Update tests to use existing diagnostic 31219 for static specialization constant errors
- Add comprehensive test cases that verify the error occurs when static is used with specialization constants
- Fixes suggested in PR review to make static specialization constants an error

Co-authored-by: ArielG-NV <[email protected]>

* Add error for static specialization constants

Static specialization constants are semantically meaningless and should
produce an error. This change adds logic to trigger diagnostic 31219
when both 'static' and specialization constant attributes are present.

The existing diagnostic 31219 'push or specialization constants cannot
be static' is now correctly triggered for:
- [SpecializationConstant] static const variables
- [vk::constant_id] static const variables

Co-authored-by: ArielG-NV <[email protected]>

* Update source/slang/slang-check-decl.cpp

* Update tests/glsl/compute-shader-layout-id.slang

* Update tests/glsl/compute-shader-layout-id.slang

* Fix test case Claude broke

* Update global-uniform.slang

* Update global-uniform.slang.expected

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yong He <[email protected]>
Co-authored-by: ArielG-NV <[email protected]>
Co-authored-by: Jay Kwak <[email protected]>
Co-authored-by: slangbot <[email protected]>
Co-authored-by: slangbot <[email protected]>
Co-authored-by: ArielG-NV <[email protected]>
ArielG-NV added a commit to ArielG-NV/slang that referenced this pull request Jul 20, 2025
* Add diagnostic for const/uniform global variables with initializers

Global const and uniform variables without the static modifier are
treated as uniform parameters in HLSL, which cannot have default values.
This change adds error 31224 to catch this case early and provide clear
guidance to users.

Fixes shader-slang#7701

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Yong He <[email protected]>

* Add test case for global const/uniform variable diagnostic

Add test for diagnostic 31224 which catches global const and uniform
variables with initializers that aren't declared static. The test
verifies both error cases and valid cases to ensure the diagnostic
works correctly.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Yong He <[email protected]>

* Fix failing tests due to new global const diagnostic

Add 'static' keyword to global const variables with initializers
to resolve diagnostic 31224: "global const variable with initializer
must be declared static"

Co-authored-by: Jay Kwak <[email protected]>

* Allow specialization constants with initializers without static

- Modified diagnostic logic in slang-check-decl.cpp to allow specialization
  constants (SpecializationConstantAttribute and VkConstantIdAttribute) to
  have initializers without requiring the static keyword
- Updated 8 SPIRV test files to remove unnecessary static keywords from
  specialization constant declarations
- Enhanced diagnostic test case to include specialization constant examples
- All tests passing with the new behavior

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Yong He <[email protected]>

* format code (shader-slang#7765)

Co-authored-by: slangbot <[email protected]>

* Remove static keyword from specialization constants and add comprehensive test cases

- Remove static from specialization constants in test files as they are semantically meaningless
- Update tests to use existing diagnostic 31219 for static specialization constant errors
- Add comprehensive test cases that verify the error occurs when static is used with specialization constants
- Fixes suggested in PR review to make static specialization constants an error

Co-authored-by: ArielG-NV <[email protected]>

* Add error for static specialization constants

Static specialization constants are semantically meaningless and should
produce an error. This change adds logic to trigger diagnostic 31219
when both 'static' and specialization constant attributes are present.

The existing diagnostic 31219 'push or specialization constants cannot
be static' is now correctly triggered for:
- [SpecializationConstant] static const variables
- [vk::constant_id] static const variables

Co-authored-by: ArielG-NV <[email protected]>

* Update source/slang/slang-check-decl.cpp

* Update tests/glsl/compute-shader-layout-id.slang

* Update tests/glsl/compute-shader-layout-id.slang

* Fix test case Claude broke

* Update global-uniform.slang

* Update global-uniform.slang.expected

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yong He <[email protected]>
Co-authored-by: ArielG-NV <[email protected]>
Co-authored-by: Jay Kwak <[email protected]>
Co-authored-by: slangbot <[email protected]>
Co-authored-by: slangbot <[email protected]>
Co-authored-by: ArielG-NV <[email protected]>
ArielG-NV added a commit to ArielG-NV/slang that referenced this pull request Jul 21, 2025
* Add diagnostic for const/uniform global variables with initializers

Global const and uniform variables without the static modifier are
treated as uniform parameters in HLSL, which cannot have default values.
This change adds error 31224 to catch this case early and provide clear
guidance to users.

Fixes shader-slang#7701

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Yong He <[email protected]>

* Add test case for global const/uniform variable diagnostic

Add test for diagnostic 31224 which catches global const and uniform
variables with initializers that aren't declared static. The test
verifies both error cases and valid cases to ensure the diagnostic
works correctly.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Yong He <[email protected]>

* Fix failing tests due to new global const diagnostic

Add 'static' keyword to global const variables with initializers
to resolve diagnostic 31224: "global const variable with initializer
must be declared static"

Co-authored-by: Jay Kwak <[email protected]>

* Allow specialization constants with initializers without static

- Modified diagnostic logic in slang-check-decl.cpp to allow specialization
  constants (SpecializationConstantAttribute and VkConstantIdAttribute) to
  have initializers without requiring the static keyword
- Updated 8 SPIRV test files to remove unnecessary static keywords from
  specialization constant declarations
- Enhanced diagnostic test case to include specialization constant examples
- All tests passing with the new behavior

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Yong He <[email protected]>

* format code (shader-slang#7765)

Co-authored-by: slangbot <[email protected]>

* Remove static keyword from specialization constants and add comprehensive test cases

- Remove static from specialization constants in test files as they are semantically meaningless
- Update tests to use existing diagnostic 31219 for static specialization constant errors
- Add comprehensive test cases that verify the error occurs when static is used with specialization constants
- Fixes suggested in PR review to make static specialization constants an error

Co-authored-by: ArielG-NV <[email protected]>

* Add error for static specialization constants

Static specialization constants are semantically meaningless and should
produce an error. This change adds logic to trigger diagnostic 31219
when both 'static' and specialization constant attributes are present.

The existing diagnostic 31219 'push or specialization constants cannot
be static' is now correctly triggered for:
- [SpecializationConstant] static const variables
- [vk::constant_id] static const variables

Co-authored-by: ArielG-NV <[email protected]>

* Update source/slang/slang-check-decl.cpp

* Update tests/glsl/compute-shader-layout-id.slang

* Update tests/glsl/compute-shader-layout-id.slang

* Fix test case Claude broke

* Update global-uniform.slang

* Update global-uniform.slang.expected

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yong He <[email protected]>
Co-authored-by: ArielG-NV <[email protected]>
Co-authored-by: Jay Kwak <[email protected]>
Co-authored-by: slangbot <[email protected]>
Co-authored-by: slangbot <[email protected]>
Co-authored-by: ArielG-NV <[email protected]>
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.

2 participants