summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2024-12-30Fix requirement candidate lookup to prefer decls in the same paraent as the ↵Yong He
inheritance decl. (#5965)
2024-12-30Skip uninitialized-use warning on hitAttributeEXT-decorated globals (#5952)Julius Ikkala
2024-12-29Prevent constant folding for specialization constants (#5953)Julius Ikkala
2024-12-28Implement HLSL pack/unpack math intrinsics (#5934)Darren Wihandi
2024-12-27Fix parsing GLSL SSBO arrays / bindless descriptors (#5932)Julius Ikkala
* Fix parsing GLSL SSBO arrays / bindless descriptors * Clean up SSBO array parsing * Fix mutable SSBO arrays not being detected as such * Allow sized SSBO arrays * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
2024-12-26Add packed 8bit builtin types (#5939)Darren Wihandi
* Add packed bytes builtin type * fix test
2024-12-24Reflection API Wasm Bindings Part1 (#5936)arya
* add a lot of missing classes, functios and enums * typescript defintion generation * formatting * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-12-21Fixed stage and result field names in json reflection (#5927)Stan
2024-12-20Check subscript/property accessor for differentiability. (#5922)Yong He
2024-12-20Fix crash during loop unrolling. (#5920)Yong He
2024-12-19Add base vertex and base instance system values (#5918)Darren Wihandi
* Add base vertex and base instance system values * Fixed incorrect stage in tests
2024-12-19Add HLSL texture sample with status intrinsics (#5901)Darren Wihandi
* Implement HLSL texture sample with status intrinsics * fix test and cleanup --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-12-19Report error when generated spirv is empty. (#5899)Yong He
* Report error when generated spirv is empty. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-18Fix the parser issue for not recognize Generic<T>[N] (#5912)kaizhangNV
Close #5911. In this issue, if we define the generic in source file 1, and import it into source file 2, then when parsing the reference of that generic in source file 2, we will not parse the generic directly, instead we have a logic to speculate it as generics first with a fake diagnostic sink, and if there is no error report, we will consider it as a actual generic and will parse it again. In this logic, we will also disambiguate the expression based on the following token, but we didn't consider the token '[', so we will finally not treat the expression as generic. The fix is just simply add '[' here. Co-authored-by: Yong He <yonghe@outlook.com>
2024-12-18Check decl nesting for namespaces. (#5910)Yong He
2024-12-18Support explicit `[vk::location(n)]` binding on metal/wgsl. (#5907)Yong He
2024-12-18Fix metadata of register space and varying params. (#5906)Yong He
2024-12-18Allow `Optional`, `Tuple` and `bool` to be used in varying input/output. (#5889)Yong He
* Allow `Optional` and `Tuple` to be used in varying input/output. * Fix. * format code * Fix. * Fix test. * Fix. * enhance test. * Fix. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-12-17Add verification logic on push and specialization constants. (#5887)Yong He
* Add verification logic on push and specialization constants. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-12-17Support specializing generic entrypoints in `findAndCheckEntryPoint`. (#5890)Yong He
2024-12-17Implement bitcast for 64-bit date type (#5895)kaizhangNV
Close #5470 * implement bitcast for 64-bit date type * Move 'ensurePrelude' to base class to remove duplication * Assert on 'double' type for Metal target, as Metal doesn't have 'double' support
2024-12-17Fix entrypoint auto discovery logic. (#5885)Yong He
* Fix entrypoint auto discovery logic. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-12-18Fix `getArgumentValueFloat` when arg is int. (#5888)Yong He
* Fix `getArgumentValueFloat` when arg is int. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-12-16Support matrix negation in metal backend. (#5891)Yong He
2024-12-15Enable exprs for all supported GLSL layout qualifiers (#5857)Darren
2024-12-12Bit extract (#5847)kaizhangNV
* promoting bitfield extraction and insertion to become intrinsics for internal compiler use * removing duplicate intrinsics from glsl.meta.slang * refactor: update function signatures of bitfield extraction and insertion to use uint as the parameter type for offset and bits. --------- Co-authored-by: Nate Morrical <natemorrical@gmail.com> Co-authored-by: Yong He <yonghe@outlook.com>
2024-12-12WGSL: Fix issue where global calls are generated (#5768)Anders Leino
* Split out SPIR-V -specific legalization of global functions This is a refactoring and should not affect generated code. * Move global inst inlining code into separate function This is a refactoring and should not affect generated code. * Take SPIR-V -specific parts out of GlobalInstInliningContext This is a refactoring and should not affect generated code. * Move 'inlineGlobalValues' to generic inlining context This is a refactoring and should not affect generated code. * Move 'setInsertBeforeOutsideASM' to generic inlining context This is a refactoring and should not affect generated code. * Move generic inlining context into own file This is a refactoring and should not affect generated code. * Run global inlining for WGSL as well * Make the 'getOutsideASM' function generic as well * Enable language-feature/constants/static-const-in-generic-interface.slang for WebGPU * Clarify when it's safe to remove and deallocate an IRInst * Remove globals if they're left unused after inlining This closes #5607. * Handle IRGlobalValueRef in C-like emitter * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-12-13Correctly distinguish between windows and MSVC (#5851)Ellie Hermaszewska
Partially sorts https://github.com/shader-slang/slang/issues/5843
2024-12-13Add missing header for _getpid() (#5852)Ellie Hermaszewska
2024-12-12Correct casing of windows includes (#5849)Ellie Hermaszewska
2024-12-11Fix language server check skipping when explicit module decl exists. (#5845)Yong He
2024-12-12Bump spirv-header/tools/glslang (#5834)Ellie Hermaszewska
* Back out "Update SPIRV submodules (#5815)" This backs out commit e50aac13e2c161d672b137a62f6d66820d0f9ff1. * Use upstream spirv-tools * Fix bump-glslang.sh for newer versions of spirv-tools * Use upstream glslang * Add --do-fetch option to bump glslang * Bump glslang and friends Supersedes https://github.com/shader-slang/slang/pull/5815 * Regenerate glslang and spirv-tools outputs * Fixes to slang-glslang * Correct spirv intrinsic for OpImageSampleFootprintNV Note that this currently fails validation with the following error: ``` error: line 145: Result <id> from OpSampledImage instruction must not appear as operand for OpImageSampleFootprintNV, since it is not specified as taking an OpTypeSampledImage. Found result <id> '55[%sampledImage]' as an operand of <id> '56[%resultVal]'. %sampledImage = OpSampledImage %54 %51 %40 ``` This seems to be in error as the spec for *SPV_NV_shader_image_footprint* states that "Sampled Image must be an object whose type is OpTypeSampledImage" https://refined-github-html-preview.kidonng.workers.dev/KhronosGroup/SPIRV-Registry/raw/refs/heads/main/extensions/NV/SPV_NV_shader_image_footprint.html glslang also seems to fail with the same validation error * Fix spv storage class test
2024-12-11LSP: fix "documentSymbol failed" error. (#5842)Yong He
2024-12-11Fix the logic to determine whether lower generic pass should run. (#5837)Yong He
2024-12-11Fix loop hoisting logic in redundancy pass. (#5836)Yong He
* Fix fast single iteration loop test in redundancy pass. * Fix.
2024-12-11Fix attribute reflection. (#5823)Yong He
* Fix attribute reflection. * Fix. * Fix.
2024-12-11Update SPIRV submodules (#5815)Jay Kwak
* Update SPIRV submodules With the latest SPIR-V submodules, one of tests started failing: tests/gpu-feature/texture/query/footprint/nv-shader-texture-footprint.slang [ForceInline] is added to GLSL texture functions in order to inline %true and %false. Without it, the value was indirectly passed down via a function parameter, which broke the existing test. Also the test is modified to use -DAG, because the order unpredictably changed for Grad variants due to additional [ForceInline] marks for Gradient functions. A new validation check in SPIRV-Tools was causing a validation error: ``` error: line 324: [VUID-StandaloneSpirv-OpTypeImage-06924] Cannot store to OpTypeImage, OpTypeSampler, OpTypeSampledImage, or OpTypeAccelerationStructureKHR objects OpStore %17 %242 ``` It appears that this is a bug on SPIRV-Tools. A proper fix is proposed to Khronos/SPIRV-Tools: https://github.com/KhronosGroup/SPIRV-Tools/pull/5914 But this commit uses `shader-slang/SPIRV-Tools/fix_for_OpImageSampleFootprintNV` with a custom fix as a temporary solution: https://github.com/shader-slang/SPIRV-Tools/tree/fix_for_OpImageSampleFootprintNV
2024-12-11Fix anyvalue marshalling for matrix and 64 bit types. (#5827)Yong He
* Fix anyvalue marshalling for matrix types. * Add support for 64bit types marshalling. --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-11Fix wgsl float texture format inference silent failure (#5831)Devon
2024-12-10Enable exprs for GLSL binding layout qualifiers (#5807)Darren
* Allow glsl set and binding layout qualifiers to be compile time integer exprs * add new tests * add comments * cleanup on asserts * addressed review comments and cleanup * fix missing set expr in test * fixed tests and cleanup --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-12-10Create scope for synthesized property decl. (#5817)Yong He
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-10Fix a crash when search for files. (#5818)Yong He
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-10Don't emit a warning when implicit casting from known in-range int lit to ↵Yong He
half. (#5814) Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-10Fix parsing logic of for loops' initial statement. (#5813)Yong He
2024-12-09Add SV_DrawIndex. (#5787)Yong He
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-09Allow pointers to existential values. (#5793)Yong He
* Fix pointer offset logic and add executable tests. * Fix. * Fix test. * Add existential ptr test. * Allow pointers to existential values. * Fix. * Fix. --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
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>