| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
| |
There was a bug that causes the compiler failing to treat a `no_diff
TypePack` as a type pack, and thus diagnose an error when resolving the
following call.
The fix is to unwrap any ModifiedType wrappers in `IsTypePack()` check.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Several tests have compute entry points without a `[numthreads(x,y,z)]`
decoration. Currently, none of these tests run on the CPU target, as
they crash the compiler. I took a look at the SPIR-V emitter, which
falls back to a workgroup size of (1,1,1):
https://github.com/shader-slang/slang/blob/1e0908bd7107dfbdac912b693c3ab9bd6e1dc8b3/source/slang/slang-ir-spirv-legalize.cpp#L1635-L1643
To match this behaviour, this PR implements a fallback solution that
makes `emitCalcGroupExtents()` emit (1,1,1).
This PR is both a question and a suggestion; I'm not sure the approach
here is at all reasonable. Personally, I'd just like to explicitly add
`[numthreads(1,1,1)]` to all such tests, but I don't know if it's
actually legal and supported to not have a `numthreads`. So the
implementation here is a bit conservative.
I ran across these when I went through tests for the upcoming LLVM
target. These were the final blockers to get all autodiff and
language-features tests passing (not counting the ones using things like
wave intrinsics and barriers etc.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
`Optional<T>`. (#8677)
Closes #8673.
The issue is that we use the RTTI field of an existential to check if it
is null. We have the logic to help the user to fill in a non-zero value
for the RTTI field when such an object is filled from the host. However,
when there is slang code creating an existential value, we still have
old logic in the compiler that just fills in 0 for the RTTI field,
causing an `Optional<IFoo>.hasValue` to always return false in such
cases.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes: https://github.com/shader-slang/slang/issues/7634
Duplicate of PR https://github.com/shader-slang/slang/pull/8052
Primary Changes:
* Added `storeCoherent` and `loadCoherent` for coherent load/store via
pointers. This is backed by `IRMemoryScopeAttr` which is an `IRAttr`
attached to `IRLoad` and `IRStore`
* Logic in `source\slang\slang-emit-spirv.cpp` for load/store emitting
has been reworked to be less messy and more maintainable
* Add to `hlsl.meta.slang` coop vector and coop matrix coherent
load/store operations
Secondary Changes:
* Added a missing load/store test for coop matrix:
`tests\cooperative-matrix\load-store-pointer.slang`
---------
Co-authored-by: ArielG-NV <aglasroth@nvidia.com>
Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Nathan V. Morrical <natemorrical@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The varying param legalization pass didn't deal with this 1D form of
SV_DispatchThreadID for CPU targets:
```slang
void computeMain(int i : SV_DispatchThreadID)
```
Instead, it just overrode the type of `i` with a `uint3`, breaking lots
of code that attempted to use `i` for something, like a `switch`
statement for example.
I ran across this when going through `language-feature` tests for the
LLVM target, which will also use this legalization pass. I'm separately
submitting this now because this also fixes the existing CPU target. The
test I enable in this PR is one that was previously generating broken
code on CPU.
(somewhat related issue: #7468)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#8603)
This change achieves link-time type resolution with a different
mechanism.
For `extern struct Foo : IFoo = FooImpl;`,
instead of synthesizing a wrapper type `Foo` that has a `FooImpl inner`
field and dispatches all interface method calls to `inner.method()`,
this PR completely removes this synthesis step, and instead just lower
such `extern`/`export` types as `IRSymbolAlias` instructions that is
just a reference to the type being wrapped.
Then we extend the linker logic to clone the referenced symbol instead
of the SymbolAlias insts itself during linking.
By doing so, we greatly simply the logic need to support link-time
types, and achieves higher robustness by not having to deal with many
AST synthesis scenarios.
Closes #8554.
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ByteAddressBuffer with DescriptorHandle (#8252)
- [x] Fix segmentation fault in wrapConstantBufferElement for
DescriptorHandle types
- [x] Split DescriptorKind.Buffer into ConstantBuffer and StorageBuffer
- [x] Update binding enums with descriptive names (ConstantBuffer_Read,
StorageBuffer_Read, etc.)
- [x] Update resource type mappings for correct binding assignments
- [x] Update template logic to handle ConstantBuffer and StorageBuffer
kinds separately
- [x] Update tests to reflect correct binding assignments
- [x] Split DescriptorKind.TexelBuffer into UniformTexelBuffer and
StorageTexelBuffer
- [x] Update TextureBuffer<T> to use UniformTexelBuffer kind
- [x] Update _Texture extension to determine texel buffer kind based on
access mode
- [x] Update test desc-handle-1.slang to handle new DescriptorKind enum
cases
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/shader-slang/slang/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
|
|
|
|
| |
legalization pass. (#8567)
This is crash that be triggered by providing custom
`getDescriptorFromHandle` and use it to return access a
ByteAddressBuffer from a bindless handle.
Closes #8355.
|
| |
|
|
|
|
|
|
|
|
| |
Fixes #8439
When checked, generic type equality constraints types are now in a
canonical order, allowing for a commutative type equality operator.
---------
Co-authored-by: Mukund Keshava <mkeshava@nvidia.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Treat DescriptorHandle as uint64_t instead of uint2. Implement
target-specific SPIR-V emission with the bindless texture support.
For OpImageTexelPointer, Image must have a type of OpTypePointer with
Type OpTypeImage. Fix the issue by using [constref] in __subscript.
Add a test coverage for various texture/sampler handle types.
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| |
|
|
| |
Related to
- https://github.com/shader-slang/slang/issues/8519
|
| |
|
|
|
|
|
|
|
| |
Changes default for render-test to sm_6_5.
Since sm_6_5 is the new default, remove the -use-dxil option, add
-use-dxcb option
Remove -use-dxil option from all test cases.
Add -use-dxcb to two tests that needed it.
Fixes #7611
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Resolves #7628
Resolves: #8197
Primary Goals:
1. Add `Access` to pointer
2. AddressSpace::GroupShared support for pointers (SPIR-V)
3. Add `__getAddress()` to replace `&`
* `&` is not updated to `require(cpu)` since slangpy uses `&`. This
means we must: (1) merge PR; (2) replace `&` with `__getAddress()`; (3)
add `require(cpu)` to `&`
Changes:
* Added to `Ptr` the `Access` generic argument & logic (for
`Access::Read`).
* Moved the generic argument `AddressSpace` from `Ptr` to the end of the
type.
* Added pointer casting support between any `Ptr` as long as the
`AddressSpace` is the same
* Disallow globallycoherent T* and coherent T*
* Disallow const T*, T const*, and const T*
* Fixed .natvis display of `ConstantValue` `ValOperandNode`
* Support generic resolution of type-casted integers
* Added `VariablePointer` emitting for spirv + other minor logic needed
for groupshared pointers
Breaking Changes:
* Anyone using the `AddressSpace` of `Ptr` will now have to account for
the `Access` argument
* we disallow various syntax paired with `Ptr` and `T*`
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AST-parent has target+set the AST-child does not (#8175)
Fixes: #8174
Changes:
* To determine if we propagate capabilities, we need to ensure that a
`join` will do nothing (optimization since `join` is expensive + caching
data for the `join` adds up to be expensive). This logic was changed in
`slang-check-decl.cpp` since the current logic was incorrect.
* A parent could have the set `metal+glsl` and the use-site could have
`glsl`. In this case, we will not remove `metal` from the parent since
`{metal+glsl}.implies({glsl})` is true.
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes: #7410
Changes:
1. super-type capabilities must be a super-set of sub-type capabilities
(and support the same shader stages/targets)
* InheritanceDecl visits super-type to inherit it's capabilities;
validate InheritanceDecl capabilities against sub-type
* visit all container decl's with a default case
* clean up functionDeclBase visitor
* Simplify `diagnoseUndeclaredCapability` by moving logic into
capability checking (more correct*)
3. added changed behavior to documentation
4. fixed some incorrect capabilities
5. **we do not** diagnose capability errors on interface
requirement-to-implementation if both lack explicit capability
requirements. This change is to work around a slangpy regression (test
case for the failing situation is in
`tests\language-feature\capability\capability-interface-extension-1.slang`),
Note: maybe for slang-2026 we don't do this?
6. requirement & implementation must support the same shader
stage/target. This was changed because otherwise we can have cases where
`X` inherits from `Y`, but `Y` is only expected to be used in `glsl`
whilst `X` is expected to be used in `hlsl | glsl`
7. removed
`tests/language-feature/capability/capabilitySimplification3.slang`
because it tests nothing special (redundant)
Note: not using rebase due to separate branches depending on this PR
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
Closes #8061.
Along with the fix, also enhanced coercion/overload resolution to filter
candidates based on the target type, allowing
`tests\language-feature\higher-order-functions\overloaded.slang` to
pass.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #7574
Changes:
* Add an initial (fairly simple) optimization pass which is able to
eliminate redundant copies.
* Our current existing optimizer passes remove redundant load/store very
robustly, this pass will focus on other cases of copy elimination
* Primary approach is to make all functions which are `in T` and `T` is
trivial to copy into a `__constref T`. We then (depending on scenario)
manually insert a variable+load if a pass-by-reference is not possible;
otherwise we pass by `constref`.
* Added optimizations to eliminate redundant code which causes
`constref` to fail to compile
---------
Co-authored-by: Harsh Aggarwal <haaggarwal@nvidia.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>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
close #7931.
For a generic callable, we have two passes overload resolution, in first pass, we will resolve
the generic by only checking the generic parameters, while in the second pass, we will resolve
the function signature to resolve the overload.
But in our candidate comparison logic, we pick a preferred generic even two generics are equally
good. However, we should not make this decision in the first pass, because we don't know about
the function arguments in this pass yet. So we just return OverloadEpxr2 in this case, and let the
function overload resolution to break the tie.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix bug
* fix test
* push test changs for clarity
* fix bug
* fix test
* push test changs for clarity
* test what fails
* remove redundant code
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add matrix select intrinsic
* Fix hlsl test
* Restrict matrix select to HLSL
* Better test for HLSL side
* Select route for GLSL/SPIRV
* Exclude matrices from select legalization
* Exclude CUDA from select test
* Inline and move
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| |
|
|
|
|
| |
Closes https://github.com/shader-slang/slang/issues/3646
New tests rather than just adding another TEST line to existing tests so
that we get the msvc- prefix in the output of slang-test
|
| |
|
|
|
|
|
|
|
| |
* emit literal values in getTypeNameHint for bool, str etc.
* add test for specializing generics with bool literals
* fix build error
* add specializing with Enum type test
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Avoid early specialization for witness tables in SimplifyIR
Prevents SimplifyIR from prematurely specializing witness tables before
the main specialization pass. Witness tables are hoistable immutable
objects that must maintain consistent signatures to avoid incorrect
deduplication. SimplifyIR was incorrectly transforming expressions like
"witness_table_t(%IFoo)(specialize(%7, %GenericValue4))" into
"witness_table_t(%IFoo)(%Foo)" even when %GenericValue4 was unused.
Fixes #7233
* Add a missing test file
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial plan
* Add improved diagnostic for interface return type mismatches
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Complete fix for interface return type mismatch error reporting
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Move diagnostic to synthesis phase for better interface return type mismatch errors
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Remove extraneous test file and update .gitignore
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Add diagnostic test for interface return type mismatch and apply formatting
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Address feedback: restore whitespace and use filecheck for diagnostic test
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix logic error in return type mismatch detection
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Remove unnecessary flag by using out parameter for diagnostic tracking
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Refactor witness synthesis failure reporting to use structured approach
Replace ad-hoc `outSpecificDiagnosticEmitted` parameter with `WitnessSynthesisFailureReason` enum and `MethodWitnessSynthesisFailureDetails` struct as requested in code review. This provides:
- Clear taxonomy of failure reasons (General, MethodResultTypeMismatch, MethodParameterMismatch)
- Centralized diagnostic emission in findWitnessForInterfaceRequirement
- Better extensibility for future failure types
- Improved maintainability by removing state tracking flags
The return type mismatch diagnostic continues to work correctly, showing error 38106 with precise location information.
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Remove unused MethodParameterMismatch enum and duplicate code
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Remove redundant requiredMethod field from MethodWitnessSynthesisFailureDetails
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Address feedback: add outFailureDetails guard and remove unnecessary hasReturnTypeError variable
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix regression: restore original diagnostic message for mutating method mismatch
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix.
* Fix.
* Remove `innerSink`.
* Print candidates considered for interface match upon error.
* Fix tests.
---------
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>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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 Conditioanl<T, false> fields with a semantic.
* Add unit test.
* Fix test.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
* 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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
* Implement enum-based KnownBuiltin system to replace string comparisons
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Add test for enum-based KnownBuiltin system and verify functionality
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Implement enum-based KnownBuiltin system with direct integer values
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix IntVal access and update tests for new enum-based KnownBuiltin system
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Replace hardcoded KnownBuiltin integers with preprocessor enum syntax
- Updated all KnownBuiltin attributes to use $( (int)KnownBuiltinDeclName::EnumValue) syntax
- Added space between parentheses to avoid preprocessor bug: $( (int) instead of $((int)
- Updated both core.meta.slang and hlsl.meta.slang files
- Eliminates preprocessor-time integer conversion, baking enum values directly into meta files
- Maintains same functionality while using type-safe enum references
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix IDifferentiablePtr KnownBuiltin mapping regression
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Remove unused IDifferentiablePtrType enum case from KnownBuiltinDeclName
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Clean up temporary AST dump files from testing
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Replace hardcoded integer with descriptive constant in KnownBuiltin test
Replace the hardcoded [KnownBuiltin(0)] with a descriptive named constant
GEOMETRY_STREAM_APPEND_BUILTIN to improve code readability and maintainability.
The test now clearly indicates which builtin enum value is being tested.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Gangzheng Tong <gtong-nv@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: Gangzheng Tong <gtong-nv@users.noreply.github.com>
Co-authored-by: Gangzheng Tong <tonggangzheng@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial plan
* Fix unnecessary Int64 SPIRV capability usage in pointer marshalling
Replace uint64-based pointer marshalling with uint2-based approach to avoid requiring Int64 capability in SPIRV output. This affects both basic type marshalling and resource handle marshalling for pointer types.
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Replace test cases with user-provided test case
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix test case to avoid unrelated pointer casting operations that require Int64
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Ensure generic constraints are checked before inner extension.
* Add warning for non-standard generic extension.
* Fix tests.
* Fix test.
* Ban interface types from equality constraints.
* Fix.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
constraints (#7578)
* fix problem
* cleanup comment
* format code
* make change more restrictive
* format code
* push logic update
* format code
* push test fix
* make test more general
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
| |
* WIP opaque type decoration fix
* Clearer intent
* Formatting
* Added test for fix
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add MLP training examples.
* Formatting fix.
* Fix.
* Improve documentation on coopvector.
* Improve doc.
* Update doc.
* Fix typo.
* Cleanup shader.
* Cleanup.
* Fix test.
* Fix type check recursion.
* Fix.
* Fix.
* Fix override check.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Parse optional witness syntax
* Allow failing optional constraint
* Make `is` work with optional constraint
* Allow using optional constraint in checked if statements
* Fix tests
* Make it work with structs
* Fix MSVC build error
* Disallow using `as` with optional constraints
* Update test to match split is/as errors
* Add tests
* Fix uninitialized variables in tests
* Add tests of incorrect uses & fix related bugs
* Mention optional constraints in docs
* format code
* Fix type unification with NoneWitness
* Fix formatting
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Nathan V. Morrical <natemorrical@gmail.com>
|
| |
|
|
|
|
|
| |
* Require `override` keyword for overriding default interface methods.
* Update doc.
* Fix test.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Diagnose on use of struct inheritance.
* fix test.
* Fix tests.
* fix.
---------
Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com>
|
| |
|
|
|
| |
This PR replaces enable/disable style C function calls with C++ RAII style code.
In debug build, when an assertion failed in between enable and disable functions, an exception is thrown and the disable function is not called. RAII style code is safer for an exception
|
| |
|
|
|
| |
* Fix an issue in extension override.
* Fix typo in comment.
|
| |
|
|
|
| |
Added error checking to reject interface types as the right-hand side
of is and as operators. Enhanced semantic analysis with new diagnostic
30301 and comprehensive test coverage.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add legalization for 0-sized arrays.
* Allow 0-sized arrays in the front-end.
* More tests.
* Add `Conditional<T, hasValue>` type to core module.
* Update toc.
* Fix wording.
* Update test.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Make interface types non c-style.
* Make Optional<T> work with autodiff and existential types.
* Fix.
* patch behind slang 2026.
* Fix warnings.
* cleanup.
* Fix tests.
* Fix.
* Fix com interface lowering.
* Add comment to test.
* regenerate command line reference
* Add test for passing `none` to autodiff function.
* Fix recording of `getDynamicObjectRTTIBytes`.
* Fix nested Optional types.
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add check for the variable requirement
This change adds the capability check for the variables requirement.
With this check, the shader
```
[require(cpp_cuda_glsl_hlsl_metal_spirv)]
Buffer<float> InputTyped;
[require(cpp_cuda_glsl_hlsl_metal_spirv)]
RWBuffer<float> OutputTyped;
```
will issue error if targeting to WSGL
e.g. `.\build\Debug\bin\slangc .\tests\wgsl_no_buffer.slang -o
wgsl_no_buffer.txt -target wgsl -entry Main -stage compute`
.\tests\wgsl_no_buffer.slang(2): error 36108: 'InputTyped' has dependencies that are not compatible on the required target 'wgsl'.
Buffer<float> InputTyped;
^~~~~~~~~~
.\tests\wgsl_no_buffer.slang(4): error 36108: 'OutputTyped' has dependencies that are not compatible on the required target 'wgsl'.
RWBuffer<float> OutputTyped;
^~~~~~~~~~~
Fixes #6304
* Add var capability tests
* Do capability checks for global var only
* Add inferredCapabilityRequirements to var capability check
* Add requirement to the intrinsic types Buffer/RWBuffer
* format code
* Update capabliity test
* use DefaultDataLayout as default data layout
* Use visitMemberExpr to check the capabilities
* Update the cap tests to match the error messages
* update test to use the ScalarDataLayout for hlsl target
* Update tests check condition to use error number only
* Add default push_constant data layout type
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|