summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2024-06-12Fix incorrect drop of decoration when translating glsl global var to ↵Yong He
entrypoint param. (#4353)
2024-06-12Fix crash on invalid entrypoint varying parameter. (#4349)Yong He
* Fix crash on invalid entrypoint varying parameter. * Fix test.
2024-06-12Implicit register binding for hlsl to non-hlsl targets (#4338)ArielG-NV
* implicit register binding for hlsl to non-hlsl targets * fix regressions only warn once with `_maybeDiagnoseMissingVulkanLayoutModifier` remove unneeded else * address review and change bindings address review comments on testing to make the tests indiscriminate over order of code emitted. Change bindings to 1:1 map to vulkan bindings * don't set bindings 1:1 with vulkan if command line option was added --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-06-12Fix duplicate SPIRV decorations. (#4346)Yong He
* Fix duplicate `DescriptorSet` decorations. * Fix duplicate `Block` decoration.
2024-06-12Add option to preserve shader parameter declaration in output SPIRV. (#4344)Yong He
* Add option to preserve shader parameter declarations in output. * Add test.
2024-06-11Fix crash when using optional type in a generic. (#4341)Yong He
2024-06-11Fix global value inlining for spirv_asm blocks. (#4339)Yong He
2024-06-11SPIRV backend: add support for tessellation stages, (#4336)Yong He
2024-06-11Test more texture types in Metal (#4333)Jay Kwak
This commit adds testing for Metal texture functions with the following six types that the document says supported: - float - half - int32_t - uint32_t - int16_t - uint16_t Co-authored-by: Yong He <yonghe@outlook.com>
2024-06-11Support integer typed textures for GLSL (#4329)Jay Kwak
* Support integer typed textures for GLSL This commit re-enables the ability to sample from an integer typed texture for GLSL functions while keeping it unavailable for HLSL target.
2024-06-11Fix `GetAttributeAtVertex` for spirv and glsl targets. (#4334)Yong He
2024-06-10Address glslang ordering requirments for 'derivative_group_*NV' (#4323)ArielG-NV
* Address glslang ordering requirments for 'derivative_group_*NV' fixes: #4305 The solution is to emit some `layout`s after a module source is emitted. Added to slangs gfx backend code to enable the compute shader derivative extension for testing purposes. * address review * enable removed test --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-06-10Partial implementation of static_assert (#4294)Jay Kwak
* Error out for types not supported by texture sample functions This commit prints errors with a new keyword, `static_assert`, when the given texture type is not supported for the target. * Moving the check to linkAndOptimizeIR after specialization is done * Remove unnecessary change * Adding test * Remove kIROp_StaticAssert once processed * Do not remove StaticAssert because it is needed for the next specialization * Remove after iteration of child is done --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-06-10Fix SPIRV emit for `Flat` decoration and TessLevel builtin. (#4318)Yong He
2024-06-10Support all integer typed indices in StructuredBuffer Load/Store/[]. (#4311)Yong He
* Support all integer typed indices in StructuredBuffer Load/Store/[]. * Fix tests. --------- Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com>
2024-06-10[gfx] Metal graphics support (#4324)skallweitNV
* fix double semicolons * fix another double semicolon * wait for init data upload * remove obsolete setData * refactor swapchain to work on virtual back buffers * buffer/texture use breakable device reference * refactor input layout * create render command encoder * add todo * refactor framebuffer layout * refactor framebuffer * refactor shader program * translatePrimitiveType * add more translate functions * refactor framebuffer * refactor render pass * implement graphics pipeline state * add depth stencil state * initial render command encoder support * comment
2024-06-08SPIRV `Block` decoration fixes. (#4303)Yong He
* SPIRV `Block` decoration fixes. - SPIRV does not allow duplicate `Block` decorations. So we shouldn't be generating them. - Also fixes duplication of OpName. - SPIRV and HLSL do not allow ConstantBuffer with trailing unsized arrays. Added a check in the front-end against such code. * Convert failing cross-compile tests to filecheck. --------- Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com>
2024-06-08Disallow certain types of decls in `interface` to provide better diagnostic ↵Yong He
message. (#4312)
2024-06-08Metal system value overhaul. (#4308)Yong He
2024-06-07Support HLSL `.mips` syntax. (#4310)Yong He
2024-06-07Small SPIRV emit cleanup around vector element extract. (#4309)Yong He
2024-06-07Precompute UIntSet from individual capabilities inside generator (#4269)ArielG-NV
* fixes: #4163 Precompute UIntSet from individual capabilities inside generator (removes intermediate form of capabilities). note: 1. I still expand capabilities which are missing `target` and `stage` atoms. * fix compile warning<->error with clang * address review preallocate the pregenerated UIntSet's * disable incorrect warning of 'unreachable code' The warning is wrong since, when `out` has 0 elements (does not start `for` loop), the `return` is reached. * fix clang warnings 1. use unsigned long for the buffer serializer 2. braces around scalar init * address review added work around to avoid warning with `for(...) return; return;` pattern `else if constexpr` addition instead of cascading blocks * push fix for use of `_BitScanForward` * cleanup * move around assert for proper checking * syntax error * use SLANG_ASSERT instead of assert * test for why SLANG_ASSERT caused CI to fail with linux-arm builds * test if `SLANG_ASSERT` really is causing a build issue for linux-arm
2024-06-07Metal compute tests (#4292)skallweitNV
2024-06-06Fix build warnings and treat warnings as error on CI (#4276)Jay Kwak
* Fix build warnings and treat warnings as error
2024-06-06Remove unnecessary call to __requireComputeDerivative (#4283)Jay Kwak
* Remove unnecessary call to __requireComputeDerivative When SPIR-V uses operators whose name has a keyword, "Implicit", they require calling a function "__requireComputeDerivative()". When it uses "Explicit", the function doesn't need to be called.
2024-06-06work on gfx metal backend (#4287)skallweitNV
* implement sampler state * implement input layout * implement fence object * buffer implementation * texture implementation * cleanup * add adapter enumeration * supported formats and allocation info * work on device and implement readBufferResource * skeleton for transient resource heap * initial work on command queue / buffers / encoders * fix uploading initial buffer data * implement buffer resource view * string utility functions * wip query pool implementation * cleanup * swapchain * wip * remove plain buffer view * extend gfxGetDeviceTypeName with metal * basic support for resource binding with compute shaders * needed for metal bindings * replace assert(0) with SLANG_UNIMPLEMENTED_X
2024-06-06make String::trim consistent with String::trimStart/trimEnd (#4285)skallweitNV
2024-06-05Avoid duplicating entry points in library (#4279)kaizhangNV
2024-06-05add 'override' keyword to getCompileTimeProfile (#4275)kaizhangNV
2024-06-05initial set of lldb formatters (#4272)Simon Kallweit
2024-06-04Use memcpy to replace strncpy_s (#4270)kaizhangNV
Use memcpy to replace strncpy_s in SlangProfiler::SlangProfiler to fix the error in Windows.
2024-06-04Add APIs to get profile of compile time (#4242)kaizhangNV
* Add APIs to get profile of compile time Add serial time measurement Add profiler to measure lots of stages in slang compilation, and it can accumulate the time spent in each thread in multi-threads case and finally report a serial timing info. * Add invocation times to the profiler * Simplify the profiler and provide a 'clear' option Change the profiler design to only return the thread_local profiler to user. We create a ISlangProfiler interface to carry the thread_local variable PerformanceProfilerImpl profiler to user. In addition, we provide a new option in the input parameter to control whether or not user want to clear the previous profile data. So spGetCompileProfile() can always returns a fresh new profiling data. * Change to use slang container List Stop using std::vector, instead use slang's container List. Generate a UUID for ISlangProfiler
2024-06-04Print warning when operator<< shifting too much (#4255)Jay Kwak
* Print warning when operator<< shifting too much Closes #3944 For the given type of the left side operand to `operator<<` is not big enough for the right side operand, print a warning that the result will be always zero.
2024-06-03Fix performance issue in source-map (#4261)Yong He
2024-06-03Add an option to disable source map in obfuscation (#4260)kaizhangNV
Add option "-disable-source-map" to disable the source map in obfuscation.
2024-06-02Metal Task Shader payload (#4238)Dynamitos
2024-06-01Prevent hoisting of non-hoistable instructions in non-function values with ↵Ellie Hermaszewska
code (#4250)
2024-06-01Support different SPIRV versions. (#4254)Yong He
2024-05-31Capabilities generator inclusive join and misc (#4237)ArielG-NV
2024-05-31Fix a bug on default initialization of interface typed value. (#4249)Yong He
* Fix a bug on default initialization of interface typed value. * Fix.
2024-05-30Support SPIR-V DebugTypePointer (#4228)Jay Kwak
2024-05-30Increase MSVC warning level to 4 for Slang projects (#4207)Jay Kwak
2024-05-29Improve compile time performance. (#3857)Yong He
* Handle type check cache update on extensions more gracefully. * Correctness fix. * Cache implcit cast overload resolution results. * Fix. * More optimizations. * Cache implicit default ctor resolution. * Disable redundancy removal. * Fix. * Fix test. * Fix. * Correctness fix. * Fix. * Fix, * Fix test. * Small tweak.
2024-05-29Add options to speedup compilation. (#4240)Yong He
* Add options to speedup compilation. * Fix. * Plumb options to DCE pass. * Revert debug change. * Fix regressions. * More optimizations. * more cleanup and fixes. * remove comment. * Fixes. * Another fix. * Fix errors. * Fix errors. * Add comments.
2024-05-28Print memory leak info in Debug build of slangc.exe (#4210)Jay Kwak
When memory leak is detected, this commit will dump the information about the memory leak. This feature is available only in Debug build on Windows platform. Also note that the message will not be printed on the client applications that use slang.dll, because the printing happens as a part of slangc.exe not slang.dll. I found a bug that Slang::StdWriters was closing `stdout` and `stderr` in its destructor, which prevented Crt functions to print the messages to `stdout` and `stderr`.
2024-05-24Fix clang-18 build (#4222)exdal
* Update slang-performance-profiler.cpp * modified: source/core/slang-performance-profiler.cpp * reviews --------- Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com>
2024-05-24If no sample is set with a `Texture(.*)MS[]` operation, set sample to 0. (#4225)ArielG-NV
* push fix: if no sample, set to 0 for textureMS * push fixes to hlsl [] operator + test so it will error
2024-05-22Fix all Clang-14 warnings (#4203)ArielG-NV
* fix all Clang-14 warnings * remove a clang-14 warning fix because it is a MSVC warning...
2024-05-20Printing a timing of stdlib build time (#4190)Jay Kwak
2024-05-19Emit execution mode of type per entry point once. Emit SPIRV capability once ↵ArielG-NV
per shader program. (#4189) * Emit only 1 execution mode of type per entry point Added a dictionary<SpvWord,Hash<ExecutionMode>> to ensure we don't emit multiple. * get inst->id directly * address review + fix test --------- Co-authored-by: Yong He <yonghe@outlook.com>