| Age | Commit message (Collapse) | Author |
|
* update hlsl meta
* update test
* use slang syntax in meta file
* improve meta file
* fix pack clamp u8
* remove builtin packed types, use typealias instead
* fix wgsl pack clamp
* fix formatting
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Resolve 'extern' types during type layout generation if possible
Closes https://github.com/shader-slang/slang/issues/5994
Closes https://github.com/shader-slang/slang/issues/6437
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* support WaveGetLane* for WGSL and Metal
* update test and glsl support
* address review comments and fix metal test
* add missing pragma guard
* update test
* Revert "update test"
This reverts commit f2b97e91c29de154190710580c343bd0764aedbb.
* update failing glsl metal test and added new test
* make hlsl and glsl outputs similar
* update test
* disable tests for Metal and cleanup
* comment fix
* add expected failures
* correct expected failures list
* remove expected failure
* add tests to expected failure
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
|
|
|
The default matrix layout mode was applied in addition to any related options, and this
caused the wrong matrix layout mode to be used.
For example, tests/compute/column-major was failing when attempting to migrate to the new
compilation API.
This helps to address issue #4760
|
|
This helps to address issue #4760.
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Add inner texture type to reflection json
* Add expected result of test
* Adjust test expected results
* Fix ci test result
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Map `SV_InstanceID` to `gl_InstanceIndex-gl_BaseInstance`
* Fix ci.
|
|
* Make capability diagnostic message more friendly.
* Fix.
* Fix.
* Fix.
* Fix test.
* Update expected fail setting for aarch64/linux
* Fix.
|
|
* Allow `.member` syntax on vector and scalars.
* Fix.
* fix.
* Fix.
* update comment.
* Fix tests.
* Fix warning.
* Add more tests.
|
|
* Fix overload resolution for `MemberExp`r's base expression
Also fixed an issue where `ModuleDeclarationDecl` priority during overload resolution was inverted.
* Made the fix slightly simpler..
* Update overload-resolve.slang
|
|
* hotfix slang-rhi
* Fix missing include
* external/glslang: 15.0.0-37-ga0995c49 -> vulkan-tmp-1.4.309
external/spirv-tools: v2024.4.rc2-44-g3364b982 -> v2024.4.rc2-48-gce37fd67"
|
|
|
|
* Fix precompiledTargetModule tests
Add SPIRV-Tool linker support to gfx unit tests
and use the linker in precompileModule tests
that use precompiled modules to reconstitute
SPIRV shaders that were modularly compiled.
Fix a Slang reference count bug in the
precompile service.
* Use sm_6_6
New DXC requires higher version
for linkability.
* Rename helper function, pass by reference
* Link through slang-glslang
* Add missing files
* Fix metal
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
|
|
* Expose value of constant integers in module reflection
This commit adds `VariableReflection::getDefaultValueInt` to get the value of a variable if it is a compile-time constant integer.
TODO: currently it works only if the initializer expression is an integer literal, references to other constant values are not handled.
* Update VarDecl folded constant value during DeclBodyVisitor
Constant folding for integer values is already done internally by _validateCircularVarDefinition, this just reuses the result.
* Address review comments & formatting
* Formatting
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
|
|
* Fix a bug with hoisting 'IRVar' insts that are used outside the loop
- We introduce a 'CheckpointObject' inst and use that to split loop state insts into two pieces (one for within-loop uses and one for outside-loop uses.
- This allows the two kinds of uses to be handled separately by the hoisting mechanism
- CheckpointObject is then lowered to a no-op after hoisting is complete.
* Update slang-ir-autodiff-primal-hoist.cpp
* Update slang-ir-autodiff-primal-hoist.cpp
|
|
* Fix `UseGraph::isTrivial()` test.
* Fix.
* Fix.
* Refactor `UseGraph` and `UseChain`
* Update slang-ir-autodiff-primal-hoist.cpp
* Update all auto-diff locations that handle pointers to treat user pointers as regular values
* Update test to use direct-SPIRV only
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
Closes https://github.com/shader-slang/slang/issues/5751
|
|
* Clone name hint decoration when emiting Undefined
When emiting "Undefined", we lost the information of where it was
synthasized from. This prevents us from providing more helpful error
messages.
The issue was the when we handle "IRLoop", the inputs parameters to the
Phi didn't clone the name hint decoration. This commit clones them when
emiting "Undefined".
* Adding more test case
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Legalize array size of SV_TessFactor and SV_InsideTessFactor
When targeting SPIR-V or GLSL, the type for SV_TessFactor must be
float[4]; note that it is not a vector but an array.
Similarly the type of SV_InsideTessFactor has to be an array of
float[2].
When the user shader declare them as arrays smaller than the required
size, Slang will legalize them to the required sizes.
Note that it is not the user mistake to declare floar[3] when the hull
mode is in "tri", as an example. The unused components are expected to
be ignored.
Note also that HLSL allows the type to be float[2|3|4] whereas GLSL and
SPIR-V requires it to be always float[4].
* Change from "quad" domain mode to "tri"
* Handle error case
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Fix TypeCheckingCache concurrency.
* Fix.
|
|
noise() is currently marked "unsupported" in Slang documentation, and
has also been unsupported in HLSL since SM 2.0
Until now, noise() was present only to prevent compilation errors, but
not for any actual use since it returns 0.0 always.
Closes #5775
|
|
Improve performance when compiling small shaders.
Avoid copying witness table entries that are not getting used during linking.
Avoid copying auto-diff related decorations and derivative functions during linking, if the user modules doesn't use autodiff.
Cache operator overload resolution results on global session, so each new Session doesn't need to repetitively run through overload resolution from scratch.
|
|
input values are equal, the gradient is split evenly between both inputs. (#6411)
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
Partially fix #6378
* Fix invalid access mode for texture_buffer
* Fix texture view create issue in metal
In newTextureView, levelRange should represent the mipmap level range,
while sliceRange should represent the texture layer range for texture
array. But the implement inverse those two wrongly.
|
|
* Simplify implicit cast ctors for vector & matrix.
* Fix formatting.
* Fix tests.
* Fix Falcor test.
* Mark __builtin_cast as internal.
|
|
* HLSL: Add 'f' suffix to float literals in code generation
Fixes #6078
1) Previously, Slang would emit HLSL float literals without a suffix (e.g.,"1.5"),
which caused DXC to interpret them as 64-bit doubles by default unless
the -HV 202x flag was used. This could cause validation errors when these literals
were used with intrinsics that only accept 32-bit floats (like ddx, ddy).
This change modifies the HLSL emitter to explicitly add 'f' suffix to
32-bit float literals, ensuring they are correctly typed regardless of DXC's version or flags.
For example:
- "1.5" becomes "1.5f"
- "(0.0 / 0.0)" becomes "(0.0f / 0.0f)" for NaN
- "float4(1.0, 2.0, 3.0, 4.0)" becomes "float4(1.0f, 2.0f, 3.0f, 4.0f)"
2) Added a test case to verify the behavior with various float literal scenarios
including basic literals, intrinsic calls, and vector construction.
3) Remove some tests that were marked as known failures
* Add dxil test as suggested by jkwak-work
|
|
* Support for dynamic array of textures access for Texture footprint.
* Do a check for DXIL for dynamic array/footprint.
* format code (#40)
---------
Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
This commit inlines functions that takes InputPatch and OutputPatch as
the function parameter.
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
|
|
* Fix zero size array handling in slangc
Fixes #2890
1. Fix zero size array handling in slangc
2. Add new zero size array diagnostic test.
* format code
* fix review comments
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
|
|
|
|
|
Fixes #4251
When binding attributes (like [[vk::binding]]) are specified on uniforms
that get packed into the default constant buffer, these binding
attributes are effectively ignored since the uniform will always be
placed at descriptor set 0, binding 0. This can be confusing for users
who expect their explicit bindings to take effect.
This change adds a new warning (71) that informs users when their
binding attributes on uniforms will be ignored, and suggests declaring
the uniform inside a constant buffer to preserve the explicit binding.
The warning helps users understand:
1. Why their binding attribute isn't having the expected effect
2. That the uniform is being packed into the default constant buffer
3. How to fix it by using a constant buffer declaration
Added test case in tests/bugs/binding-attribute-ignored.slang to verify
the warning behavior.
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
|
|
|
The GLSL interface block implementation accidentally
removed global variables which are still in use.
|
|
Adds support for input GLSL interface blocks.
closes #5535
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
|
|
* Fix modifier parsing.
* Fix.
* Fix.
* Fix.
|
|
* Neaten metal parameter block checking
* Disallow only resources in constant buffers in parameterblocks on metal
closes https://github.com/shader-slang/slang/issues/6200
* add unit test for metal parameterblock cbuffer
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Fix 6317.
* Fixes #6316.
* Fix cmake preset.
---------
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
|
* Allow LHS of `where` to be any type.
* Register free-form extensions when loading precompiled module.
* Fix test.
* Fix.
* Fix `as<IRType>`.
* try fix precompiled module test.
|
|
* Fix crash when handling uninitialized resource type
close #6328.
When declare a var with struct type, if the struct has a resource
type field and it doesn't provide explicit constructor, because
slang won't implicit construct such variable at declare site if user
doesn't explicitly call the initializer list, we should report the
resource type field uninitialized as an error to prevent future possible
crash when legalize any use of such variable.
|
|
Closes https://github.com/shader-slang/slang/issues/6339
|
|
* Publicly link core module sources
Closes https://github.com/shader-slang/slang/issues/6037
* format
* format
* remove unnecessary conditional
* comments
* neaten
* Only build embedded core modules when necessary
* Make dependencies on core module source more precise
* more precice dependencies on core module source
* Neaten
|
|
|
|
Co-authored-by: Yong He <yonghe@outlook.com>
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
|
* Add raypayload decoration to ray payload structs
Closes https://github.com/shader-slang/slang/issues/6104
* Disable PAQs when compiling with DXC
See https://github.com/shader-slang/slang/issues/3448
|