| Age | Commit message (Collapse) | Author |
|
differentiable functions (#5866)
* Overhauled the auto-diff system for dynamic dispatch
* More fixes
* remove intermediate dumps
* Update slang-ast-type.h
* More fixes + add a workaround for existential no-diff
* Update reverse-control-flow-3.slang
* remove dumps
* remove more dumps
* Delete working-reverse-control-flow-3.hlsl
* Cleanup comments + unused variables
* More comment cleanup
* Add support for lowering `DiffPairType(TypePack)` & `MakePair(MakeValuePack, MakeValuePack)`
* Fix array of issues in Falcor tests.
* Update slang-ir-autodiff-pairs.cpp
* More fixes for Falcor image tests
* Small fixups.
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Add parentheses to make precedence explicit
Add parentheses for a few cases that Dawn/Tint (WGSL compiler) complains about.
Closes #6005.
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* add SampleCmpLevel intrinsics
* update tests
* fix typo
* fix broken glsl test
* refactor SampleCmpLevelZero
* fix metallib test
* fix broken test on dx12
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Add executable test on matrix-typed vertex input.
* Fix emit logic of matrix layout qualifier.
* Pass fragment shader varying input by constref to allow EvaluateAttributeAtCentroid etc. to be implemented correctly.
|
|
* Check whether array element is fully specialized
close #5776
When we start specialize a "specialize" IR, we should
make sure all the elements are fully specialized, but
we miss checking the elements of an array. This change
will check the it.
* add test
* add all wrapper types into the check
* add utility function to check if the type is wrapper type
---------
Co-authored-by: zhangkai <zhangkai@zhangkais-MacBook-Pro.local>
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Use disassemble API from SPIRV-Tools
This commit uses C API version of SPIRV disassemble function rather than
calling spirv-dis.exe.
This allows us to use a correct version of SPIRV disassble function that
Slangc.exe is using.
The implementation is mostly copied from external/spirv-tools/tools/dis/dis.cpp, which is a source file for building spirv-dis.exe.
This commit also includes a fix for a bug in RPC communication to `test-server`.
When an RPC connection to `test-server.exe` is reused and the second
test abruptly fails due to a compile error or SPIRV validation error,
the output from the first test run was incorrectly reused as the output
for the second test.
This commit resets the RPC result before waiting for the response so
that even when the RPC connection is erratically disconnected, the
result from the previous run will not be reused incorrectly.
Some of the tests appear to be relying on this type of behavior. By
using an option, `-skip-spirv-validation`, the RPC connection will
continue without an interruption.
|
|
|
|
|
|
|
|
* Create DirectDeclRef when creating Decl to prevent invalid dedup.
* Fix test.
* fix
* update slang-rhi
|
|
|
|
* Correct IR generation for no-diff pointer type
Close #5805
There is an issue on checking whether a pointer type parameter
is no_diff, we should first check whether this parameter is
an Attribute type first, then check the data type.
In the back-propagate pass, for the pointer type parameter, we should
load this parameter to a temp variable, then pass it to the primal
function call. Otherwise, the temp variable will no be initialized,
which will cause the following calculation wrong.
|
|
An AND operator was used where an OR should have been used.
|
|
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(#5964)
|
|
inheritance decl. (#5965)
|
|
|
|
|
|
|
|
* Fix parsing GLSL SSBO arrays / bindless descriptors
* Clean up SSBO array parsing
* Fix mutable SSBO arrays not being detected as such
* Allow sized SSBO arrays
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Add packed bytes builtin type
* fix test
|
|
|
|
|
|
|
|
* Add base vertex and base instance system values
* Fixed incorrect stage in tests
|
|
* Implement HLSL texture sample with status intrinsics
* fix test and cleanup
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Report error when generated spirv is empty.
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
|
Close #5911.
In this issue, if we define the generic in source file 1,
and import it into source file 2, then when parsing the
reference of that generic in source file 2, we will not parse
the generic directly, instead we have a logic to speculate it
as generics first with a fake diagnostic sink, and if there is
no error report, we will consider it as a actual generic and will
parse it again.
In this logic, we will also disambiguate the expression based on
the following token, but we didn't consider the token '[', so we
will finally not treat the expression as generic.
The fix is just simply add '[' here.
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
|
|
|
|
|
|
* Allow `Optional` and `Tuple` to be used in varying input/output.
* Fix.
* format code
* Fix.
* Fix test.
* Fix.
* enhance test.
* Fix.
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
* Add verification logic on push and specialization constants.
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
|
|
Close #5470
* implement bitcast for 64-bit date type
* Move 'ensurePrelude' to base class to remove duplication
* Assert on 'double' type for Metal target, as Metal doesn't have 'double' support
|
|
* Fix entrypoint auto discovery logic.
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
* Fix `getArgumentValueFloat` when arg is int.
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
|
|
|
|
* promoting bitfield extraction and insertion to become intrinsics for internal compiler use
* removing duplicate intrinsics from glsl.meta.slang
* refactor: update function signatures of bitfield extraction and insertion to use uint as the parameter type for offset and bits.
---------
Co-authored-by: Nate Morrical <natemorrical@gmail.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Split out SPIR-V -specific legalization of global functions
This is a refactoring and should not affect generated code.
* Move global inst inlining code into separate function
This is a refactoring and should not affect generated code.
* Take SPIR-V -specific parts out of GlobalInstInliningContext
This is a refactoring and should not affect generated code.
* Move 'inlineGlobalValues' to generic inlining context
This is a refactoring and should not affect generated code.
* Move 'setInsertBeforeOutsideASM' to generic inlining context
This is a refactoring and should not affect generated code.
* Move generic inlining context into own file
This is a refactoring and should not affect generated code.
* Run global inlining for WGSL as well
* Make the 'getOutsideASM' function generic as well
* Enable language-feature/constants/static-const-in-generic-interface.slang for WebGPU
* Clarify when it's safe to remove and deallocate an IRInst
* Remove globals if they're left unused after inlining
This closes #5607.
* Handle IRGlobalValueRef in C-like emitter
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
|
|
* Back out "Update SPIRV submodules (#5815)"
This backs out commit e50aac13e2c161d672b137a62f6d66820d0f9ff1.
* Use upstream spirv-tools
* Fix bump-glslang.sh for newer versions of spirv-tools
* Use upstream glslang
* Add --do-fetch option to bump glslang
* Bump glslang and friends
Supersedes https://github.com/shader-slang/slang/pull/5815
* Regenerate glslang and spirv-tools outputs
* Fixes to slang-glslang
* Correct spirv intrinsic for OpImageSampleFootprintNV
Note that this currently fails validation with the following error:
```
error: line 145: Result <id> from OpSampledImage instruction must not appear as operand for OpImageSampleFootprintNV, since it is not specified as taking an OpTypeSampledImage. Found result <id> '55[%sampledImage]' as an operand of <id> '56[%resultVal]'.
%sampledImage = OpSampledImage %54 %51 %40
```
This seems to be in error as the spec for
*SPV_NV_shader_image_footprint* states that "Sampled Image must be an
object whose type is OpTypeSampledImage"
https://refined-github-html-preview.kidonng.workers.dev/KhronosGroup/SPIRV-Registry/raw/refs/heads/main/extensions/NV/SPV_NV_shader_image_footprint.html
glslang also seems to fail with the same validation error
* Fix spv storage class test
|
|
|