summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2024-12-09Fix crash during emitCast of attributed type, allow MaxIters to take ↵Yong He
linktime const. (#5791) * Fix crash during emitCast of attributed type. * Allow [MaxIters] to take link time constants. --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-09Fix reflection for pointer element types. (#5797)Yong He
* Fix reflection for pointer element types. * Fix. --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-09Report error on nested functions. (#5792)Yong He
* Report error on nested functions. * Fix. --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-09Fix crash on recursive types. (#5796)Yong He
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-09Add Sampler*Shadow type aliases. (#5789)Yong He
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-06Update slang-ast-decl-ref.cpp (#5786)Sai Praveen Bangaru
2024-12-06Support specialization constant on WGSL and Metal. (#5780)Yong He
2024-12-06Implement explciit binding for metal and wgsl. (#5778)Yong He
* Respect explicit bindings in wgsl emit. * Implement explciit binding generation for metal and wgsl. * Update toc. * Fix warnings in tests. * Fix tests. --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-05Do recursive function checks early during IR linking (#5777)Darren Wihandi
2024-12-05Add API for getting last internal error message (#5772)Simon Kallweit
* Add API for getting last internal error message * format code (#5773) Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> * make message thread_local --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-12-05Add wgsl missing float image format inference (#5716)Devon
* Add missing float image format inference * Drop float4 inference and adjust test * Do wgsl float format fix at emit time * improve formatting * format code --------- Co-authored-by: Yong He <yonghe@outlook.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-05Remove duplicate call to install() for libslang (#5767)Ellie Hermaszewska
Closes https://github.com/shader-slang/slang/issues/5764 Also mention other installed targets in cmake config
2024-12-05Make fvk-invert-y work on mesh shader ouptuts. (#5760)Yong He
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-04Fix a regression that GL_EXT_samplerless_texture_functions is missing (#5758)kaizhangNV
2024-12-03Fix `SpvExecutionModeOutputLinesEXT`. (#5740)Yong He
2024-12-03Add emit logic for `requirePrelude` inst. (#5735)Yong He
2024-12-03Add intrinsics for aligned load/store. (#5736)Yong He
* Add intrinsics for aligned load/store. * Fix. * Update comment. * Implement aligned load/store as intrinsic_op. * Fix. * Add proposal doc. * fix typo.
2024-12-03Conform non-suffixed integer literals (#5717)Darren Wihandi
* Make non-suffixed integer literal type resolution conform to C * Update integer literal tests * Clean up integer literal implementation a bit * Update docs on integer literals * Clean up docs update * Clean up docs update * Add comment on INT64_MIN edge case * Fixed failing test, fixed formatting and cleaned up code --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-12-03Core lib Metal math function fixes (#5738)cheneym2
In order to emit fast target implementations of some Metal-based functions (fmin(), fmax(), fmin3(), fmax3(), fmedian3()) on all targets, remove some specification regarding the handling of NaNs, and also remove the enforcement of the specification. These functions are now documented to be basically undefined now in the presence of NaN input, to make the common "is a number" case fast. Also, clarify that powr() is undefined when given a non-positive base input value, allowing us to remove an additional abs() operation that was unnecessarily coercing results to be predictable on non-Metal targets. Closes #5580 Closes #5581 Closes #5587
2024-12-03Install PDB files when available (#5665)Ellie Hermaszewska
* Install PDB files when available Closes https://github.com/shader-slang/slang/issues/5562 * format code * format code --------- Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-12-02Fix typo in capdef file (#5711)Bruce Mitchener
After #5671, when a build is done, the doc file is regenerated from the capdef file resulting in a changed file in the build tree. Fixing the typo in the capdef file prevents that from happening. Co-authored-by: Yong He <yonghe@outlook.com>
2024-12-02Add `OpPrintf` to non-differentiable insts list (#5718)Sai Praveen Bangaru
2024-12-01[Docs] Minor fixes to auto-diff documentation (#5621)Sai Praveen Bangaru
* Minor fixes to AD documentation * Add a note warning about experimental behavior * Update vulkan --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com> Co-authored-by: Yong He <yonghe@outlook.com>
2024-11-29Emit OpExecutionMode SpacingEqual for Domain stage (#5696)Jay Kwak
Domain stage should emit one more `OpExecutionMode` with `SpacingEqual`, similary to how Hull stage does. Currently Hull stage emits four OpExecutionMode as following: OpExecutionMode %hullMain SpacingEqual OpExecutionMode %hullMain OutputVertices 4 OpExecutionMode %hullMain VertexOrderCw OpExecutionMode %hullMain Quads And Domain stage emits only one OpExecutionMode: OpExecutionMode %domainMain Quads This commit adds the following instruction for Domain stage: OpExecutionMode %domainMain SpacingEqual It is because the Vulkan Validation Layer prints error when the Domain shader didn't have `OpeExecutionMode SpacingEqual`. `SpacingEqual` corresponds to an attribute, `[partitioning("integer")]`, given to the Hull stage. Although Domain stage is not marked with same attribute, it is assumed to use the same value used for matching Hull Stage. The error message from VVL is following: ``` vkCreateShadersEXT(): pCreateInfos[2].stage is VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, but spacing is not specified. The Vulkan spec states: If codeType is VK_SHADER_CODE_TYPE_SPIRV_EXT, and stage is VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, pCode must contain an OpExecutionMode instruction specifying the spacing of segments on the edges of tessellated primitives (https://vulkan.lunarg.com/doc/view/1.3.283.0/windows/1.3-extensions/vkspec.html#VUID-VkShaderCreateInfoEXT-codeType-08874) ``` Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-11-29Support nonuniformEXT for GLSL (#5695)Jay Kwak
Adding nonuniformEXT intrinsic for GLSL Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-11-28wgsl: signedness mismatch fixes (#5692)Anders Leino
* Enable tests/language-feature/enums/strongly-typed-id.slang * Fix operator signedness mismatch issue This helps to address issue #5606. * wgsl: Insert casts for integer type return values This closes #5606. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-11-26WGSL: Fix issue where swizzle L-values are generated (#5682)Anders Leino
* wgsl: Do not generate L-value swizzle expressions * Enable tests/language-feature/swizzles/matrix-swizzle-write-*.slang The following tests are enabled - tests/language-feature/swizzles/matrix-swizzle-write-swizzle.slang - tests/language-feature/swizzles/matrix-swizzle-write-array.slang This closes #5603.
2024-11-26wgpu: Enable Metal-like legalization for byte addressible buffers (#5681)Anders Leino
* Enable hlsl-intrinsic/byte-address-buffer/byte-address-struct * Set byte address buffer legalization options for WGSL
2024-11-25Support interpolation modifiers for WGSL (#5641)Anders Leino
* wgsl: Support interpolation modifiers * Move struct key decorations to flattened structs. ** This includes interpolation mode decorations, which must be in the flattened struct. * Emit interpolation attribute. * Enable tests/render/nointerpolation.hlsl for WGSL, as a result. This closes #5625. * Add new expected output for 'nointerpolation' test
2024-11-25Fix issue where inter-stage parameters without semantics don't get location ↵Anders Leino
attributes (#5670) * wgsl: Make sure each shader input field has a semantic This closes #5633. * Add test for inter-stage variables without semantics This verifies the fix of the second issue identified in https://github.com/shader-slang/slang/issues/5633 * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-11-25wgsl: Fix field semantics even if input struct doesn't need flattening (#5642)Anders Leino
* wgsl: Fix field semantics even if input struct doesn't need flattening Helps to address issue #5633. * Add test for multiple stage IO locations This verifies part of issue #5633.
2024-11-22[AD] Add support for resolving custom derivatives where generic parameters ↵Sai Praveen Bangaru
can't be automatically inferred (#5630) * [AD] Add support for resolving custom derivatives where generic parameters can't be automatically inferred * Fix failing tests * Update custom-derivative-generic.slang
2024-11-22Don't treat StrcturedBuffer<IFoo> as a specializable param. (#5645)Yong He
* Don't treat StrcturedBuffer<IFoo> as a specializable param. * Fix RHI.
2024-11-21Add datalayout for constant buffers. (#5608)Yong He
* Add datalayout for constant buffers. * Fixes. * Fix test. * Fix glsl codegen. * Update spirv-specific doc. * Fix test. * Fix binding in the presense of specialization constants. * address comments. * Add a test for constant buffer layout.
2024-11-21Enable some rendering tests (#5623)Anders Leino
* render-test: Add copy-source usage for render targets I found that Slang-RHI/WGPU was not able to copy from render targets to staging buffers. This helps to address issue #4943. * Add entries to render API util infos Entries for glsl-cross and glsl-rewrite are added. Without glsl-cross, slang-test fails to select a back-end, and winds up crashing when tests/render/cross-compile-entry-point.slang is enabled tests/render/cross-compile0.hlsl fails similarly without glsl-rewrite. * Enable some rendering tests * Add expected test outputs
2024-11-20Change how DeclRef::toText works (#5592)Sai Praveen Bangaru
* Change how DeclRef::toText works We now ignore the decl-ref heirarchy since that only includes nodes with specialization info & simply walk up the tree of decls, while emitting any specializations present in the decl-ref. * Update some tests. Add cases for direct refs to generic params & Lookup decl refs
2024-11-20Add Matrix overload for exp10() core lib function (#5620)bprb
Fixes #5579
2024-11-20Minor core lib doc fixes (#5599)cheneym2
* Minor core lib doc fixes Fixing a couple functions that were missing their categorization. Also cleaned up some trailing spaces. * Update hlsl.meta.slang
2024-11-20WGSL: Support isnan, isinf, etc.. (#5609)Anders Leino
2024-11-19Fix wgsl legalization around __ref parameter. (#5597)Yong He
* Fix wgsl legalization around __ref parameter. * Add intrinsic and test case.
2024-11-19Document math core lib functions (#5594)cheneym2
* Document math core lib functions Closes #5446 * Update hlsl.meta.slang * Update hlsl.meta.slang --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-11-19LanuageServer: fix signature help param range. (#5593)Yong He
2024-11-19Implement semantics for WGSL (#5589)Anders Leino
* Implement semantics for WGSL This helps to address issue #4943. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
2024-11-19Fix specialization constant miscompile in glsl mode. (#5568)Yong He
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-11-18Remove "GL_EXT_samplerless_texture_functions" from combined sampler ↵Yong He
functions. (#5585)
2024-11-18Add `IDifferentiablePtrType` support for arrays (#5576)Sai Praveen Bangaru
* 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
2024-11-15Embed core module in wasm build. (#5569)Yong He
* Embed core module in wasm build. * format code * add uintptr_t case. --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-11-14Insert some casts for WGSL texture attribute queries (#5560)Anders Leino
* 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>
2024-11-14Fix issue with raw default constructors in SPIRV emit (#5556)Sai Praveen Bangaru
2024-11-13Correct include dir for libslang (#5539)Ellie Hermaszewska
This stops adding the repo root to the include path for anything linking with slang. This enabled a bunch of convenient includes, but might lead to confusing behavior for anyone including slang. Not to mention differences including it from an install vs source. Co-authored-by: Yong He <yonghe@outlook.com>