| Commit message (Collapse) | Author | Age |
| | |
|
| |
|
|
|
|
|
| |
When precompiling modules defined
with glsl, it's necessary to link in the
glsl definition module.
Reuse the public fillRequirements declaration
|
| | |
|
| |
|
|
|
|
|
|
|
| |
* Fix spirv lowering logic around pointer to unsized array.
* Fix.
---------
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
| | |
|
| |
|
| |
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Overhaul docgen tool and setup CI to generate stdlib reference.
* Fix build error.
* Write parsed doc for all decls.
* fix.
* fix callout.
* Fix.
* Fix comment.
* Fix.
* Delete obsolete doc tests.
* Fix.
* Categorize functions and types.
* Fix CI.
* Update comments.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
initialization (#5023)
* Look through attributes and rates when determining by reference initialization
Closes #5022
* Make type of unwrapAttributedType more specific
* loosen type of unwrapAttributedType
* Discard changes to source/slang/slang-emit-spirv.cpp
* Discard changes to source/slang/slang-ir-check-differentiability.cpp
* Discard changes to source/slang/slang-ir.cpp
* Discard changes to source/slang/slang-ir.h
* Update slang-ir-use-uninitialized-values.cpp
* Remove redundant cast
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
| |
declarations (#5236)
Closes issue #5229.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Use the assembly description as target when disassembling
I believe this is a bugfix.
It seems to have worked before because up until the WGSL case, the disassembler has been
the same executable as the one producing the binary to be disassembled.
* Add Tint as a downstream compiler
This closes issue #5104.
* Add downstream compiler for Tint.
* Tint is wrapped in a shared library, 'slang-tint' available from [1].
* The header file for slang-tint.dll is added in external/slang-tint-headers.
* Add some boilerplate for WGSL targets.
* Add an entry point test for WGSL.
[1] https://github.com/shader-slang/dawn/releases/tag/slang-tint-0
* Add WGSL_SPIRV as supported target for Glslang
* Add WebGPU support to slang-test
This helps to address issue #5051.
* Disable lots of crashing compute tests for 'wgpu'
This closes issue #5051.
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement separate downstream library interface
Create a new com interface to house the methods for
precompiling slang modules to target code.
Add methods to count dependent modules and scrape
them for downstream target binaries such that the
downstream target binaries are linkabe outside
of slang, e.g. via spirv-link or dxc.
Fixes #5147
* Rename to _Experimental
Clearly identify this as an interface subject to change.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add options to prevent usage of own submodules
Signed-off-by: Jacki <jacki@thejackimonster.de>
* Allow using external unordered dense headers
Signed-off-by: Jacki <jacki@thejackimonster.de>
* Link system wide installed unordered dense
Signed-off-by: Jacki <jacki@thejackimonster.de>
* Allow external header usage for lz4 and spirv
Signed-off-by: Jacki <jacki@thejackimonster.de>
* Add more options to disable targets
Signed-off-by: Jacki <jacki@thejackimonster.de>
* Add option to provide explizit path for spirv headers and remove earlier options that break the build process
Signed-off-by: Jacki <jacki@thejackimonster.de>
* Rename options to use common prefix
Signed-off-by: Jacki <jacki@thejackimonster.de>
* Fix indentation for the cmake changes
Signed-off-by: Jacki <jacki@thejackimonster.de>
* Add advanced_option function for cmake
* Normalize includes between system and submodule dependencies
Fix any before-accidentally-working problems
* Add option for enabling/disabling slang-rhi
Signed-off-by: Jacki <jacki@thejackimonster.de>
* Pass correct include path for cpu tests
* Correct include path
---------
Signed-off-by: Jacki <jacki@thejackimonster.de>
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial work to support custom derivatives for member methods of differentiable types
* Support custom derivatives of member functions of differentiable types
- Also adds support for declaring custom derivatives via extensions.
* Fix
* move defs
* Update slang-check-decl.cpp
* Create diff-member-func-custom-derivative.slang.expected.txt
* Update slang-check-decl.cpp
* Fix for static custom derivatives
* Fix diagnostics for [PreferRecompute]
* Add backward custom derivative tests
|
| |
|
| |
The type of `sizeof` has to be int not uint.
|
| |
|
|
|
|
|
|
|
| |
(#5200)
* Fix crash when compiling associatedtypes with generic interface constraints.
* delete hlsl.meta.slang.temp.h.
* Fix.
|
| |
|
|
|
|
|
| |
* Correct typo in parser
* SizeOfLineExprs have type int
Fixes https://github.com/shader-slang/slang/issues/5191
|
| |
|
|
|
|
|
|
|
|
|
| |
* Fix diagnostics for [PreferRecompute]
* Update dont-warn-on-simple-prefer-recompute.slang
* Update slang-ir-autodiff.cpp
* Update dont-warn-on-simple-prefer-recompute.slang
* Update warn-on-prefer-recompute-side-effects.slang
|
| |
|
|
|
|
|
| |
* Add COM API for querying metadata.
* Fix tests.
* fix test.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement texture_storage_Xd in WGSL
This commit implements `texture_storage_Xd` in WGSL, which is similar
to RWTextureXD in HLSL.
It is intresting that `texture_storage_Xd` doesn't take the shader
type as its input argument at all.
Instead, it takes "texel format" enum value as its first template
parameter, which can be found here:
https://www.w3.org/TR/WGSL/#storage-texel-formats
As an example, `texture_storage_2d<rg32uint, read_write>` expects
vec4<u32> as a value type for `Load` and `Store`, where Z-component
will be ignored and treated as zero and W-component will be treated
always as 1. The type `u32` is inferred from the enum value `rg32uint`.
Note that the number of component is always fixed to 4 regardless how
many components are actually stored.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
* WGSL texture support for depth and multisampled
This commit fixes a few issues with WGSL texture intrinsics.
- static_assert-s are corrected.
- Gather functions work properly with depth textures
- Load functions work properly with depth textures and multisampled
textures
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Compile fixes for Wasm
The issues are all are due to 'long' types being 32 bits on WASM.
- class members redeclared errors
- << with StringBuilder and unsigned long is ambiguous
This helps to address issue #5115.
* Use the host executable suffix for generators
Since the generators are run at build-time, we should not use CMAKE_EXECUTABLE_SUFFIX,
which is the suffix for the target platform.
Instead, define CMAKE_HOST_EXECUTABLE_SUFFIX as appropriate, and use that suffix instead.
This helps to address issue #5115.
* Add support for Wasm as a platform
This helps to address issue #5115.
* Add emscripten build
This closes #5115.
|
| |
|
|
| |
`$p` was incorrectly removed on the previous commit.
This commit brings it back and fixes the problem.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR implements the texture gather functions for WGSL.
The pattern was very similar to how Metal was implemented.
Before copy and paste from the Metal implementation, I had to
clean up the Metal implementation to make it more readable
and maintainable.
Gather functions are available only for 2D and 3D textures.
Their `array` and `depth` variants may or may not be supported depending on the target.
`static_assert` ensures that Gather functions are available only for 2D and 3D textures.
Removed incorrect use of "$p" argument for targeting GLSL.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Implemented Combined-texture for WGSL
* Remove unnecessary comment
* Limit to std430 layout
* Fix compiler warning for unused variable
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
|
|
|
| |
Closes #5143
Recently there was a commit that changed the behavior of the memory
pointer for WGSL.
This commit fixes some issues came up after the change.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This commit implements all of the texture intrinsics for WGSL except "Gather" and sampler-less.
They will be implemented in a separate PR.
A few things to note:
- texture sampling functions are available only for the fragment shader stage; not for compute
- WGSL doesn't have any functions similar to CalculateLevelOfDetail or CalculateLevelOfDetailUnclamped.
- WGSL doesn't have a function overlaoding for textureSample with "clamp" or "status" arguments.
- WGSL doesn't support Load operation with offset for texture_multisampled_XX and texture_storage_XX.
- WGSL supports only four types of depth textures: 2D, 2D_array, cube and cube_array.
- WGSL doesn't support "offset" variants for cube and cube_array.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial Atomic<T> type implementation.
* Update design doc.
* Fix.
* Add test.
* Fixes and add tests.
* Fix WGSL.
* Fix glsl.
* Fix metal.
* experiemnt with github metal.
* experiment github metal 2
* github metal experiment 3
* experiment with github metal 4.
* experiment with metal 5.
* experiment 7.
* metal experiment 8.
* Fix metal tests.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
| |
|
|
|
| |
* Add diagnostic to verify the left hand side of a generic constraint.
* Fix comment.
|
| |
|
|
|
| |
My previous commit disabled the WGSL test by a mistake. This commit fixes the mistake and run the slang-test for WGSL tests.
frexp and modf were still not working for the vector types.
|
| |
|
|
|
|
|
|
|
| |
* Synthesize conformance for generic requirements.
* Fix.
* Fix build error.
* address code review.
|
| |
|
|
|
|
|
|
|
|
|
| |
* Allow lookups of overloaded methods.
* Update slang-reflection-api.cpp
* Update slang.cpp
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
| |
This closes issue #5085.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* initial diff-ref-type interface
* Initial support for `IDifferentiablePtrType`
* Fix unused vars
* More tests + fix switch case fallthrough.
* Update slang-ir-autodiff.cpp
* Update diff-ptr-type-loop.slang
* Add optimization to allow more complex pair types
* Update slang-ir-autodiff-primal-hoist.cpp
* Update diff-ptr-type-loop.slang
* Update slang-ir-autodiff-primal-hoist.cpp
* More fixes to address reviews
* Update slang-check-expr.cpp
* Optimizations + rename `differentiableRefInterfaceType` -> `differentiablePtrInterfaceType`
* Move pair logic to ir-builder, unify the type dictionaries.
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Transferring source locations when creating phi instructions
* Tracking for simple variables
* Deriving source locations for loop counters
* Printing checkpoint structure breakdown
* More readable output format
* Special behavior for loop counters
* Writing report to file
* Add slangc option to enable checkpoint reports
* Display types of checkpointed fields
* Message in case there are no checkpointing contexts
* Catch source locations for function calls
* Source cleanup
* Fix compilation warnings
* Remove stray dump()
* Provide the report through diagnostic notes
* Add missing path for sourceLoc during unzip pass
* Add tests for reporting intermediates
* Include more transfer cases for source locations
* Fix ordering in address elimination
* Fill in more holes with source location transfer
* Remove debugging line
* Reverting changes to diagnostic sink
* Simplify address elimination using source location RAII contexts
* Eliminating manual source loc transfers in forward transcription
* Fix local var adaptation to use RAII location setter
* Simplify primal hoisting logic for source location transfer
* Simplify unzipping with RAII location scopes
* Simplify transpose logic
* Cleaning up for rev.cpp
* Reverting spacing changes
* Fix mistake with source loc RAII instantiation
* Fix formatting issues
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Lower the priority of looking up the rank of scope
In the previous change of #5060, we propose a way to resolve
the ambiguous call when considering the scope of a function.
But this rule should be considered as a low priority than "specialized
candidate", aka. we should consider more "specialized candiate" first.
* Count distance between reference site to declaration site
Compare the candidate by calculating distance
from reference site to declaration site via nearest common prefix
in the scope tree.
This will involve finding the common parent node of two child nodes
and how sum the distance from the common parent to the two child nodes.
* Change the priority higher than 'getOverloadRank'
* Don't evaluate the scope rank algorithm on generic
If the candidate is generic function, the function parameters
won't be checked before 'CompareOverloadCandidates', so it will
results in that the candidates this function could be invalid.
We should not evaluate the distance algorithm in this case, instead
we will evaluate later when the candidate is in flavor of Func or Expr
since then all the type checks for the function will be done.
|
| |
|
|
|
|
|
|
|
| |
* Add `IRWArray` interface, and make StructuredBuffer conform to them.
* Update user guide.
* Fix.
* Fixes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add WGSL pack/unpack intrinsics
This addresses issue #5080.
* Add WGSL constructor intrinsics
This addresses issue #5081.
* Add WGSL derivative and miscellaneous intrinsics
This addresses issue #5083.
* Add some missing WGSL intrinsics
- degrees
- faceforward
|
| |
|
|
|
| |
Two WGSL functions have little different behavior compared to other
shader languages: frexp and modf. They return a struct to return
two values.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement math intrinsics for WGSL
This commit implements math related intrinsics and a few others for
WGSL.
The implementation is based on the following doc,
https://www.w3.org/TR/WGSL
slang-test was looking for the downstream compiler for WGSL even though
it is not used.
This commit adds a minimal change to avoid the crash.
|
| |
|
|
|
|
|
|
|
|
|
| |
* Add `FunctionReflection::specializeWithArgTypes()`
* Update slang.cpp
* Use a shared semantics context on linkage
Improve performance on reflection queries
* Try to fix linux/mac compile errors
|
| | |
|