| Commit message (Collapse) | Author | Age |
| ... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* WiP: Add more formats for texture reads
* fix test
* format code
* add float2/float4 versions for 1D and 3D as well
* fixed review comment
* fix review comments
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix using local constants in switch cases
* Add test
* format code
* Always lower switch cases with exprVal
* Fix formatting
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
| | |
|
| |
|
|
|
|
|
| |
* Fix unsigned to signed casts for SPIRV
* Add test
* Fix ICE crash
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Define a bit size for the intptr types
* Fix intptr_t sign
* Extend intptr test to check for previously broken operations
* Fix intptr vector test on CUDA
* Handle intptr size in getAnyValueSize
* Fix formatting
* Try with __ARM_ARCH_ISA_64
* On macs, int64_t != intptr_t
Yikes
* Move define to prelude header
* Also check apple in host-prelude
* Fix define location
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Fixed name mangling of generic extensions
* Added tests for generic extensions linking.
- Disabled bugs/gh-6331.slang since it now triggers an assertion error revealed by the new version of the mangler.
* Re-enabled test gh-6331 (fixed by a5efbb1b775afb2f6b29b37d39947c41744bb005)
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
|
|
| |
bitcast requires the input has same width with result type, this PR ensures that we always lower the bitcast IR instruction satisfies this requirement.
Close #7017.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Output default parameter values on language server hover
Closes https://github.com/shader-slang/slang/issues/5782
* Add parens around binay expressions in ast print
* More cases in ast print test
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
* Parse char literals as integers
* Fix formatting
* Parse escaped chars correctly
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
* Add interger pack/unpack intrinsic to glsl
Add unpack8, unpack16 and pack32 intrinsics to glsl.
* add unit test
* fix lowering logic for 'bitcast'
* format
|
| |
|
| |
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
|
|
|
| |
Change adds 16-bit and 8-bit support for countbits intrinsic. In
cases where a backend's native counbits lacks support, support
is emulated.
New tests are added for 16-bit and 8-bit support. Additional testing
added for 32-bit and minor updates made to 64-bit countbits.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add IREnumType to distinguish enums from ints and each other
* Add issue example as test
* format code
* Add expected test output
* Fix peephole optimization hanging
No idea why this PR triggered this, but there seems to have been a clear bug
here anyway, so may just as well fix it now.
* Move enum lowering later
* Add linkage decoration to enum type
* Use filecheck-buffer instead of expected.txt
* Fix comment
* Make enum casts actually use IR enum casts
They were all BuiltinCasts by accident
* Lower enum type before VM
* Deal with rate-qualified types in enum cast
* Allow any value marshalling for enum types
* Handle new enum instructions in a couple more switches
* Fix formatting
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| | |
|
| |
|
|
|
|
|
|
| |
Fixes #6940.
Add new Slang fwidth_coarse and fwidth_fine functions, similar to GLSL's fwidthCoarse and fwidthFine.
Move the implementation of the GLSL functions from glsl.meta.slang to hlsl.meta.slang.
Update the existing spirv/fwidth.slang test with the new functions, and add a new hlsl-intrinsic/fragment-derivative.slang test to test HLSL, SPIR-V, and GLSL targets for the new functions.
|
| |
|
|
|
|
|
| |
* Simplify build of slang-wasm
* Add smoke-test for slang-wasm in ci
* Avoid git-clone playground
|
| |
|
|
|
|
|
| |
* Add `IOpaqueHandle::descriptorAccess`.
* Update doc.
* fix.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial support for immutable lambda expressions.
* More diagnostics, and langauge server fix.
* Language server fix.
* Fix bug identified in review.
* Add expected result.
* Update expected result.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* cuda: Improve entry handling for SV_DispatchThreadID
Fixes #6780
This commit improves CUDA entry point handling by extracting appropriate
components from DispatchThreadID based on parameter type. It now
properly handles uint scalar (x component only) and uint2 vector (x,y
components) instead of always using the full uint3 value.
Add a new test case to check for this.
* format code
* fix CI failure
* Handle review comments
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* cuda: Add support for subscript operator
This CL adds support for the subscript operator for Read Only
textures in cuda. Also adds a test for this.
Fixes #6781
* format code
* fix review comments
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
| |
|
|
|
|
|
| |
* Support `this` use of `IRMeshOutputRef`
* Fix SPIR-V val error
There was a type mismatch causing a spir-v failiure: `store(var, var)` instead of `store(var, load(var))`
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add Slang Byte Code generation and interpreter.
* Fix compile issues.
* format code
* More compile fix.
* Fix clang issue.
* Fix more clang issues.
* Another clang fix.
* Fix clang issues.
* Fix another clang issue.
* Fix wasm build.
* Update building.md
* Fix test-server.
* Fix compile error.
* Fix bug.
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
| | |
|
| |
|
|
| |
generic expressions) (#6787)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update spirv-tools to for SDK v2025.2
Fixes: #6850
* bump spirv version to 1.4 for op linkage
* skip-spirv-validation for coop mat
* add skip-spirv-validation option to slang session desc
* use SPV_ENV_UNIVERSAL_1_6 for spirv-tool env target
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implemented #pragma warning
Based on https://learn.microsoft.com/en-us/cpp/preprocessor/warning?view=msvc-170
* Make #pragma warning work with #includes.
- SourceLoc are not sorted by inclusion order.
- Construct a mapping from SourceLoc to "absolute locations" that are sorted by inclusion order (roughly represents a location in a raw file with all #include resolved).
- The absolute location can be used in the pragma warning timeline
* Added preprocessor #pragma warning tests.
- Fixed #pragma warning (push / pop) SourceLoc
- Fixed unused directiveLoc in #pragma warning parsing
* #pragma warning: Added some comments and fixed some typos
* Cleaned #pragma warning preprocessor implementation.
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Work on #6892
The function `tryInferLoopMaxIterations` in `slang-check-stmt.cpp` was
doing:
auto litExpr = m_astBuilder->create<LiteralExpr>();
but the declaration of `LiteralExpr` in `slang-ast-expr.h` had been
marked as abstract, during the switch to using the `slang-fiddle` tool
to generate code:
FIDDLE(abstract)
class LiteralExpr : public Expr
{ ... }
In this case, the intention of the AST design is that `LiteralExpr`
should be kept abstract, and only the concrete subclasses should
ever be instantiated.
Because of some historical design choices, the `ASTNodeType`
enumeration includes both the concrete and abstract AST classes, so
the code ended up constructing a `LiteralExpr` that had the tag
`ASTNodeType::LiteralExpr`. Then attempts to use the `ASTNodeDispatcher`
code on such a node caused crashes, because the dispatcher code only
included `case` statements for the non-abstract `ASTNodeType`s.
The quick fix here was to change the `tryInferLoopMaxIterations`
function to instead do:
auto litExpr = m_astBuilder->create<IntegerLiteralExpr>();
A test case was added to help catch any future regressions on this
specific issue.
A more long-term fix should involve introducing code that statically
and/or dynamically prohibits the creation of instances of AST node
classes that have been marked abstract.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* update slang-rhi submodule
* slang-rhi API changes
* disable agility sdk
* fix texture creation
* update formats in tests
* Extent3D rename
* use 1 mip level for 1D textures for Metal
* fix texture upload
* update to latest slang-rhi
* update slang-rhi
* format code
* update slang-rhi
* do not run texture-intrinsics test on metal
* update slang-rhi
* deal with failing tests
* fix more tests
* update slang-rhi
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Simon Kallweit <simon.kallweit@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix #6544: Properly format nested type names in extensions
Modify DeclRefBase::toText to properly handle types defined
in extensions by qualifying them with their parent type name.
This ensures getFullName() returns the full name like
'FullPrecisionOptimizer<half>.State' instead of just '.State'.
Also handle other nested types in structs/classes similarly.
* Update extension reflection handling - with generics args and namespaces
- stopping namespace inclusion for extension members
- Update to use getTargetType() to handle the generic arguments
- update test cases
* Simplify code to remove using parentDecl
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial implementation for SPIRV, GLSL and Metal
* test add bool test
* Fix and improve subgroup rotate tests
* Add proper GLSL extensions and proper Metal type checking
* Clean up tests and add diagnostics test for subgroup type for Metal
* Update wave-intrinsics docs
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Add struct member offset qualifier for SPIRV
* Implement for GLSL target and add tests
* clean up
* fix formatting
* fix typo
* renamed GLSLStructOffset to VkStructOffset and added emit-spirv-via-glsl test case
|
| |
|
| |
Co-authored-by: Yong He <yonghe@outlook.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Change modifies the countbits intrinsic to use generics in order to
support 64bit countbits on select platforms where this is supported.
On platforms where this is not natively supported, we emulate by
converting the 64-bit type into a uint2 (metal and spir-v).
This should align with the implementation of other uint64_t
intrinsics such as abs, min, max and clamp.
Added new countbits64 test to verify changes.
Updated documentation for 64bit-type-support.html
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Close #6589.
In PR #6487, we support partial specialization. However there is a corner case we didn't handle correctly.
For the IR like this:
%val: specialize(...) = some inst;
%arg1: specialize(...) = makeExistential(%val, ...);
%arg2: %SomeConcreteType: load(...);
call func(%arg1, %arg2);
when we specialize the call func instruct, we will also specialize the function parameters.
On our existing logic, when we find an argument is a makeExistential, we will always extract the existential value, and use its type as the new parameter.
But in this case, %arg1 is not fully specialized yet, so it's type will still be a specialize. In this case, we will change the function's first parameter from an existential type to a specialize. This will result in that we lose the chance to specialize the first argument in the next iteration, because the first parameter of this function is not an existential type any more.
The reason behind this is that we should always keep specializing the arguments and parameters at the same time.
So this PR just does a check before specializing the parameters that if the argument cannot be fully specialized, we won't specialize the parameter this early. Instead, we will wait for the next iteration until the argument can be specialized.
|
| | |
|
| |
|
|
|
|
|
| |
(#6841)
With this PR, cooperative-vector tests will run only when the hardware can support the feature.
Unfortunately, DX12 backend will always reports that cooperative-vector is NOT supported until it is officially supported in May.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* initial wip for spirv
* working tiled example
* clean up store and load
* minor fixes
* fix loadAny name
* add initial tests, including broken/unimplemented intrinsics
* fix subscript
* run tests at 16x16, remove not supported arithmetic tests
* minor fixups on implementation
* rename CoopMatMatrixUse
* Update tests to pass validation layers locally
* Add mat-mul-add test and minor fixes
* Add more tests
* Remove dead code
* Add coopMatLoad function and tests, enforce constexpr for matrix layout
* Use getVectorOrCoopMatrixElementType in place of getVectorElementType
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix matrix division by scalar for Metal and WGSL targets
* Add tests
* Minor fix
* Fix compilation error
* Convert to multiplication for WGSL
* Minor cleanup
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
* Fix User Attribute string reflection
Fixes #6794
* Fix strings not being properly escaped
---------
Co-authored-by: Darren Wihandi <65404740+fairywreath@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
* Add gl_PointCoord support in GLSL compat mode
* Add SV_PointCoord
* Test on metal as well
* Update SPIRV system value semantics table in docs
* Update metal docs for SV_PointCoord
|
| |
|
|
|
|
|
|
|
| |
* Fix pointer field access for GLSL
* Add test
* Fix SPIRV test
* add spirv via glsl test
|
| |
|
|
|
|
|
|
| |
Fixes #6171
This commit adds logic for reporting double support
to the d3d11 backend, for running tests on GPUs that
do not support D3D11_FEATURE_DOUBLES, and add checks
for that support to tests that require the feature.
|
| |
|
|
|
|
|
|
|
| |
This fixes issue #6654
Only hoist instructions that are optimized by prepareFuncForForwardDiff.
Add flag hoistLoopInvariantInsts to IRSimplificationOptions and set this
to true only if called from prepareFuncForForwardDiff, then only hoist
if the flag is set. Additionally, do not hoist loops if they only have a
single trivial iteration.
|
| |
|
|
|
|
|
|
|
| |
interface-typed output parameter (#6788)
* More specific diagnostic for invalid concrete-to-interface arg coercion
* Add test for the new error message
* Fix typo in expected test result
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Get real value for typeAdapter
When the type is mismatch and typeAdapter is used, get the real value
from typeAdapter so that we don't get nullptr for irValue.
This fixes the assert if uint is used for SV_VertexID, which is an int
in the system binding semantic.
Fixes: #6525
* Add test case; add nullptr check
|
| |
|
| |
Closes https://github.com/shader-slang/slang/issues/5995
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add support for Ray Payload Access Qualifiers (PAQs) (#3448)
- Added [raypayload] attribute for struct declarations
- Implemented field validation requiring read/write access qualifiers
- Added diagnostic error for missing qualifiers
- Enabled PAQs in DXC compiler and HLSL emission
- Added new test demonstrating PAQ syntax
- Implemented proper handling of ray payload attributes in IR generation
* format code
* Cleanup: Remove unused vars
* Add check to enablePAQ only for profile >= lib_6_7
* Review Fix - Add PAQ support for DX Raytracing
add enablePAQ flag to DownstreamCompileOpitons, improve PAQ handling
update raypayload-attribute-paq.slang to ensure hlsl and dxil is
validated
* Add diagnostic test for missing paq for lib_6_7
Compile using `-disable-payload-qualifiers` aka lib_6_6 profile
raypayload-attribute-no-struct.slang and
raypayload-attribute.slang
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#6651)
* Fix incorrect assert on mixed global uniform and varyings
* add test
* remove unnecessary include
* fix incorrect logic
* fix comment grammar
* address review comments and improve test
* minimize diff
* fix more issues for cuda build
* remove unnecessary line for diff
|