summaryrefslogtreecommitdiffstats
path: root/source
Commit message (Collapse)AuthorAge
...
* Add `vk::offset` to specify member offsets for push constants (#6797)Darren Wihandi2025-04-21
| | | | | | | | | | | | | * Add struct member offset qualifier for SPIRV * Implement for GLSL target and add tests * clean up * fix formatting * fix typo * renamed GLSLStructOffset to VkStructOffset and added emit-spirv-via-glsl test case
* Fix quad control required SPIRV version for emit-spirv-via-glsl (#6869)Darren Wihandi2025-04-21
| | | Co-authored-by: Yong He <yonghe@outlook.com>
* Allow simplifying self-referential Phi parameters (#6870)Julius Ikkala2025-04-21
|
* Implement 64bit countbits intrinsic (#6433) (#6845)sricker-nvidia2025-04-19
| | | | | | | | | | | | | Change modifies the countbits intrinsic to use generics in order to support 64bit countbits on select platforms where this is supported. On platforms where this is not natively supported, we emulate by converting the 64-bit type into a uint2 (metal and spir-v). This should align with the implementation of other uint64_t intrinsics such as abs, min, max and clamp. Added new countbits64 test to verify changes. Updated documentation for 64bit-type-support.html
* Fixed crash in slang-ir-autodiff-loop-analysis.cpp (#6831)Ronan2025-04-18
| | | | | | | | | | | * Added Dictionary::erase(iterator) and fixed crashing when filtering a dictionary in slang-ir-autodiff-loop-analysis.cpp * Added Dictionary::removeIf(Predicate) * Removed Dictionary::erase(it) --------- Co-authored-by: Julius Ikkala <julius.ikkala@gmail.com>
* Fix regression in partial specialization of existential arguments (#6818)kaizhangNV2025-04-17
| | | | | | | | | | | | | | | | | | | | | | Close #6589. In PR #6487, we support partial specialization. However there is a corner case we didn't handle correctly. For the IR like this: %val: specialize(...) = some inst; %arg1: specialize(...) = makeExistential(%val, ...); %arg2: %SomeConcreteType: load(...); call func(%arg1, %arg2); when we specialize the call func instruct, we will also specialize the function parameters. On our existing logic, when we find an argument is a makeExistential, we will always extract the existential value, and use its type as the new parameter. But in this case, %arg1 is not fully specialized yet, so it's type will still be a specialize. In this case, we will change the function's first parameter from an existential type to a specialize. This will result in that we lose the chance to specialize the first argument in the next iteration, because the first parameter of this function is not an existential type any more. The reason behind this is that we should always keep specializing the arguments and parameters at the same time. So this PR just does a check before specializing the parameters that if the argument cannot be fully specialized, we won't specialize the parameter this early. Instead, we will wait for the next iteration until the argument can be specialized.
* Add Yet Another Source Code Generator (#6844)Theresa Foley2025-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add Yet Another Source Code Generator This change introduces an offline source code generation tool, provisionally called `fiddle`. More information about the design of the tool can be found in `tools/slang-fiddle/README.md`. Yes... this is yet another code generator in a project that already has too many. Yes, this could easily be a very obvious instnace of [XKCD 927](https://xkcd.com/927/). This change is part of a larger effort to change how the AST types are being serialized, and the way code generation for them is implemented. Right now, the source code for the new tool is being checked in and the relevant build step is enabled, just to make sure everything is working as intended, but please note that this change does *not* introduce any code in the repository that actually makes use of the new generator. All of the AST-related reflection information that feeds the current serialization system is still being generated using `slang-cpp-extractor`. The design of the new tool is primarily motivated by the new approach to serialization that I'm implementing, and once that new approach lands we should be able to deprecate the `slang-cpp-extractor`. In addition, the new tool should in principle be able to handle many of the kinds of code generation tasks that are currently being implemented with other tools like `slang-generate` (used for the core and glsl libraries). This tool should also be well suited to the task of generating more of the code related to the IR instructions. * format code * Build fixes caught by CI * Fix another warning coming from CI * Another CI-caught fix * Change bare hrows over to more proper abort execptions * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Eliminate back-reference in ChildStmt (#6835)Theresa Foley2025-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Eliminate back-reference in ChildStmt This change is part of a larger effort to improve the code for AST serialization in the Slang compiler. Tree structures are understandably easier to serialize than DAGs, and DAGs are easier than fully generaal graphs. The Slang AST nodes form a tree structure... except when they don't. Among the exceptions to nice tree-structured ASTs are: 1. References to `Decl`s are encoded as pointers to the AST `Decl` nodes themselves. This can result in cycles in the graph, and requires care in serialization. 2. Nodes that inherit from `Val` represent, well, *values* instead of actual pieces of syntax, and as such they are deduplicated so that identical values will (hopefully) be identical pointers. This results in a DAG structure for `Val`s, but at least it's not a general graph (except for cycles that go through a `Decl`). 3. There are some minor cases of DAG-structured sharing that the parser can introduce to deal with cases when a traditional-style declaration includes multiple declarators. E.g., given: ``` static int a, b; ``` The resulting `DeclGroup` will include distinct `Decl`s for `a` and `b`, which will share the `static` modifier through a `SharedModifiers` node, and the `int` type specifier through a `SharedTypeExpr` node. This duplication can be ignored, for the purposes of serialization, since duplicating those parts of the AST has no major down-sides. 4. There is the case of `ChildStmt`, used for things like `break` and `continue`, which stores a direct `Stmt*` to the enclosing parent statement being targetted. Storing the target is useful so that IR lowering doesn't need to repeat the work that the semantic checking logic did to associate each child statement with its parent. The parent link inside of `ChildStmt` creates a cycle in the AST `Stmt` hierarchy, since the outer statement contains the inner, and the inner statement stores a pointer to the outer. This change eliminates the last of these sources of complication for AST serialization, by changing the `ChildStmt` type to stored an integer ID for the enclosing statement that it matches to, and having each `BreakableStmt` (used to represent the outer `switch`, or loop, or whatever) generate its own unique ID as part of semantic checking. Note: if necessary, it is reasonable for the outer statement to have its unique ID generated as part of parsing, rather than semantic checking. * format code * Change unique ID to be a proper Decl The fix here is to make the "unique ID" representation be a full `Decl`-derived AST node, so that it is both allowed to break the tree-structuring rules cleanly, and it is also trivially guaranteed to be unique across all loaded ASTs. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Fix compiler warning with clang 18.1.8 on windows (#6843)Jay Kwak2025-04-17
| | | * Fix compiler warning with clang 18.1.8 on windows
* Fix SV_InstanceID for emit-spirv-via-glsl path (#6848)Darren Wihandi2025-04-17
|
* Remove support for ad hoc Slang IR compression (#6834)Theresa Foley2025-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove support for ad hoc Slang IR compression This change is part of a larger effort to clean up the approach to serialization in the Slang compiler. The overall goal is to simplify and streamline all of the serialization-related logic, so that we are left with code that is less "clever," and easier to understand for contributors to the codebase. Removing support for compression of serialized Slang IR has benefits that include: * Reduction in code complexity: consider things like the subtle way that the `FOURCC`s for compressed chunks were being computed from the uncompressed versions, and the mental overhead that goes into understanding that, for anybody who would dare to touch this code. * Reduction in testing burden: there have been, de facto, two very different code paths for serialization of the Slang IR, and it is not clear that the existing test corpus for Slang has sufficient coverage for both options. By having only a single code path, every test that performs any amount of IR serialization helps with test coverage of that one path. * Opportunity to explore alternatives. This is perhaps a reiteration of the first point, but once the code is stripped down to the simplest thing that could possibly work (I am not claiming it has reached that point yet), it becomes easier for contributors to understand, and it becomes more tractable for somebody to come along with an improved approach that performs better (in either compression ratio or performance) while still being maintainable. In my own local setup, I found that removing support for Slang IR compression led to the `slang-core-module-generated.h` file increasing in size from 46.1MB to 47.4MB. This increase in the `.h` file size for the core library binary only resulted in a release build of `slang.dll` increasing from 20.0MB to 20.2MB. Removing the ad hoc compression support has almost no impact on the size of actual binary Slang modules *so long* as the additional LZ4 compression step is being applied to them. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Use the latest Ubuntu version not specific old version (#6825)Jay Kwak2025-04-15
| | | | * Use the latest Ubuntu version not specific old version
* Add cooperative matrix 1 support (#6565)Darren Wihandi2025-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * initial wip for spirv * working tiled example * clean up store and load * minor fixes * fix loadAny name * add initial tests, including broken/unimplemented intrinsics * fix subscript * run tests at 16x16, remove not supported arithmetic tests * minor fixups on implementation * rename CoopMatMatrixUse * Update tests to pass validation layers locally * Add mat-mul-add test and minor fixes * Add more tests * Remove dead code * Add coopMatLoad function and tests, enforce constexpr for matrix layout * Use getVectorOrCoopMatrixElementType in place of getVectorElementType
* Document CoopVec functions (#6777)Jay Kwak2025-04-15
| | | | | | Documenting CoopVec related functions. This commit also fixes a few warning printed from the doc generation tool. Some of comments are removed or converted from /// to //, because the overloading functions can have /// style comment only once.
* Consume `;` after parsing typedef decl. (#6759)Yong He2025-04-14
| | | | | | | * Consume `;` after parsing typedef decl. * Fix. * Fix regressions.
* Fix matrix division by scalar for Metal and WGSL targets (#6752)Darren Wihandi2025-04-14
| | | | | | | | | | | | | | | | | * Fix matrix division by scalar for Metal and WGSL targets * Add tests * Minor fix * Fix compilation error * Convert to multiplication for WGSL * Minor cleanup --------- Co-authored-by: Yong He <yonghe@outlook.com>
* try to find cuda headers in /usr/include (#6800)Simon Kallweit2025-04-14
| | | | Co-authored-by: Simon Kallweit <simon.kallweit@gmail.com> Co-authored-by: Yong He <yonghe@outlook.com>
* Fix User Attribute string reflection (#6799)Devon2025-04-14
| | | | | | | | | | | * Fix User Attribute string reflection Fixes #6794 * Fix strings not being properly escaped --------- Co-authored-by: Darren Wihandi <65404740+fairywreath@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
* Add SV_PointCoord to match gl_PointCoord (#6795)Julius Ikkala2025-04-14
| | | | | | | | | | | * Add gl_PointCoord support in GLSL compat mode * Add SV_PointCoord * Test on metal as well * Update SPIRV system value semantics table in docs * Update metal docs for SV_PointCoord
* Fix pointer field/member access for GLSL (#6798)Darren Wihandi2025-04-13
| | | | | | | | | * Fix pointer field access for GLSL * Add test * Fix SPIRV test * add spirv via glsl test
* Add flag to hoist instructions (#6740)jarcherNV2025-04-11
| | | | | | | | | This fixes issue #6654 Only hoist instructions that are optimized by prepareFuncForForwardDiff. Add flag hoistLoopInvariantInsts to IRSimplificationOptions and set this to true only if called from prepareFuncForForwardDiff, then only hoist if the flag is set. Additionally, do not hoist loops if they only have a single trivial iteration.
* Add a more specific diagnostic message when passing concrete value to ↵Julius Ikkala2025-04-11
| | | | | | | | | interface-typed output parameter (#6788) * More specific diagnostic for invalid concrete-to-interface arg coercion * Add test for the new error message * Fix typo in expected test result
* Fix downstream compiler locale (#6734)Julius Ikkala2025-04-10
| | | Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
* Get real value for typeAdapter (#6762)Gangzheng Tong2025-04-09
| | | | | | | | | | | | | * Get real value for typeAdapter When the type is mismatch and typeAdapter is used, get the real value from typeAdapter so that we don't get nullptr for irValue. This fixes the assert if uint is used for SV_VertexID, which is an int in the system binding semantic. Fixes: #6525 * Add test case; add nullptr check
* void field rework (#6739)kaizhangNV2025-04-09
| | | | | * void field rework * move void cleanup pass earlier
* warn when the user puts a file extension in an implementing directive (#6757)Ellie Hermaszewska2025-04-08
| | | Closes https://github.com/shader-slang/slang/issues/5995
* Return non-escaped strings from user-defined attributes (#6735)aidanfnv2025-04-07
| | | | | | | | | Fixes #6624 This commit changes the behavior of getArgumentValueString() to return the string's value, instead of returning the string's token, as that token also contains the surrounding quotation marks. This commit also modifies the relevant unit test accordingly, to not check for the surrounding quotations.
* Support for Payload Access Qualifiers (#3448) (#6595)Harsh Aggarwal (NVIDIA)2025-04-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add support for Ray Payload Access Qualifiers (PAQs) (#3448) - Added [raypayload] attribute for struct declarations - Implemented field validation requiring read/write access qualifiers - Added diagnostic error for missing qualifiers - Enabled PAQs in DXC compiler and HLSL emission - Added new test demonstrating PAQ syntax - Implemented proper handling of ray payload attributes in IR generation * format code * Cleanup: Remove unused vars * Add check to enablePAQ only for profile >= lib_6_7 * Review Fix - Add PAQ support for DX Raytracing add enablePAQ flag to DownstreamCompileOpitons, improve PAQ handling update raypayload-attribute-paq.slang to ensure hlsl and dxil is validated * Add diagnostic test for missing paq for lib_6_7 Compile using `-disable-payload-qualifiers` aka lib_6_6 profile raypayload-attribute-no-struct.slang and raypayload-attribute.slang --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
* Add defer statement (#6619)Julius Ikkala2025-04-06
|
* Fix crash when using GLSL global uniforms and varying inputs/ouputs together ↵Darren Wihandi2025-04-05
| | | | | | | | | | | | | | | | | | | | | (#6651) * Fix incorrect assert on mixed global uniform and varyings * add test * remove unnecessary include * fix incorrect logic * fix comment grammar * address review comments and improve test * minimize diff * fix more issues for cuda build * remove unnecessary line for diff
* Implement subgroup quad operations for Metal (#6745)Darren Wihandi2025-04-04
|
* Add a loop analysis step to infer the exit values of loop phi parameters. ↵Sai Praveen Bangaru2025-04-04
| | | | | | | | | | | | | | | | | | | | | | | | | (#6696) * Initial loop analysis pass * More changes for a single-pass implication propagation * Update slang-ir-autodiff-loop-analysis.cpp * Cleanup + new system for loop analysis * Fixup bugs in loop analysis * Remove some relation types to simplify the analysis. Add test * Remove unused * Address comments * Fix issue with continue loops * Update reverse-loop-exit-value-inference-1.slang * Update reverse-continue-loop.slang
* Do no fail on missing no_diff annotation on non-differentiable (inputs and ↵Ellie Hermaszewska2025-04-04
| | | | | output) function outputs (#6737) Closes https://github.com/shader-slang/slang/issues/6632
* Add sparse texture Load intrinsic for SPIRV (#6702)DarrelFW3212025-04-03
| | | | | | | | | * Implement sparse texture Load intrinsics for SPIRV * changed test name from TEST_load to TEST_sparse --------- Co-authored-by: Darren Wihandi <65404740+fairywreath@users.noreply.github.com>
* Fixed generic interface specialization crashes (#6601): (#6688)Ronan2025-04-03
| | | | | | | | | | | | | | | | | | | | * Fixed generic interface specialization crashes: - Add an export decoration to specialized generic interfaces. * Fixed generic interface specialization crashes: - Add an export decoration to specialized generic interfaces. - Use getTypeNameHint(...) instead of a manual mangler. * In cloneInstDecorationsAndChildren: specialize all linkage decorations, not just the exports. - If a linkage decoration is already present, it is not specialized and replaced by the specialized one. - If a specialization uses the TypeNameHint, sanitize it to be used as an identifier. - Use the identifier name sanitizer from slang-mangle. * Added tests/generics/generic-interface-linkage.slang - See #6601 and #6688
* Metal remove void field (#6725)kaizhangNV2025-04-02
| | | | | | | | | | | | | | * Reapply "Eliminate empty struct on metal target (#6603)" (#6711) This reverts commit bc9dc6557fc0cc3a4c0c2ff27e636940e361cf5d. * Remove argument in make_struct call corresponding to void field This is a follow-up of #6543, where we leave the VoidType field as it in make_struct call during legalization pass. So during cleaning_void IR pass, when we remove "VoidType" from struct, we will have to also clean up the argument corresponding to the "VoidType" field.
* Enable "-HV 2021" option for DXC (#6445)Jay Kwak2025-04-02
| | | * Enable "-HV 2021" option for DXC
* Use correct syntax for WGSL array transpiling (#6693)jarcherNV2025-04-02
| | | | | | Fixes issue #6533 This patch updates handling of Array and ConstantBuffer types for WGSL transpiling, giving correct syntax for arrays of buffers in WGSL.
* Add GetDimensions support for CUDA (#6718)Mukund Keshava2025-04-01
| | | | | | | | | | | | | | | | | * Add GetDimensions support for CUDA This CL adds GetDimensions support for cuda by using the PTX instructions. Currently, PTX only supports getting width, height and depth. This CL also adds a new test to test this support. Fixes #5139 * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Make IRWitnessTable HOISTABLE (#6417)Jay Kwak2025-04-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # Make `IRWitnessTable` Hoistable ## Intention of the PR This commit makes `IRWitnessTable` Hoistable so that we can avoid duplicated `IRWitnessTable`. ## Problems This commit tries to address the following issues arise after turning `IRWitnessTable` into Hoistable: 1. A Hoistable instance is immutable. 2. When tries to create a duplicated child, you will get a previously created instance of `IRWitnessTable`, instead of a new one. 3. We don't actually want to hoist `IRWitnessTable`. 4. There can be only one instance of Hoistable and it cannot appear as childs multiple times. 5. Different import/export mangled names were used for the same Witness-table when its type is "enum" interface. ## Implementation ### Solution for "1. A Hoistable instance is immutable." `IRWitnessTable::setConcreteType()` is removed, because when an `IRInst` is Hoistable, it is treated as immutable. Any `IRInst::setXXX()` methods don't work anymore. There were two places calling `setConcreteType()` and their logic had to change little bit. `DeclLoweringVisitor::visitInheritanceDecl()` in `source/slang/slang-lower-to-ir.cpp` was calling `setConcreteType()`. It had a little strange logic around `lowerType()`. The `IRWitnessTable` was added with `context->setGlobalValue()` first and its `concreteType` was changed later. This commit works around in a way that it sets the parent of `IRWitnessTable` temporarily and reset it with the correct `IRWitnessTable`. Without this logic, it went into an infinite recursion. `AutoDiffPass::fillDifferentialTypeImplementation()` in `source/slang/slang-ir-autodiff.cpp` was calling `setConcreteType()`. It was changing the concreteType of `innerResult.diffWitness`. This commit creates a new `IRWitnessTable` and copies its `IRWitnessTableEntry`. ### Solution for "2. When tries to create a duplicated child, you will get a previously created instance of IRWitnessTable, instead of a new one" After a call to `IRBuilder::createWitnessTable()`, this commit checks if the returned `IRWitnessTable` is a brand new or not. If it is not a new one, we have to avoid adding the decorations and children. This commit decides when to add decorations and children based on whether `IRWitnessTable` has any of decorations or children already. It doesn't seem like a proper way to check. But when I tried, it was difficult to find a bottleneck point where the decorations and children are added to `IRWitnessTable` first time. Note that we are not trying to find when `IRWitnessTable` is created for the first time; we need to find if the decorations and children were added once. It might be fine to have duplicated `IRWitnessTableEntry` in most of the cases, but I noticed that it fails an assertion check when `shouldDeepCloneWitnessTable()` returns false in `cloneWitnessTableImpl()`. ### Solution for "3. We don't actually want to hoist IRWitnessTable." The reason why this commit makes `IRWitnessTable` is to prevent the duplicated instances of `IRInst`. But we don't really want to "Hoist" them. When an `IRWitnessTable` gets Hoisted out, it causes unexpected problems and the specialization process fails due to the missing `IRWitnessTable` in the input. This commit prevent from hoisting `IRWitnessTable` in `_replaceInstUsesWith()`. The way this is implemented feel little hack but we discussed on Slack and decided to go with this. One of the proper approaches could be to add a new flag in `IROpFlags` and have a new one like `kIROpFlag_Deduplicate`, which is different from just `kIROpFlag_Hoistable`. ### Solution for "4. There can be only one instance of Hoistable and it cannot appear as childs multiple times." When `IRWitnessTable` is Hoistable, there can be only a unique set of instances. And we cannot have an instance as a duplicated childs. It is because `IRInst` has only one set of `IRInst* next` and `IRInst* prev`. Before this commit, an instance of `IRGeneral` could have duplicated instances of `IRWitnessTable`. As an example, `IInteger` interface inherits two other interfaces, `IArithmetic` and `ILogical`. And they both inherits from `IComparable`. ``` interface IInteger : IArithmetic, ILogical {} interface IArithmetic : IComparable {} interface ILogical : IComparable ``` When we specialize it in `specializeGenericImpl()`, an `IRBlock` gets the following list of children: - IRWitnessTable for IComparable, - IRWitnessTable for IArithmetic, - IRWitnessTable for IComparable, - IRWitnessTable for ILogical, For the cloning during the specialize, "IRWitnessTable for `IComparable`" must be cloned before the cloning of "IRWitnessTable for `IArithmetic`". Because "IRWitnessTable for `IArithmetic`" refers "IRWitnessTable for `IComparable`" as its `IRWitnessTableEntry`. The order they appear in the `IRBlock` as children decides which instances will be cloned first. And "IRWitnessTable for `IComparable`" must appear before "IRWitnessTable for `IArithmetic`". Note that "IRWitnessTable for `IComparable`" appears twice, The first one was added for "IRWitnessTable for `IArithmetic`". And the second one is added for "IRWitnessTable for `ILogical`". With this commit "IRWitnessTable for `IComparable`" can appear as a child only once in `IRBlock`. So it causes an error if it gets the following list: - IRWitnessTable for IArithmetic, - IRWitnessTable for IComparable, - IRWitnessTable for ILogical, In order to resolve the problem, "IRWitnessTable for `IComparable`" must appear before both "IRWitnessTable for `IArithmetic`" and "IRWitnessTable for `ILogical`" as following: - IRWitnessTable for IComparable, - IRWitnessTable for IArithmetic, - IRWitnessTable for ILogical, To address the problem, the instances of `IRWitnessTable` is always added to the end of the children list. If it is already added to the list, we don't move. This works out because the AST tree is built based on the dependencies. ### Solution for "5. Different import/export mangled names were used for the same Witness-table when its type is "enum" interface." This issue was found while testing with Falcor tests where it uses Conformance-type feature of Slang. We are using different import and export mangled names for a same Witness-table when the witness-table is for "Enum" interface. The way we simplify the implementation of "Enum" causes a problem when it comes to generate export/import for the witness-table. And the exact repro step is still unclear. There were two suggested solutions for the problem and this PR adopted the first option for now. Maybe we want to improve it with the second option later. option 1, when we produce mangled names for those witness-table, we can use a mangled name with the underlying "int" type instead of the name of the enum type. In this way, all witness-tables for enum types whose underlying type is same will get the same mangled name. It will allow us to deduplicate the witness-table during the linking. option 2, we can preserve type info for enum type when generating IR. We can still erase all other uses of the type info of enum types for now. But when we generate the witness-table, instead of filling the conforming type operand to IntType, we fill it as EnumType(IntType) where EnumType is a new global IROp code to represent all enum types (like InterfaceType/StructType). This way the operands for the two witness-tables will be different. "option 1" is more quick and dirty and "option 2" is more proper way to address it. I should go with "option 1" and improve it with "option 2" approach later.
* Fix compilation of global builtin variables inside generics (#6701)Darren Wihandi2025-04-01
| | | | | * Include generics' operands in call graph construction * add test
* Revert "Eliminate empty struct on metal target (#6603)" (#6711)Jay Kwak2025-03-31
| | | This reverts commit b3deec2001ea34e20e9a6af8ddf5cf3866cafac0.
* findAndValidateEntryPoint should return null on failing (#6695)kaizhangNV2025-03-26
| | | | | | close #6694 We should return nullptr when findAndValidateEntryPoint fails to valid the entrypoint.
* Eliminate empty struct on metal target (#6603)kaizhangNV2025-03-26
| | | | | | | | | | | | | | * Eliminate empty struct on metal target Close 6573. We previously disabled the type legalization for ParameterBlock on Metal, but Metal doesn't allow empty struct in the argument buffer which is mapped from ParameterBlock, so we will need legalizeEmptyTypes on Metal target. * update test * update function name
* Fix SPV_KHR_maximal_reconvergence extension name spelling (#6687)Pavel Asyutchenko2025-03-26
| | | | | | | * Fix SPV_KHR_maximal_reconvergence extension name spelling Vulkan validation layers emit warnings on lowercase khr. * Move OpExtension check
* Fix mul operator followed by global scope (#6686)Gangzheng Tong2025-03-25
| | | | | | | | | | | | | | | * Fix mul operator followed by global scope This should fix expr like `2.0f * ::a::b::c`. But it will no longer parse something like ``` extension<T> Ptr<T> { static void foo(); } int*::foo() // won't work, but this is a less common case ``` Fixes #6684 * Update simpe-namespace.slang to test global scope
* Fix issue in peepholeOptimize (#6543)kaizhangNV2025-03-25
| | | | | | | Close #6541. Previously in type legalization pass, we skip the VoidType field when call make_struct, however in some optimization pass we keep counting the VoidType field. We have to make this behavior consistently over all our codebase. So in this change, we spot the make_struct call and leave VoidType field as it.
* Don't load cached builtin module in slang-bootstrap. (#6667)Yong He2025-03-24
| | | | | | | | | | | * Don't load cached builtin module in slang-bootstrap. * Fixes. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Add debugPrintfEXT support (#6659)Darren Wihandi2025-03-22
|
* Add GLSL array length syntax support (#6665)DarrelFW3212025-03-22
|