| Commit message (Collapse) | Author | Age |
| ... | |
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Added small section about default values of `struct` members
* Added one more example and made `int a` to be brace initilised as well
* Implemented suggested changes
* Update docs/user-guide/02-conventional-features.md
Co-authored-by: Yong He <yonghe@outlook.com>
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
| |
* Fix visibility of synthesized `Differential` typedefs.
* Delete incorrect test.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial plan
* Fix public unscoped enum constants visibility across module boundaries
Add visibility modifier copying in CompleteDecl for unscoped enum cases.
When synthesizing static const declarations for unscoped enum cases,
copy the visibility modifiers from the original enum declaration to
ensure they have the same visibility scope across module boundaries.
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Create new visibility modifier instances instead of sharing existing ones
Address reviewer feedback to avoid sharing modifier instances between
declarations since modifiers form a linked list. Now creates new
instances of the appropriate visibility modifier type (Public, Private,
or Internal) instead of reusing the existing instance.
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Move unscoped enum visibility tests into subdirectory structure
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Use createByNodeType for visibility modifier creation as suggested
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* format code (#7867)
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix scalar to array conversion for tessellation factors in GLSL legalization
Add scalar-to-array conversion support in adaptType() function to handle
cases where users declare scalar tessellation factors (e.g., float TessLevelInner)
but GLSL requires arrays (float[2] for gl_TessLevelInner). This prevents the
generation of BuiltinCast instructions that crash the SPIR-V emitter.
Fixes crash: "unimplemented: Unhandled local inst in spirv-emit: BuiltinCast"
- Add scalar-to-array case in slang-ir-glsl-legalize.cpp adaptType()
- Fill all array elements with the scalar value for tessellation factors
- Add test case for scalar tessellation factor conversion
Fixes #7000
Co-authored-by: Yong He <csyonghe@users.noreply.github.com>
* Apply review feedback fixes
- Change test directive to TEST:SIMPLE
- Use IRArrayType instead of IRArrayTypeBase
- Use MakeArrayFromElement for cleaner scalar-to-array conversion
Co-authored-by: Yong He <csyonghe@users.noreply.github.com>
* Fix type conversion in scalar-to-array tessellation factor conversion
Convert scalar value to array element type before creating array to handle
cases where scalar type differs from array element type (e.g., int to float[3]).
Co-authored-by: Yong He <csyonghe@users.noreply.github.com>
* Use CHECK-DAG for order-independent tessellation factor checks
Co-authored-by: Yong He <csyonghe@users.noreply.github.com>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yong He <csyonghe@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial plan
* Fix segfault when using -separate-debug-info with unsupported targets
Add validation to emit a diagnostic error when -separate-debug-info is used
with targets other than SPIR-V binary. Previously, this would cause a segfault
because the separate debug info logic is only implemented for SPIR-V targets.
Changes:
- Added new diagnostic error (ID 18) for unsupported separate debug info usage
- Added validation in OptionsParser::_parse() to check target compatibility
- Created test cases for HLSL and GLSL targets to verify the fix
- Updated error message to clarify only SPIR-V binary targets are supported
The fix prevents segfaults and provides clear feedback to users about
target limitations for the -separate-debug-info option.
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Address feedback: fix segfault properly instead of preventing it
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
| |
* Fix crash when private ctor is used for coercion.
* Fix tests.
* Fix.
* Fix test error.
|
| |
|
|
|
|
|
| |
(#7827)
findFunctionByNameInType was only returning one function when multiple functions existed with the same name but different signatures. This broke reflection functionality for extension methods.
Fix the issue by changing findDeclFromStringInType by not calling maybeResolveOverloadedExpr if checkedTerm is overloaded functions. We still call maybeResolveOverloadedExpr when any candidates in the overloaded list is not DeclRefExpr referencing a function.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
* Fix Conditioanl<T, false> fields with a semantic.
* Add unit test.
* Fix test.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
groups (#7851)
* Fix capability generator to sort capabilities alphabetically within header groups
The slang-capability-generator now sorts capabilities alphabetically by name
within each header group in the generated a3-02-reference-capability-atoms.md
documentation file. This ensures consistent ordering for better readability
and organization.
Fixes #5030
π€ Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: aidanfnv <aidanfnv@users.noreply.github.com>
* Regenerate capability atoms documentation with alphabetical sorting
The capability generator now sorts capabilities alphabetically within
each header group. This commit includes the regenerated documentation
file to demonstrate the alphabetical sorting functionality implemented
in the generator code.
Generated with updated capability generator that sorts capabilities
within groups: Targets, Stages, Versions, Extensions, Compound
Capabilities, and Other.
π€ Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* format code (#7853)
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: aidanfnv <aidanfnv@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
* Add command-line arguments to triangle example
- Add -h/--help flag to show usage information
- Add -api flag to select rendering API (d3d11 < /dev/null | d3d12|vulkan|metal|cpu|cuda|webgpu)
- Platform-specific API availability (D3D on Windows, Metal on macOS)
- Output works for both console and WIN32 applications
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Initial plan
* Fix C-style casts in GLSL pointer cast operations
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
debugging (#7820)
* Initial plan
* Add SLANG_DEBUG_IR_BREAK environment variable support
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Apply code formatting to SLANG_DEBUG_IR_BREAK implementation
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Improve stack trace debugging with -rdynamic flag and backtrace_symbols
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Address PR feedback: use PlatformUtil::getEnvironmentVariable, remove -rdynamic flag, and delete fallback branch
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Address PR feedback: simplify env var parsing, move backtrace to PlatformUtil, use #if for SLANG_LINUX_FAMILY
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Address PR feedback: remove unneeded include, make backtrace() more generic by removing uid parameter
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix and clone source tracking.
* Add python script to dump traces.
* Update instructions.
* Batch calls to addr2line
* Cleanup claude instructions.
* update claude action.
* Remove duplicated build instructions from claude.yml workflow
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* fix build error.
* Fix build errors
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
Co-authored-by: Gangzheng Tong <tonggangzheng@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix D3D12 test failure without Windows Developer mode
Add Windows Developer mode detection for D3D12 experimental features.
D3D12 Agility SDK requires Developer mode when using experimental
features like D3D12ExperimentalShaderModels. Without this check,
device creation fails silently.
Changes:
- Add isWindowsDeveloperModeEnabled() function to check registry
- Add developer mode check before enabling experimental features
- Provide clear error message with instructions to enable Developer mode
- Return SLANG_E_NOT_AVAILABLE to gracefully fail tests
Fixes #6819
Co-authored-by: Gangzheng Tong <gtong-nv@users.noreply.github.com>
* Add more regkey checks to cover the developer mode detections in multile Windows versions
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Gangzheng Tong <gtong-nv@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial plan
* Fix enum array indexing by adding implicit conversion support
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Update enum array indexing test to support GPU backends
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Initial plan
* Add comment support to expected-failure files in slang-test
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial plan
* Fix debug info for let variables
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix parameter count for emitDebugVar function call
Fixed regression where let variable debug info generation was missing the optional argIndex parameter in emitDebugVar call.
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Add location validity check for debug info generation
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Don't insert debug value for nondebuggable types.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add tests for expected behaviour
* Allow matrix types in logical or/and
* Legalize int/bool matrix types and construction with makeMatrix
* Legalize uint matrices and operations
* Limit testing to only SPIRV
* Better tests for int and bool
* Add test for uint
* Remove GLSL tests
* Remove old test for diagnosing int matrices
* Emit SPIRV directly in tests
* format code
* Address PR comments
* Improve testing
* Address PR comments
* format code
* Add tests for matrix intrinsic operations
* Move matrix lowering to dedicated legalization pass
* Fix compiler warning
* Remove signal again
* Reorder matrix and vector legalization
* Fix formatting
* Add shift and comparison tests
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial plan
* Implement out-of-bounds array access checking
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Add tests and format code for array bounds checking
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Move checkForOutOfBoundAccess to separate file and refactor using InstPassBase
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Optimize out-of-bounds checker to use single IR traversal
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix DiagnosticSink forward declaration from struct to class
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Update 0-array-1 test to use runtime indices to avoid bounds checking diagnostic
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Use SV_DispatchThreadID for truly runtime array access in 0-array-1 test
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Initial plan
* Fix GLSL global const diagnostic regression - add test exclusion for GLSL module
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
| |
* Prelink ForceInlined functions during lowering.
* Fixes and cleanups.
* Fix warning.
* Fix crash.
|
| |
|
|
|
|
|
|
| |
specification (#7804)
This change updates ir-instruction-definition.md to reflect changes
to operand specification implemented in PR#7725
Auxiliary change meant for Issue #7185
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This change expands the IR struct definition generation logic in slang-ir.h.lua
to code generate the getters for the operands of an IR.
To facilitate the above, the schema for the IR definitions in slang-ir-insts.lua is updated
to allow for explicit specification of the operands of an IR, with Fiddle code generating
the getters for them.
slang-ir.h is updated to remove the hardcoded getters of the IRs since they are now generated by Fiddle.
Fixes part of #7185
|
| |
|
|
| |
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
| | |
|
| |
|
| |
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
| |
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial plan
* Merge NamePool and RootNamePool into single NamePool class
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Remove unnecessary comment from slang-fiddle-scrape.cpp
Co-authored-by: Theresa Foley <tangent-vector@users.noreply.github.com>
* Address review feedback: initialize namePool to nullptr and remove unnecessary comments
Co-authored-by: Theresa Foley <tangent-vector@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Theresa Foley <tangent-vector@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* option to use riff as serialization backend
* option to use riff as serialization backend
* perf
* shuffle code
* perf improvements to deserialization
* formatting
* remove bit_cast
* correct IR verification
* neaten serialized format
* fix peek module info
* formatting
* remove temporary profiling code
* cleanup
* fix wasm build
* more explicit sizes
* deserialize via fossil on 32 bit wasm
* Make serialized modules Int size agnostic
* reorder stable names to allow range based check for 64 bit constants
* format
* review comments
* fix build
* fix
* c++17 compat slang-common.h
|
| |
|
|
|
|
|
| |
* Improve lookup performance.
* Cleanup.
* Improve autocompletion latency.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix duplicate mangled names for interface requirements
Remove linkage decorations from interface method requirement values to prevent
duplicate mangled names and allow DCE to clean up unused functions.
Interface requirements only need the type information, not the linkage,
so the generated IRFunc with export decorations was causing conflicts.
Fixes #7761
Co-authored-by: Yong He <csyonghe@users.noreply.github.com>
* Move linkage decoration removal into default case of switch
Move the removeLinkageDecorations call into the default case of the
switch statement so it only applies to general requirements and not
special cases like associated types.
Co-authored-by: Yong He <csyonghe@users.noreply.github.com>
* Remove conditional check for linkage decoration removal
Apply removeLinkageDecorations unconditionally to interface requirement values
to ensure all requirement values have their linkage decorations removed.
Co-authored-by: Yong He <csyonghe@users.noreply.github.com>
* Change removeLinkageDecorations parameter type from IRGlobalValueWithCode* to IRInst*
This fixes build errors by allowing the function to accept the broader IRInst* type,
making it compatible with the unconditional call in the interface requirement processing.
Co-authored-by: Yong He <csyonghe@users.noreply.github.com>
* format code (#7787)
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yong He <csyonghe@users.noreply.github.com>
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| | |
|
| | |
|
| |
|
|
|
| |
* Document IR changes
* Remove duplication
|
| |
|
|
|
|
|
| |
* print tool versions for formatter
* formatting
* bump cmake formatter version
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#7728)
* Initial plan
* Fix duplicate DiffPair struct generation for row_major matrices in autodiff
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix matrix layout conversion to use BuiltinCastExpr
Address root cause in slang-check-conversion.cpp by creating proper cast
expressions for matrix layout conversions instead of reusing expressions.
This ensures autodiff sees proper type conversions and generates consistent
DiffPair structs.
Reverted the band-aid fix in autodiff system and implemented the proper
front-end fix as suggested in code review.
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix test to prevent dead code elimination and make it executable on CPU
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix spirv emit of matrix layout cast insts.
* Update test.
* cleanup test.
* Improve test with meaningful values that verify correct gradient computation
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix 1D texture reads in CUDA target
Fixes #7570: 1D surface writes don't work
The issue was that the Load function for read-only textures (hlsl.meta.slang lines 3629-3656)
only supported 2D and 3D textures for CUDA targets, causing 1D texture reads to fall through
to <invalid intrinsic>. This affected the srcTexture[tid.x] read operation in the reproduction case.
Changes:
- Updated static_assert to include SLANG_TEXTURE_1D support
- Added tex1DArrayfetch_int<T> for 1D array texture reads
- Added tex1Dfetch_int<T> for regular 1D texture reads
π€ Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Mukund Keshava <mkeshavaNV@users.noreply.github.com>
* Add 1D texture read support for CUDA target
- Add tex1Dfetch_int template specializations for float2, float4, uint, uint2, uint4
- Remove TODO comment about 1D PTX not being supported
- Enable 1D texture test in texture-subscript-cuda.slang
- Fix assembly code issues in original template specializations
π€ Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Mukund Keshava <mkeshavaNV@users.noreply.github.com>
* Update slang-cuda-prelude.h
* Fix texture3d ptx issue
* undo 1D texture changes
* Update hlsl.meta.slang
* Update hlsl.meta.slang
* Update hlsl.meta.slang
* Update hlsl.meta.slang
* Extend texture-subscript-cuda.slang test with uint and int format variants
Add test cases for newly supported texture formats in CUDA:
- 2D textures with uint, uint2, uint4
- 2D textures with int, int2, int4
- 3D textures with uint, uint2, uint4
- 3D textures with int, int2, int4
This ensures the texture subscript operations work correctly for all
the format variants added in the CUDA texture fixes.
Co-authored-by: Mukund Keshava <mkeshavaNV@users.noreply.github.com>
* update expected file
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mukund Keshava <mkeshavaNV@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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 <csyonghe@users.noreply.github.com>
* 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 <csyonghe@users.noreply.github.com>
* 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 <jkwak-work@users.noreply.github.com>
* 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 <csyonghe@users.noreply.github.com>
* format code (#7765)
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* 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 <ArielG-NV@users.noreply.github.com>
* 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 <ArielG-NV@users.noreply.github.com>
* 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 <csyonghe@users.noreply.github.com>
Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com>
Co-authored-by: Jay Kwak <jkwak-work@users.noreply.github.com>
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: ArielG-NV <ArielG-NV@users.noreply.github.com>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
cleanup/bug-fix (#7754)
* Changes
Fix a coop-vec bug, fix incorrect test synax, clean up test, comment why some coop-vec tests are stil disabled
* Changes
Fix a coop-vec bug, fix incorrect test synax, clean up test, comment why some coop-vec tests are stil disabled
* disable failing tests
* push changes
* add to failing GLSL test list
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix Metal pointer type emission in entry point parameters
Add missing default case in Metal emitter's address space switch to
preserve pointer types. Previously, unrecognized address spaces would
fall through without emitting pointer syntax, causing uint64_t* to
become ulong instead of ulong constant*.
Fixes #7605, #6174
* Treat AddressSpace::UserPointer as Global in Metal
Also adding another test for `uniform` keyword
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#7740)
* Fix GLSL memory layout qualifiers not applied to uniform buffers or cbuffers
The `layout(scalar)` qualifier was being ignored for GLSL `uniform` blocks and
HLSL `cbuffer` declarations, causing them to use std140 layout instead of the
requested scalar layout.
**Root Cause**:
The parsing logic in `slang-parser.cpp` handled layout qualifiers inconsistently:
- GLSL `buffer` blocks correctly used `getLayoutArg()` to map layout modifiers
- GLSL `uniform` blocks and HLSL `cbuffer` skipped layout arguments entirely
**Solution**:
- Enhanced `parseHLSLCBufferDecl()` to check for GLSL layout qualifiers
- Added same `getLayoutArg()` logic used by buffer blocks
- Modified uniform block parsing to pass layout arguments through
**Testing**:
- Added comprehensive test case: `tests/glsl/layout-scalar-qualifier.slang`
- Verified fix works for both `uniform` blocks and `cbuffer` declarations
- Confirmed no regressions in existing test suite
**Before**: `layout(scalar) uniform {...}` β std140 layout (32 bytes, offset 0,16)
**After**: `layout(scalar) uniform {...}` β scalar layout (16 bytes, offset 0,4)
Fixes #7735
π€ Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: pdeayton-nv <pdeayton-nv@users.noreply.github.com>
* Apply code formatting to slang-parser.cpp
Fixed line wrapping, trailing whitespace, and parameter formatting
according to repository style guidelines.
Co-authored-by: Harsh Aggarwal (NVIDIA) <szihs@users.noreply.github.com>
* format code (#7742)
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: pdeayton-nv <pdeayton-nv@users.noreply.github.com>
Co-authored-by: Harsh Aggarwal (NVIDIA) <szihs@users.noreply.github.com>
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial plan
* Fix WGSL sign function to return int type properly
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Add vector version check for WGSL sign function test
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix FileCheck order in WGSL sign test - use DAG for order-independent checking
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
|