| Age | Commit message (Collapse) | Author |
|
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
|
functions. (#5585)
|
|
* Add `IDifferentiablePtrType` support for arrays
- Also fixes an issue with spirv-emit of constructors that contain references to global params
* Fix GLSL legalization for arrays of resource types
|
|
* Add new texture sampling test for WebGPU
There are no 1d array textures in WGSL, so
add texture-sampling-no-1d-arrays.slang based on texture-sampling.slang, but without
1d texture arrays.
This helps to address issue #4943.
* Insert needed conversion when querying texture attributes in WGSL
This helps to address issue #4943.
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Update Slang-RHI to get WGPU backend fixes
* render-test: Use device local memory type for vertex buffers
This helps to avoid https://github.com/shader-slang/slang-rhi/issues/104
* Fix bug in WGSL emitter layout code.
There was a "kinds" vs. "kind flags" mismatch, and also getBindingOffsetForKinds was not
being used.
This patch enables a bunch of tests for WGPU.
This helps to address issue #4943.
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
* Push buffer load to end of access chain.
* Update test.
* Fix.
* Fix.
* Fix.
* Make more robust.
* Fix.
|
|
* Transfer offset decorations when legalizing laid-out structs
Struct legalization removing fields not representable in memory should transfer all
decorations in case the struct has already had offsets calculated.
Closes #5264.
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Require GL_EXT_samplerless_texture_functions only if needed
This extension is only necessary when using texture functions
on non-combined texture/samplers.
Fixes #5518
|
|
The WGPU backend was crashing because of the
unbound sampler state. Fix the test by adding
a test sampler.
Issue 5277
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
|
This closes issue #5505.
|
|
* Fix CUDA prelude for makeMatrix
* Add regression test.
|
|
regression. (#5508)
* Fix IntVal unification logic to insert type casts.
* Fix regression.
|
|
* Fix WGSL parameter block binding.
* Re-enable tests.
* Update failure list.
* Fix entrypoint parameters.
* Update tests.
* Enable stat-var test.
|
|
* [WGSL] Enable arbitrary arrays in uniform buffers.
* format code
* Undo irrelevant change and fixups.
* Update expected failure list.
* Fix.
* Rename.
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
targeting WGSL (#5483)
Structured buffer types translate to array types in the WGSL emitter.
WGSL doesn't allow passing runtime-sized arrays to functions.
Similarly for pointers to texture handles.
Also, structured buffers (runtime-sized arrays) cannot be returned in WGSL.
This closes issue #5228, issue #5278 and issue #5288 by enabling specialized functions
to be generated in these cases, in order to work around these constraints.
|
|
* Legalize the Entry-point for WGSL
The return type of the entry-point needs to be legalized when targeting
WGSL.
This commit flattens the nested-structs of the return type and the input
parameters of the entry-point.
Most of code is copied from the legalization code for Metal. The
following functions are exactly same to the implementation for Metal or
almost same.
- flattenInputParameters() : 136 lines
- reportUnsupportedSystemAttribute() : 7 lines
- ensureResultStructHasUserSemantic() : 46 lines
- struct MapStructToFlatStruct : 176 lines
- flattenNestedStructs() : 95 lines
- maybeFlattenNestedStructs() : 42 lines
- _replaceAllReturnInst() : 19 lines
- _returnNonOverlappingAttributeIndex() : 16 lines
- _replaceAttributeOfLayout() : 23 lines
- tryConvertValue() : 41 lines
- legalizeSystemValueParameters() : 11 lines
They need to be refactored to reduce the duplication later.
The test case, `tests/compute/assoctype-lookup.slang`, had a bug that
the compute shader was trying to use the varying input/output with the
user defined semantics.
This commit removes the user defined semantics, because the compute
shaders cannot use the user defined semantics.
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
Close the issue #4940.
|
|
* Fix issue of infinity float literal
* add parameters for the test
* Correct the way to construct inf and nan
In WGSL, expression of "1.0/0.0" is not allowed, it will report compile error,
so to construct infinity or nan, we have to assign the float literal to a variable
and then use it to bypass the compile error.
By doing so, we add getInfinity and getNan functions to the builtin
prelude to wgsl.
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
Update slang-rhi to pick up a fix in webgpu compilation error handling.
In doRenderComparisonTestRun(), only return TestResult::Pass if the
shader is ran actually compiled.
A similar check is in place elsewhere in slang-test-main, but was
missed in doRenderComparisonTestRun().
Add two tests to the github CI skiplist, and use the skiplist in one
additional CI config that was running without it.
Closes 5291
|
|
* Fixing the wrong implementation of some math intrinsic
Close the issue #5282
The root cause of the issue is that log10 is not supported in wgsl.
So add the implementation.
Also ldexp in wgsl doesn't support float type exponent, so fix the
implementation of the intrinsic.
* re-enable the tests
|
|
* [WGSL] make sure switch has a default label.
* Various WGSL fixes.
* Update rhi submodule commit
* format code
* Remove unnecessary DISABLE_TEST directive on not applicable test.
* Matrix comp mul + `select`.
* Legalize binary ops for wgsl.
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
|
|
|
|
* Enable tests/compute/func-cbuffer-param
* Enable tests/language-feature/tuple/tuple-parameter.slang
|
|
This fixes a teardown crash, and a buffer usage mismatch issue during bind group creation.
These Slang-RHI fixes allow several WGPU tests to be enabled:
- tests/compute/column-major.slang
- tests/compute/constant-buffer-memory-packing.slang
- tests/compute/matrix-layout.hlsl
- tests/compute/non-square-column-major.slang
- tests/compute/row-major.slang
- tests/hlsl/packoffset.slang
This helps to address issue #5222.
|
|
|
|
* Add support for write-only textures.
* Fix capabilities.
* Fix implementation.
* Fix.
* format code
---------
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
* Precompiled SPIR-V import support
Adds appropriate linkage and function declaration syntax
for SPIR-V functions that are declared, to be imported
from another SPIR-V module.
Unlike DXIL, stripping the Slang IR for a function down
to a declaration requires retaining a block of parameters,
as the function declaration must be emitted to SPIR-V
with the same parameters as a definition. Because that
thwarts the logic in Slang to tell the difference between
a declaration and definition, and explicit decoration is
introduced to explicitly mark functions which need to be
treated as declarations during emit phase.
Fixes #4992
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Use Offset instead of ConstOffset for GLSL function textureGatherOffset
This commit changes to use `Offset` option on OpImageGather instruction
when translating `textureGatherOffset` to SPIR-V code.
Interestingly GLSL allows the offset value to be a variable not
constant just for the function `textureGatherOffset` while all other
offset variants of texture sampling functions require the offset to be a
constant value.
From a few experiments, I found that the spirv-optimizer changes
`Offset` to `ConstOffset` if the offset is a compile-time value. I also
found that when the offset value is zero, it changes to `None` with no
offset value.
|
|
* format
* Minor test fixes
* enable checking cpp format in ci
|
|
(#5415)
This commit changes the word "stdlib" or "standard library" to "core module" in the source code.
|
|
auto-diff results (#5394)
* Various AD enhancements
* Fix issue with pt-loop test
* Update pt-loop.slang
* More fixes for perf. Final minimal context test now passes.
* Fix issue with loop-elimination pass not running after dce
* Try fix wgpu test by removing select operator
* Disable wgpu
* Delete out.wgsl
* Remove comments
* Update slang-ir-util.cpp
* Fix header relative paths for slang-embed
* Disbale wgpu for a few other tests
* Better way of determining which params to ignore for side-effects
* Update slang-ir-dce.cpp
* Fix issue with circular reference from previous AD pass being left behind for the next AD pass
* Update slang-ir-dce.cpp
|
|
|
|
|
|
This is a breaking change in a way that the Slang API function names are changed. All of them are commented as "experimental" and we wouldn't provide a back-ward compatibility for them.
Following functions are renamed:
compileStdLib() -> compileCoreModule()
loadStdLib() -> loadCoreModule()
saveStdLib() -> saveCoreModule()
slang_createGlobalSessionWithoutStdLib() -> slang_createGlobalSessionWithoutCoreModule()
slang_getEmbeddedStdLib() -> slang_getEmbeddedCoreModule()
hasDeferredStdLib() -> hasDeferredCoreModule()
Following command-line arguments are renamed:
"-load-stdlib" -> "-load-core-module"
"-save-stdlib" -> "-save-core-module"
"-save-stdlib-bin-source" -> "-save-core-module-bin-source"
"-compile-stdlib" -> "-compile-core-module"
|
|
* Use DebugDeclare instead of DebugValue.
* Avoid generating illegal SPIRV.
* Improve DebugLine output.
* Fix.
* Fix.
* Misc improvements.
|
|
|
|
|
|
|
|
* Remove use of Variable Pointer capability.
|
|
* Cleanup definition of `printf`.
* Fix.
* Fix spirv generation.
* Fix.
* enhance test.
|
|
* Cleanup atomic intrinsics.
* Fix.
* Fix glsl.
* Remove hacky intrinsic expansion logic for glsl image atomics.
* Fix all tests.
* Fix.
* Add `InterlockedAddF16Emulated`.
* Fix glsl intrinsic.
* Fix.
|
|
* Fix spirv debug info for pointer types.
* fix comment.
|
|
Add fcpw library to test suite.
|
|
|
|
|
|
* Support constant folding for static array access.
* Fix test.
|
|
|
|
When precompiling modules defined
with glsl, it's necessary to link in the
glsl definition module.
Reuse the public fillRequirements declaration
|
|
|