| Age | Commit message (Collapse) | Author |
|
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>
|
|
Full set of mutually exclusive choices for upgrading LLVM:
- #8031 (you are here)
- #8035
- #8036
- #8034
- #8038
- #8039
- #8033
Alternative to #8028. Required some minor changes due to these upstream
commits:
- llvm/llvm-project@e463b69736da8b0a950ecd937cf990401bdfcdeb
- llvm/llvm-project@89b57061f7b769e9ea9bf6ed686e284f3e55affe
|
|
This commit adds a new command-line argument for
`docs/script/release-note.sh`, which is `--previous-release-hash`.
It will allow us to generate the release note at more finer granularity.
The current help message is following,
```
Usage: ./docs/scripts/release-note.sh [--since DATE | --previous-release-hash HASH]
--since DATE Generate notes since the given date (e.g., 2025-08-06)
--previous-release-hash HASH Generate notes since the given commit hash
Legacy usage (deprecated): ./docs/scripts/release-note.sh DATE
```
Fixes
- https://github.com/shader-slang/slang/issues/5188
- https://github.com/shader-slang/slang/issues/6887
---------
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
|
* Implement SPV_EXT_fragment_invocation_density
-Adds semantics SV_FragSize and SV_FragInvocationCount and implements them for SPIRV and GLSL using the appropriate target builtins from extensions.
-Adds test case checking for expected target builtins from these semantics.
-For future work, could implement SV_FragSize using pixel shader input SV_ShadingRate for HLSL, and SV_FragInvocationCount needs research.
Fixes #7974
Generated with Claude Code
* address review feedback
https://github.com/shader-slang/slang/pull/8037#pullrequestreview-3084645845
* fixup format
* review feedback
https://github.com/shader-slang/slang/pull/8037#pullrequestreview-3086442819
|
|
* Clarify downstream and direct compilation paths in design overview doc
* Fix typo, add more examples
|
|
* Omit "Invalid" capability from slangc -h output
* format code (#23)
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
---------
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
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
|
|
* Fix broken links in User Guide
* Fix link text with filename, use title
|
|
* Fix metallib-asm target parsing by adding missing comma
The metallib-asm target was not being recognized from command line because
of a syntax error in the target string definition in slang-type-text-util.cpp.
A missing comma after the first "metallib-asm" string caused C++ string
literal concatenation to create a malformed string.
Resolves #7774
Co-authored-by: Jay Kwak <jkwak-work@users.noreply.github.com>
* format code (#7910)
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* regenerate command line reference (#7911)
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
---------
Co-authored-by: Claude Code <claude@anthropic.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>
|
|
* Document how to use LLDB in the Slang codebase
* Include `slang_lldb.py` in `.lldbinit`
* Switch from GCC to Clang
* Include a VS Code task to build before debugging
* Fix clangd
|
|
The release note script was trying to retrieve additional label
information from the "issue" but when parsing logic is not reliable.
When the issue has a link to a repo other than Slang, it printed error
message. An example is #7826 that has a link to an external repo,
https://github.com/llvm/llvm-project/issues/79043
|
|
|
|
* 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>
|
|
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>
|
|
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
|
|
|
|
* Document IR changes
* Remove duplication
|
|
|
|
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
|
|
|
* stable names
* tests, options and ci for stable names
* Add back compat design document
* fix warnings
* formatting
* comment
* neaten
* regenerate command line reference
* consolidate ci scripts
* faster ci
* remove libreadline
* Move new function to end of interface
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
* Add category list at end of slangc -h output
* Use value category for categories
* format code (#12)
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Regenerate cmdline reference
---------
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
* alias amplification shader as task shader and add mesh shader profile
* add task shader stage alias to capabilities
* regenerate command line reference
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
* Add fkYAML submodule
* Generate slang-ir-inst-defs.h from slang-ir-inst-defs.yaml
* generate ir-inst-defs.h
* neaten things
* neaten inst def parser
* add rapidyaml submodule
* remove fkyaml
* remove fkyaml submodule
* remove use of ir-inst-defs.h
* format and warnings
* fix wasm build
* tidy
* remove rapidyaml
* Extend fiddle to allow custom splices in more places
* Use lua to describe ir insts
* fix
* neaten
* neaten
* neaten
* spelling
* neaten
* comment comment out assert
* merge
|
|
* Implement -fp-denorm-mode slangc arg
* Split fp-denorm-mode into 3 args for fp16/32/64
* Remove redundant option categories
* Use emitInst for multiple of the same OpExecutionMode
* Fix formatting
* Remove -denorm any
* Re-add option categories
* emitinst for ftz
* Use enums for type text
* Remove extra categories again
* Add tests for denorm mode
* Move denorm mode to post linking
* format code (#8)
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* regenerate command line reference (#9)
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Clean up tests
* Fix option text
* format code (#10)
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Add tests for "any" mode
* Return "any" enum if option not set
* Simplify emission logic
* Add support for generic entrypoints
* Move denorm modes to end of CompilerOptionName enum
* format code (#11)
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Move new enum members to before CountOf
* Add not checks to tests, fix generic test, add functionality tests
* Rename denorm to fpDenormal
* Clean up functional test
* Rename denorm test dir
* Fix formatting, regenerate cmdline ref
* Fold simple tests into functional tests, add more dxil checks
* Remove no-op DX tests, make tests more consistent
* Disable VK functionality tests that will fail on the CI configs
* Fix formatting
* Add comments to disabled tests explaining why
---------
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
* Remove some cruft/complexity from IR serialization
This is a very simple cleanup to unnecessary code paths and remove some flexibility that isn't actually needed, to hopefully simplify the task of more completely overhauling the approach to IR serialization in a later change.
The concrete feature that gets removed here is a debug-only feature (which thus shouldn't be affecting any users of Slang) that was added long ago in the life of the compiler as we were working to truly separate the front- and back-ends.
At the time there was a lot of code in the compiler back-end that still made use of AST-level data structures, and thus got in the way of our goal to support separate compilation and linking (such that final code generation can only depend on the IR, and not the AST).
The option was used to cause the Slang IR to be serialized out and then read back in as part of compilation, to try and enforce that only the wanted constructs could pass through that bottleneck.
The idea was only ever half implemented, however, because it made use of a secondary implementation path in IR serialization that supported serializing the "raw" source locations (which are heavily dependent on AST-level information, even down to the number of bytes in source files).
This change removes the feature entirely, since it is no longer useful for its intended purpose, and its presence causes there to be entire second code path for source locations in IR serialization that would need to have test coverage if we wanted to be sure it kept working.
In addition, our pre-existing infrastructure for module serialization had various options that have either stopped being useful, or were not really useful at the time they were introduced.
For example: there are no places in the code today where we attempt to serialize out a module without including both the serialized AST and IR.
If that was a feature that we ever supported, the relevant code got removed at some preceding point without breaking any of our tests or (seemingly) upsetting users.
Similarly, the options being passed into writing of a serialized module included both a flag to control whether source locations should be serialized *and* a pointer to the `SourceManager` to use in that case... but it was only ever meaningful to set both, or neither.
The option has been changed to just be the `SourceManager` pointer, and the name has been updated to reflect its very narrow intended use case.
* format code
* fixup
* regenerate command line reference
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Reset minimum cmake version to 3.22
* update slang-rhi
|
|
* Support DeviceIndex
* format code
* regenerate command line reference
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
* 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>
|
|
* Move separate-debug-info arg to target options
The separate-debug-info command line option is listed under debugging
options, move this to the target options section which includes other
similar flags like -g and -emit-spirv-directly.
* regenerate command line reference
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
* Document supported compiler versions in building.md
Closes https://github.com/shader-slang/slang/issues/7376
* multiple checked versions
|
|
Compiler word was missing after C/C++ in CPU target documentation. Thank you in advance!
|
|
Closes #6817
This change deletes the GFX User Guide, as GFX is being deprecated. It also removes the rebuild of its TOC from the TOC rebuilding scripts and replaces the link to the guide in the README with a note that it is being deprecated in favor of slang-rhi.
Co-authored-by: Gangzheng Tong <tonggangzheng@gmail.com>
|
|
* Require `override` keyword for overriding default interface methods.
* Update doc.
* Fix test.
|
|
|
|
* Add new capdef for lss intrinsics
Fixes #7426
Raygen shaders need to be supported for only hitobject APIs. So we need
a special capability for that, instead of a common one.
* regenerate command line reference
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
* Better handling for 16-byte boundary of d3d cbuffer
Fixes #6921
D3D cbuffers have slightly different packing rules that allow packing
vectors into a 16-byte slot at element alignments, except when
a field would cross a 16-byte boundary. In that case, we need to
realign the field to the next 16-byte boundary.
In particular, this impacts vec3s, which are not a power of two in
size and thus require slightly different alignment logic, compared to
std430 and std140. (Example: a float and float3 should fit together in
that order in a single slot.)
Adds test cases.
Adds documentation page for GLSL target
|
|
* WiP: Add coopvec support for Optix
* format code
* fix minor issues
* Fix review comments
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
* Add command line option for separate debug info
Add command line arg -separate-debug-info which, if provided, produces
both a .spv and a .dbg.spv file. The .dbg.spv file contains full debug
info and the .spv file has all debug info stripped out.
Also add a DebugBuildIdentifier instruction to store a unique hash in
both the output files, so they can be more easily matched together.
A matching API is provided to allow using the Slang API to retrieve a
base and debug SPIRV as well as the debug build identifier string.
|
|
* Disable Link-Time-Optimization by default
LTO was requested for the release package a while ago.
When we added it, LTO was enabled by default although it was needed only for
the release packages.
Later we found that the Release build cannot be incrementally recompiled
when LTO is enabled. It sometimes works fine, but it required full recompilation
when it doesn't work. We added a new CMake option, `SLANG_ENABLE_RELEASE_LTO`,
to disable it for developers. But many Slang developers don't know the
option exists.
I was going to update the document, CONTRIBUTING.md, but I thought it
will be better to change the default behavior.
* Fix a compiler warning treated as an error on linux
A padding variable was uninitialized, which is fine, but the compiler
was complaining about it.
* Fix other gcc error for uninitialized variable
* Fix more compile warning treated as error
* Fix compiler warning from gcc 11
It appears that this is a valid warning that the `delete this` is done
on an offset 8 when the class uses multiple inheritance.
The compiler warning is following:
```
In file included from /home/runner/work/slang/slang/source/core/slang-memory-file-system.h:5,
from /home/runner/work/slang/slang/tools/slang-unit-test/unit-test-module-ptr.cpp:3:
In destructor ‘virtual Slang::ComBaseObject::~ComBaseObject()’,
inlined from ‘uint32_t Slang::ComBaseObject::_releaseImpl()’ at /home/runner/work/slang/slang/source/core/slang-com-object.h:49:16,
inlined from ‘virtual uint32_t Slang::MemoryFileSystem::release()’ at /home/runner/work/slang/slang/source/core/slang-memory-file-system.h:34:5:
/home/runner/work/slang/slang/source/core/slang-com-object.h:33:31: error: ‘void operator delete(void*, std::size_t)’ called on pointer ‘<unknown>’ with nonzero offset 8 [-Werror=free-nonheap-object]
33 | virtual ~ComBaseObject() {}
| ^
In destructor ‘virtual Slang::ComBaseObject::~ComBaseObject()’,
inlined from ‘uint32_t Slang::ComBaseObject::_releaseImpl()’ at /home/runner/work/slang/slang/source/core/slang-com-object.h:49:16,
inlined from ‘virtual uint32_t Slang::MemoryFileSystem::release()’ at /home/runner/work/slang/slang/source/core/slang-memory-file-system.h:34:5,
inlined from ‘Slang::ComPtr<T>::~ComPtr() [with T = ISlangMutableFileSystem]’ at /home/runner/work/slang/slang/include/slang-com-ptr.h:113:34,
inlined from ‘void _modulePtr_impl(UnitTestContext*)’ at /home/runner/work/slang/slang/tools/slang-unit-test/unit-test-module-ptr.cpp:92:1:
/home/runner/work/slang/slang/source/core/slang-com-object.h:33:31: error: ‘void operator delete(void*, std::size_t)’ called on pointer ‘<unknown>’ with nonzero offset 8 [-Werror=free-nonheap-object]
33 | virtual ~ComBaseObject() {}
| ^
/home/runner/work/slang/slang/tools/slang-unit-test/unit-test-module-ptr.cpp: In function ‘void _modulePtr_impl(UnitTestContext*)’:
/home/runner/work/slang/slang/tools/slang-unit-test/unit-test-module-ptr.cpp:36:69: note: returned from ‘void* operator new(std::size_t)’
36 | ComPtr<ISlangMutableFileSystem>(new Slang::MemoryFileSystem());
| ^
```
The problem is on the fact that `ComBaseObject` is not the first in the
multiple inheritance:
```
class MemoryFileSystem : public ISlangMutableFileSystem, public ComBaseObject
{
public:
// ISlangUnknown
SLANG_COM_BASE_IUNKNOWN_ALL
```
It should be:
```
class MemoryFileSystem : public ComBaseObject, public ISlangMutableFileSystem
```
The chain of ComObject release is little complicated and it is easy to
make a mistake. Here is summary with details,
1. `release()` is declared as a pure-virtual in ISlangUnknown, which is
one of the base classes of `ISlangMutableFileSystem`.
```
struct ISlangUnknown
{
virtual SLANG_NO_THROW uint32_t SLANG_MCALL release() = 0;
```
2. `release()` is implemented with the macro
`SLANG_COM_BASE_IUNKNOWN_RELEASE`.
```
SLANG_NO_THROW uint32_t SLANG_MCALL release() SLANG_OVERRIDE \
{ \
return _releaseImpl(); \
}
inline uint32_t ComBaseObject::_releaseImpl()
{
// Check there is a ref count to avoid underflow
SLANG_ASSERT(m_refCount != 0);
const uint32_t count = --m_refCount;
if (count == 0)
{
delete this;
}
return count;
}
```
3. The instance of `MemoryFileSystem` is handled by ComPtr. And
`ComPtr::~ComPtr()` calls the `release()`.
```
ComPtr<ISlangMutableFileSystem> memoryFileSystem =
ComPtr<ISlangMutableFileSystem>(new Slang::MemoryFileSystem());
SLANG_FORCE_INLINE ~ComPtr()
{
if (m_ptr)
((Ptr)m_ptr)->release();
}
```
4. When `delete this` is called, because ComBaseObject is not the first
in the multiple inheritance, `this` is 8 byte off from the actual
instance address.
A fix for this is to change the order of the inheritance and make
ComBaseObject to be the first in the order.
|
|
|
|
* 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>
|
|
1. "here, $$f$$ here has" => "here, $$f$$ has"
2. $f$ ==> $$f$$
* $f$ does not render on website, works on vscode
|
|
The files `slang-fossil.{h,cpp}` define a new serialization format that is designed to support data being memory-mapped in and then traversed as-is.
The `docs/design/serialization.md` document was updated with details on this new format.
The `slang-serialize-fossil.{h,cpp}` files define implementations of the recently introduced `ISerializerImpl` interface for reading/writing this new binary format.
The overall structure of these implementations is heavily based on the existing RIFF implementation from `slang-serialize-riff.{h,cpp}`.
Switching the AST serialization over to use this format required almost no changes to `slang-serialize-ast.cpp`.
The new format is more space-efficient than the RIFF-based format in memory (by factor of over 2x), but is actually *worse* than the RIFF-based format in terms of how it affects the size of `slang.dll`, because the new format is seemingly less amenable to LZ4 compression.
A few pieces of utility code were added or moved as part of this work:
* The `core/slang-internally-linked-list.*` implementation is just a type that was used as part of `core/slang-riff.*`, but that wasn't really RIFF-specific.
* The `core/slang-blob-builder.*` files implement a low-level utility for building a binary format in memory out of "chunks". The overall structure of this type is based on the RIFF-specific builder implementation, but has been generalized so that it should apply to other kinds of binary serialization.
* The `core/slang-relative-ptr.h` file implements a simple relative pointer type, which is currently only used by the `slang-fossil.h` format.
If there are concerns about adopting the new format immediately for the AST, this change could be modified to introduce all the new code, but leave the AST serialization using the previous RIFF-based format.
|
|
* Language version + tuple syntax.
* Fix compile error.
* regenerate documentation Table of Contents
* Fix.
* regenerate command line reference
* Fix.
* Fix.
* Fix more test failures.
* revert empty line change,
* Retrigger CI
* #version->#lang
* Update source/core/slang-type-text-util.cpp
Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com>
* Remove comments.
* Fix parsing logic.
* Fix parser.
* Fix parser.
* update test comment
* Update options.
* regenerate documentation Table of Contents
* regenerate command line reference
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com>
|
|
github pages reqire new-line to render table correctly.
Grammer problem.
|
|
* change default descriptor binding to be VkMutable
|
|
* WiP: LSS intrinsics: initial commit
* format code
* Fix CI failures
* Address review comment
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
* Properly implement WaveMask* variants of WaveMultiPrefix* intrinsics
* More partitioned intrinsics
* More partitioned intrinsics and cleaned up non-prefixed WaveMask* implementations
* Refactor HLSL WaveMultiPrefix* implementations
* fix cap atoms
* Clean up implementation
* Add GLSL intrinsics and cleanup
* Add tests
* Fix affected capability test
* Update and fix tests
* Move expected.txt file
* Refactor WaveMask* to call WaveMulti*
* Refactor SPIRV/GLSL preamble code
* Enable emit-via-glsl tests
* remove wave_multi_prefix capability in favor of subgroup_partitioned
* Update docs
* Update cap atoms doc
|