summaryrefslogtreecommitdiffstats
path: root/tests/bugs
Commit message (Collapse)AuthorAge
...
* Enable WebGPU tests in CI (#5239)Anders Leino2024-10-15
|
* Fix spirv lowering logic around pointer to unsized array. (#5243)Yong He2024-10-09
| | | | | | | | | * Fix spirv lowering logic around pointer to unsized array. * Fix. --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
* Look through attributes and rates when determining by reference ↵Ellie Hermaszewska2024-10-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix bug in `translateGlslGlobalVar()`. (#5181)Yong He2024-09-27
|
* Fix l-value computation for subscript call. (#5177)Yong He2024-09-27
|
* Lower the priority of looking up the rank of scope (#5065)kaizhangNV2024-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Fix the issue in resolving the overload functions (#5060)kaizhangNV2024-09-11
|
* Fix generic IInteger `mod` implementation. (#5037)Yong He2024-09-09
|
* Fix SPIRV SV_TessFactor type adaptation logic. (#5010)Yong He2024-09-05
| | | | | * Fix SPIRV SV_TessFactor type adaptation logic. * Fix compile error.
* Support `where` clause and type equality constraint. (#4986)Yong He2024-09-05
| | | | | | | | | | | | | | | | | * Support `where` clause. * Fix. * Fix parser. * Enhance test to cover traditional __generic syntax. * Update user-guide. * Support `where` clause on associatedtype. * Fix. * Put in more comments.
* Open existential on arguments after overload resolution. (#4982)Yong He2024-09-04
| | | | | | | | | | | | | * Open existential on arguments after overload resolution. * Fix. * Update source/slang/slang-check-overload.cpp Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> --------- Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com>
* Draft: integrate slang-rhi (#4970)Simon Kallweit2024-08-30
| | | | | | | | | | | | | | | | | | | | | * add slang-rhi submodule * refactor render-test to use slang-rhi and remove OpenGL support * remove -vk -glsl tests * remove gl test * disable failing test * allow recursive submodules in github actions * update slang-rhi * update slang-rhi --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Fix redundant decorations in IRParam (#4964)Jay Kwak2024-08-30
| | | | | | | | | | | * Fix redundant decorations in IRParam Closes #4922 The problem was that same decorations were added to an IRParam multiple times while running `specializeIRForEntryPoint()`. `cloneGlobalValueWithCodeCommon()` kept cloning decorations for the params that were already processed.
* Fix a false failure when using the latest SPIR-V (#4904)Jay Kwak2024-08-22
| | | | | | | | | * Fix a false failure when using the latest SPIR-V --------- Co-authored-by: Ellie Hermaszewska <github@sub.monoid.al> Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
* Make sure to resolve overloaded expr for call args. (#4864)Yong He2024-08-18
|
* Emit memory qualifier once for GLSL targets (#4819)ArielG-NV2024-08-12
| | | | | | | Fixes #4818 Emit memory qualifier once for GLSL targets. Co-authored-by: Yong He <yonghe@outlook.com>
* Warn when inout parameter is never written (#4777)venkataram-nv2024-08-12
| | | | | | | Addresses #4698 as one approach to diagnose the potential problem. Emit warnings when a user marks a parameter as `inout` but never writes to it in the function. A new intrinsic function `unmodified(out T)` has been added to explicitly indicate that an `inout` variable will not be modified in the function. This is only one way to address the specific validation error in #4698. In general it seems that DXC does some more extensive checks on actual struct fields (as opposed to observing arbitrary struct writes), so that will be the next step.
* Allow implicit 'uniform' entrypoint parameters. (#4765)Yong He2024-08-01
| | | | | | | | | | | * Allow impliocit 'uniform' entrypoint parameters. * Fix. * Fix. * Fix. * Fix.
* Move SPIRV global variables into a context variable (#4741)ArielG-NV2024-07-30
|
* Set `nullptr` to the default value of the target VarDeclBase (#4757)ArielG-NV2024-07-30
|
* Disallow multi-dim vector subscript in slang IR (#4277)Sriram Murali2024-07-25
| | | | | | | | | | | Fixes bug #3180 This test verifies the check for illegal swizzle on vector types, whose element is not a basic Type (int, float). The check captures the failure within swizzle access on a nested vector subscript element. vector<vector<int, 2>, 2> a int b = a[0].x; // illegal Co-authored-by: Yong He <yonghe@outlook.com>
* Fix around extensions and `IDifferentiable` requirement synthesis. (#4729)Yong He2024-07-25
| | | | | | | | | | | | | | | | * Check extensions before function parameters. Fix decl ref formation for synthesized differentiable requirements that are inside an extension. * Fix clang errors. * More clang fix. * Fix warnings. * Fix build error. * Fix. * Fix typo.
* Support 1-dimensional matrix for HLSL (#4728)Jay Kwak2024-07-24
| | | | | | | | | | | | | Closes #4395 This commit allows Slang to use 1-dimensional matrix when targetting HLSL. The 1-dimensional matrix is supported by DXC natively. GLSL/Vulkan doesn't support the 1-dimensional matrix natively. It is not trivial for Slang to convert all of matrix functions to vector or scalar at the emitting step. We can implement this later if there are needs. This commit disallows the use of 1-dimensional matrix for targetting GLSL/Vulkan by the capability system; in other words, the new 1-dimentional functions have "[require(hlsl)]".
* Fix checking of var with matrix layout modifier. (#4737)Yong He2024-07-24
|
* Fix for `ConstantBuffer<T[...]>` causing a segfault (#4705)ArielG-NV2024-07-23
| | | | | Fixes: #4704 Change the type we assign when getting the member variable of a legalized `ConstantBuffer<T[...]>`.
* Warn if providing explicit bindings to a object using uniform locations (#4708)ArielG-NV2024-07-23
| | | | | | fixes: #4700 Changes: * If a uniform object (which uses uniform locations) has explicit bindings we will warn to use `ConstantBuffer<T>` instead. We check for a warning specifically when we know an object uses uniform layouts because objects may not use a uniform-layout register even if tagged with `uniform`. A good example of this is `uniform ConstantBuffer<T>`.
* Fix for invalid swizzle causing crash (#4690)ArielG-NV2024-07-19
| | | | | | | | | | | | | | | * Fix for invalid swizzle causing crash Fixes #4689 If swizzle code is provided 5+ element swizzle the checkSwizzleExpr code will do an out of bounds array access and crash. * switch test to check for to ensure no crash * cleanup swizzle errors to only emit once --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Support parameter block in metal shader objects. (#4671)Yong He2024-07-19
| | | | | | | | | | | | | * Support parameter block in metal shader objects. * Ingore parameter block tests on devices without tier2 argument buffer. * Fix warning. * Fix texture subscript test. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Correctly parse multiple escaped newlines (#4672)Ellie Hermaszewska2024-07-19
| | | closes https://github.com/shader-slang/slang/issues/4667
* Fix minimal-optimization flag with texture atomics (#4660)ArielG-NV2024-07-16
| | | Co-authored-by: Yong He <yonghe@outlook.com>
* Warnings function parameters (#4626)venkataram-nv2024-07-16
| | | | | | | | | | | | | | | | | | | | | * Handle out/inout functions with separate consideration * Fixing bug with passing aliasable instructions * Handle autodiff functions (fwd and rev) in warning system * Handling interface methods * Handling ref parameters like out/inout * Temporary fix to remaining bugs * Refactoring methods and tests * Recursive check for empty structs * Using default initializable interface in tests * Resolving CI fail
* Fix the invalid spirv generation for matrix cast (#4588)kaizhangNV2024-07-10
| | | | | | | | | | Spirv doesn't have instruction to do the float cast for the matrix type. So we have to convert the matrix row by row, and then construct them to a new matrix. Update the unit test to make sure the cast won't miss any elements. Co-authored-by: Yong He <yonghe@outlook.com>
* WIP Drop Premake (#3703)Ellie Hermaszewska2024-07-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove premake lua * Remove premake generated vs project * remove deps file * Remove premake driving bat files * Full test matrix under CMake * Remove premake based ci workflows * Wiggle CI * remove cmake from ci name * find frameworks correctly on osx * remove cmake from ci name * Cope with sccache not being available * cmake based falcor tests * ci wobble * only install ninja if necessary * more appropriate cache name * Remove premake from build instructions * Add some docs on ci setup * remove premake from regression tests * remove premake from perf test * Set SLANGC_PATH * ci wobble * bump slang-binaries * ci wobble * Bump spirv tools * dont use timestamp in cache * remote debug code * cache key wobble * Install sccache after building llvm * Do not build llvm tools * ci wobble * ci wobble * ci wobble * ci wobble * ci wobble * Tests spirv via glsl in ci * Define SLANG_ENABLE_XLIB=1 * osx builds on aarch64 * ci wobble * ci wobble * ci wobble * ci wobble * ci wobble * ci wobble * package documentation and metadata with cmake * ci wobble * Split hlsl double intrinsic tests * ci wobble * Correct type for double log10 Fixes https://github.com/shader-slang/slang/issues/4549 * remove working test from expected failures * add broken test to expected failures * smaller build for falcor tests * ci wobble * A few exclusions in ci * wip, release script * Enable examples in ci * neaten release script * Correct building docs * Only use xlib vulkan when slang_enable_xlib is true * bump slang-llvm version * Remove toolchain file use * Bump slang-llvm preset version * slash direction * Improve build directions * Add msvc cross build documentation * Disable old release files * Smaller set of releases for test * Allow not building llvm * simplify release matrix * Cross releases * formatting * formatting * ci wiggle * ci wiggle * cleaner * neaten * ci wobble * formatting * Install cross tools on linux * do not clean build dir * neaten ci * neaten ci * neaten ci * remove unused release workflow files * Build llvm on some platforms * neaten ci * notarize on osx * s/x64/x86_64 * ci wobble * Embed stdlib for release build * wobble ci * wobble ci * s/x64/x86_64 * ci wobble * ci wobble * ci wobble * vk-gl-cts on cmake * neaten ci * neaten ci * bump cache action version * Cope with windows being weird about case * old glibc version * old glibc version * Correct action file * Keep cache hot on main branch * separate small script for old glibc releases * ci wobble * ci wobble * Run cmake outside of docker * only sign on releases * Revert "Run cmake outside of docker" This reverts commit a58aaba939a4aa35fe70962fd60d9512b143592f. * python3 on build image * less parallel * ci wobble * ci wobble * ci wobble * newer git * ci wobble * ci wobble * Use newer docker image * Use newer docker image * sccache wobble * permissions issue * neaten * build llvm in ci * build llvm in ci * Remove linux clang build in ci * Only install crossbuild tools on non-aarch64 systems * neaten ci.yml * Correct github matrix * Simplify github matrix * ci wobble * Disable broken test See https://github.com/shader-slang/slang/issues/4589 * ci wobble * Neater slang-llvm archive filename * Neater path for uploading artifacts * Neater ci names * Use Windows SDK 10.0.19041.0 in cmake builds
* Warnings for uninitialized values (#4530)venkataram-nv2024-07-09
| | | | | | | | | | | | | | | | | | | | | | This extends the code for handling uninitialized output parameters. Still needs to handle generic templates and assignment of uninitialized values more carefully. The file containing the relevant code are now in source/slang/slang-ir-use-uninitialized-values.cpp rather than the previous source/slang/slang-ir-use-uninitialized-out-param.h and the top-level function is now checkForUsingUinitializedValues. Additionally a rudimentary test shader has been added for this case, which replaces the old file for out params only; tests/diagnositcs/uninitialized-out.slang becomes tests/diagnositcs/uninitialized.slang. What this does not implement (could be future PRs): * Checking uninitialized fields within constructors * Partially uninitialized values with respect to data structure (e.g. arrays/structs/vector types) * Partially uninitialized values with respect to control flow (e.g. if/else/loop)
* Fix the issue in emitFloatCast (#4559)kaizhangNV2024-07-08
| | | | | | | | | | | | | | | | | | | | | | | * Fix the issue in emitFloatCast In emitFloatCast function, we only considered the input type is float scalar or float vector, so if the input type is a float matrix type, it will crash. We should also handle the float matrix type. Also, we add some diagnose info to point out the source location where there is error happened, so in the future it's easier to tell us what happens. * Add a unit test * Disable the test for metal Metal doesn't support 'double'. " metal 32023.35: /tmp/unknown-YgHAsJ.metal(15): error : 'double' is not supported in Metal matrix<double,int(3),int(4)> b_0 = matrix<double,int(3),int(4)> (a_0); "
* Add vector overloads for or and and (#4529)Ellie Hermaszewska2024-07-05
| | | | | | | | | * Add vector overloads for or and and Closes #4441 and #4434 * Disable cuda checks which use unsupported bool vectors * Add tests for 4531
* Add specializations for 1 vectors in functions using the $N glsl intrinsic ↵Ellie Hermaszewska2024-07-05
| | | | | | placement (#4534) Closes #4533 Fixes part of #4531
* Parse scope for local variable declaration (#4507)Jay Kwak2024-06-28
| | | | | | When a local variable is declaraed, a scope(::) was not properly parsed for its type name. This commit fixes it. Close #4457
* fix `WorkgroupSize()` compiler failiure (#4505)ArielG-NV2024-06-28
| | | | | | | in some cases was not destroying the hoisted to global `WorkgroupSize()` function removed capability requirement on `gl_WorkGroupSize` since no longer appies (kIROp of `WorkgroupSize` is implemented for all targets) change when destroying inst
* Remove returned-array-legalization pass for metal (#4478)ArielG-NV2024-06-27
| | | | | * disable return array optimization pass for metal targets fixes: #4468
* Support atomic intrinsics for Metal (#4473)Jay Kwak2024-06-25
| | | | | | | | | | * Support atomic intrinsics for Metal This commit adds a support for the atomic intrinsics in Metal. The atomic member functions for buffers is not implemented yet. Metal requires the first argument for the atomic functions to be an atomic data type. This implementation rely on the fact that we can do a C-style type casting from a regular data type to an atomic data type.
* Add case to `emitVectorReshape` for when using a `vector<M, N>` type with ↵ArielG-NV2024-06-24
| | | | | | | | | | | | `T` value (#4419) * Add case to `emitVectorReshape` for `vector<>` type, `scalar` value 1. Add new case 2. Add test * fix warning * fix warning
* Disambiguate int type matrix multiply (#4425)Jay Kwak2024-06-20
| | | Closes #4414
* Implement for metal `SV_GroupIndex` (#4385)ArielG-NV2024-06-13
| | | | | | | | | | | | | | | | | | | | | | | | * Implement for metal `SV_GroupIndex` 1. If we don't have `sv_GroupThreadId` available we create one using `SV_GroupIndex`s location data. 2. We emit code emulating `sv_GroupThreadId` from the same logic that CUDA/CPP uses. * address most review comments Addressed all but two: [1](https://github.com/shader-slang/slang/pull/4385#discussion_r1639058473) and [2](https://github.com/shader-slang/slang/pull/4385#issuecomment-2166934855) I want to enable tests and be sure there is no bugs using CI before I redesign the code so I have a working fallback. * address comment, enable tests enable now functioning tests due to `SV_GroupIndex` working with metal * syntax error with groupThreadID search did `= param` instead of `= i.param` * add `sv_groupid` for test + test fixes * disable test that won't work regardless
* Metal: misc fixes and enable more tests. (#4374)Yong He2024-06-13
| | | | | | | | | | | | | | | | | * Fix and enable tests for metal. * Fix. * Fix. * Fix tests. * Fix warnings. * Fix. --------- Co-authored-by: Yong He <yonghe@Yongs-Mac-mini.local>
* SPIR-V `SV_InstanceId` support in pixel shader (#4368)ArielG-NV2024-06-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * solve issue by making 'non SV for SPIRV' system semantics, no longer an SV once diagnosed by slang Problem: 1. SV_InstanceID (HLSL) is allowed as an output semantic with HLSL, it is also allowed for input into pixel shader. We need to account for multiple entry points in 1 file using both of these scenarios at once. 2. SPIRV does not allow `SV_InstanceID` as a builtin, `SV_InstanceID` must be passed as a regular `flat` `Input` from vertex shader. Solution: Slang needs to treat these SV objects as non built-in's. As a result: 1. Slang needs to allocate for vertex output and fragment Input binding slots for all SV_InstanceID uses (if the target is SPIRV). This allows Slang to prepare an open slot to bind these SV objects to. 2. Slang needs to not emit built in modifier for these not actual built in variables (under the specific circumstances described). note: `VarLayout` was made not `HOISTABLE` since I don't believe it needs to be `HOISTABLE`. * The code can be made to work even if `VarLayout` is `HOISTABLE`. * fix compile warnings * address review comments and reimplement operand removal 1. remove an operand by selectively copying operands 2. test to ensure `Flat` is in the test shaders * we do not need to manually add `Flat` in the code since this is done for us in emit-spirv. This is the behavior since `uint` on a fragment `Input` must be `Flat`, else it is a VK validation error. * address review remove clone logic * address review remove unused function reserve instead of setCount with ShortList
* Capability System: Implicit capability upgrade warning/error (#4241)ArielG-NV2024-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * capability upgrade warning/error adjusted implementation + tests to support a warning/error if capabilities are implicitly upgraded and test accordingly. * add glsl profile caps * add GLSL and HLSL capabilities to the associated capability * syntax error in capdef * only error if user explicitly enables capabilities 1. changed testing infrastructure to not set a `profile` explicitly, 2. Added tests to be sure this works as intended with user API and with slangc command line * Change capability atom definitions and how Slang manages them to fix errors 1. most `glsl_spirv` version atoms have been removed from `.capdef`, instead we will translate `spirv` version atoms into `glsl_spirv` since there is no point in writing the same code twice in `.capdef` files to define `spirv` versions. 2. add spirv version, and hlsl sm version (and equivlent) capability dependencies 3. removed some stage requirments which were set on objects, keep the wrapper capabilities. I am keeping the wrapper capabilities since I am unaware on if there are stage limitations (spec says code in practice does not work). * check internal version instead of version profile (_spirv_1_5 vs. spirv_1_5) * remove unused OpCapability. adjust SPIRV version'ing again for glsl_spirv * apply workaround for glslang bug with rayquery usage * ensure capabilities targetted by a profile and added together by a user are valid * remove additions to `spirv_1_*` wrapper * spirv_* -> glsl_spirv fix * fix bug where incompatable profiles would cause invalid target caps * try to avoid joining invalid capabilities * fix the warning/error & printing * run through tests to fix capability system and test mistakes many mistakes were mesh shaders doing `-profile glsl_450+spirv_1_4`. This is not allowed for a few reasons 1. the test tooling does not handle arguments the same as `slangc` 2. glsl_450 core profile does not support mesh shaders, nor does spirv_1_4. sm_6_5 does work in this senario * set some sm_4_1 intrinsics to sm_4_0 * replace `GLSL_` defs with `glsl_` * swap the unsupported render-test syntax for working syntax * set d3d11/d3d12 profile defaults this is required since sm version changes compiled code & behavior * adjusted nvapi capabilities with atomics + d3d11 set to use sm_5_0 as per default * cleanup * address review * incorrect styling * change `bitscanForward` to work as intended on 32 bit targets --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Fix incorrect drop of decoration when translating glsl global var to ↵Yong He2024-06-12
| | | | entrypoint param. (#4353)
* Fix crash on invalid entrypoint varying parameter. (#4349)Yong He2024-06-12
| | | | | * Fix crash on invalid entrypoint varying parameter. * Fix test.
* Fix crash when using optional type in a generic. (#4341)Yong He2024-06-11
|