| Age | Commit message (Collapse) | Author |
|
The files being checked in here were initially written 2-3 years ago.
They are very clearly incomplete, outdated and, quite often, inaccurate.
The intention of this change is to get an initial skeleton in place for
the large-scale structure of a language reference (for now avoiding
the term "specification" and all the weight it carries).
Future commits should be able to add to flesh out this skeleton and
start to make the document more complete and more accurate.
|
|
* record/replay: Add tests
Modify the hello-world example to generate the hash code for the
entry point spirv code, so that we can compare it with replaying
the example.
Add the test script to run the example and compare the hash code
with replaying it.
* Check nullptr for out Diagnostics
We need to check whether the output Diagnostics is a nullptr,
because it's allowed.
* Fix the double free pointers
* Add triangle example as the new test for record-replay
Change the example base to add the offline rendering path
because we don't want to display anything when we're in the
test mode.
This change involves introducing a TestBase that will parse
the command line option. It will decide whether we are in
the test mode.
Disable all the swapchain and windows related creation, instead
we will only create one single framebuffer for the render target.
* Address comments
TODO:
In the follow up patches, I will add more tests and integrate the test flow into slang-unit-test.
|
|
* 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>
|
|
Fix a mistake on a command line argument for building slang-llvm
|
|
* Dont require llvm for building generators
* Fetch slang-llvm.so from correct release (#4847)
* Fetch slang-llvm.so from correct release
Closes https://github.com/shader-slang/slang/issues/4648
Should close https://github.com/shader-slang/slang/issues/4812
* Update docs
* Correct documentation on cmake option
* Neaten cmake script
* Fix fetching on windows
---------
Co-authored-by: Yong He <yonghe@outlook.com>
* Be a bit more careful dealing with release list fetching failure
* clarify error messages
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Allow creating draft releases from tags containing "draft"
* make draft releases prereleases too
|
|
This reverts commit 579d59c761cb0460701e0e820eb066275fe357b3.
|
|
Designed to work for both value types as well as ref/ptr/buffer types
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Support dependent generic constraints.
* Fix warning.
* Update comment.
* Fix.
* Add a test case to verify fix of #3804.
* Address review.
|
|
* Fix `tests\autodiff\reverse-while-loop-3.slang` test
Fixes: #4876
Fix `tests\autodiff\reverse-while-loop-3.slang` test to have correct listed output values
* set default to 1 (different val)
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Exclude synthesized code from code auto documentation system
Fixes #4888
Changes to exclude synthesized code from code-auto-documentation system
* syntax change for cleanup
|
|
hang (#4885)
* Track uninitialized values of `Ptr<Specialize<T>>` inside type `T` without hang
Fixes #4878
Track uninitialized values of `Ptr<Specialize<T>>` inside type `T` without hang
* change method used to resolve base of specialization
|
|
track containor-decl with `DifferentialType` scope varaible synthesized
|
|
* Fetch slang-llvm.so from correct release
Closes https://github.com/shader-slang/slang/issues/4648
Should close https://github.com/shader-slang/slang/issues/4812
* Update docs
* Correct documentation on cmake option
* Neaten cmake script
* Fix fetching on windows
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Implement Path::createDirectoryRecursive
Implement Path::createDirectoryRecursive with existing Path::createDirectory
that uses system call instead of c++ standard lib.
* Change the use of 'while(1)' to 'for(;;)'
|
|
* Remove using SpvStorageClass values casted into AddressSpace values
Also removes support for specific storage classes in __target_intrinsic snippets
* remove SLANG_RETURN_NEVER macro
* squash warnings
* Make nonexhaustive switch statement error on gcc
* Add SLANG_EXHAUSTIVE_SWITCH_BEGIN/END macros
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Tuple swizzling and element access.
* Update proposal status.
* Cleanup.
* Fix merrge error.
* Address review.
|
|
* Variadic Generics Part 2: IR lowering and specialization.
* Update design doc status.
* Update design doc.
* Resolve review comments.
|
|
|
|
|
|
Previously, the warnings were:
```
environment.slang(22): warning 41022: inout parameter 'seed' is never written to
public float3 environment_sample(StructuredBuffer <Environment_sample_data> sample_buffer, inout int seed)
^~~~~~~~~~~~~~~~~~
hit.slang(5): warning 41022: inout parameter 'seed' is never written to
float3 sample_lights(inout uint seed)
^~~~~~~~~~~~~
```
With this commit they should not be emitted.
|
|
* Design proposal: IFunc interface.
* fix code error.
|
|
code should use modules (#4862)
Closes https://github.com/shader-slang/slang/issues/4281
|
|
|
|
* Refactoring benchmark CI pipeline
* Combine setup and run steps
|
|
* Make precompileForTargets work with Slang API
precompileForTargets, renamed to precompileForTarget, does not need
an EndToEndCompileRequest and some objects created from it are not
necessary either.
Take only a target enum and a diagnostic blob as input and handle
everything else internally, such as creating the TargetReq with
chosen profile.
Fixes #4790
* Update slang-module.cpp
* Update slang-module.cpp
|
|
|
|
* Design proposal for Tuple types.
* formatting.
|
|
|
|
* Design proposal for variadic generics
* Update IR lowering section.
* fix typo.
* Fix error.
* Fix typos.
* fix typos.
* typo fix.
* update reviewers.
* update implementation info.
* update implementation info.
* update pr link.
* rewording.
* more rewording.
* grammar fix.
|
|
* Do not zero-initialize groupshared and rayquery variables
Fixes: #4824
`-zero-initialize` option will explicitly not:
1. Set any groupshared values to defaults
2. Set any rayQuery object to a default state (currently invalid code generation)
* grammer
* disallow groupshared initializers
disallow groupshared initializers & adjust tests accordingly
* remove disallowed groupshared-init expression
* do not default init if non-copyable
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Fix the issue that NonUniformResourceIndex is ignored
Fix the issue that after `specializeFunctionCalls`,
`NonUniformResourceIndex` is ignored in the generated specialized
function.
The reason is that if the function has a non-uniform resource parameter,
we will legalize it by replacing the resource parameter with a index,
and indexing of the resource will be moved inside the specialized function.
e.g.
```
void func(ResourceType resource) { ... }
func(resource[NonUniformResourceIndex(0)])
```
will be specialized into
```
void func(int index) { resource[index]; }
func(0);
```
In this case, inside the function, we will loose the information about
whether the resource is a non-uniform. So we add the handling for this
corner case by adding insert a `NonUniformResourceIndex` into the
specialized function:
```
void func(int index) {
int nonUniformIdx = NonUniformResourceIndex(index);
resource[nonUniformIdx];
}
```
* Fix the issue that arguments mismatch after specilization callsite
specializeCall() call could cause arguments mismatch with the parameters
of the specialized function.
For example, if the function parameter contains a resource type
```
void func(ResourceType res) { ... }
int index = ...
func(resources[index]);
```
This will be specialized into
```
void func(int index) { resources[index] }
int index = ...
func(index);
```
However, if we have more than 1 call sites, and the other call site
doesn't use `int` as the index, e.g.
```
uint index = ...
func(resources[index]);
```
this call site will be specialized into
```
uint index = ...
func(index);
```
this will be invalid, because the argument doesn't match the parameter.
so we just add the data type of the new arguments into the function key such that
For the uniformity info, we add a new attribute "IROp_NonUniformAttr",
so we will form a IRAttributedType that encodes both uniformity and data
type, and use it as the key of call info. So if there is call site using the different
data type for the resource index, we will specialize a new function for this.
* Handle the intCast and uintCast operation
Since after intCast/uintCast of nonuniformIndex, it's still a
nonuniformIndex. So we will handle this case as well.
Also, add a new test to cover this.
|
|
Adds a new Github CI action for benchmarking the slangc compiler on the MDL shaders. For now, the results are only dumped to the output of the CI, which can be later viewed through raw logs. The next step is to use github-action-benchmark to push these results into a page which will show the benchmark results over time as commits are pushed.
|
|
|
|
This commit prevents GIT from adding carrage return characters to shell
script files whose file extension is ".sh".
Currently git automatically adds a carrage return characters to all
lines in text files, which makes them Windows text file.
This causes a trouble when a shell script is submitted and it is ran on
WSL, because bash on WSL expects the script files in a unix text file
format.
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
This commit adds a quick build step for MacOS on CONTRIBUTION.md.
It is unclear what are the conditions that slang-llvm needs to be
rebuilt locally. An issue is filed for it, #4812
|
|
Fixes #4818
Emit memory qualifier once for GLSL targets.
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Support unicode identifier names.
* Fix.
* Fix language server.
* Fix build errors.
* Fix.
* Fix offset translation in language server.
|
|
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.
|
|
|
|
* More reflection API features.
+ Lookup methods and members (by string) on types
+ Fix issue with looking up non-static members through the scope operator '::'
+ `GenericReflection`: Cast a decl to generic to access unspecialized generic parameter names and constraints
+ `GenericReflection`: Use `getGenericContainer()` from function, variable or type to access the 'nearest' generic parent along with specialization info
+ `GenericReflection::getConcreteType` and `GenericReflection::getConcreteIntVal`: to get the concrete type of a param in the context of the reflection object
+ `GenericReflection::getOuterGenericContainer` to go up one level and get the outer generic declarations (if there are more than one enclosing generic scopes)
+ `DeclReflection::getParent`: go to parent declaration.
+ Change `VariableReflection` to be a `DeclRef` rather than a decl (allows us to return properly substituted types for methods, members, and more)
* Fix Falcor issue
|
|
* Fix auto-diff synthesized method naming conventions
* Update tests; remove unused var
|
|
Some debug code was left in by accident which called DXC to
disassemble the DXIL it produced.
|
|
Closes #4746.
This commit adds a support for "NumThreads" and "Shader" attribute keyword, which is in CamelCasing starting with an upper case letter.
The attribute keywords in HLSL are case-insensitive. As an example, one of D3D documents says,
"The attribute name "Shader" is case insensitive."
https://microsoft.github.io/DirectX-Specs/d3d/WorkGraphs.html
Slang, however, doesn't support the case-insensitivity. They should be all lower-case or CamelCasing starting with an upper case.
|
|
* Add embedded precompiled binary IR ops
Add IR operations to embed precompiled DXIL or SPIR-V blobs
into IR. Adds a BlobLit literal that is mostly identical to
StringLit except for its inability to be displayed, e.g.
in dumped IR. In the future, the blob might be dumped as
hexadecimal, but for now it is summarized as "<binary blob>".
* EmbeddedDXIL and SPIR-V options
The options, '-embed-dxil' and '-embed-spirv' in slangc, will
cause a target dxil or spirv to be compiled and stored in the
translation unit IR when written to a slang-module. Subsequent
changes actually implement the options.
* Per-translation unit DXIL precompilation
When -embed-dxil is specified, perform a precompilation to DXIL of
each TU, linked only with stdlib. Embed the resulting DXIL for
the TU in a IR op. Being part of IR, the precompiled DXIL can be
serialized to disk in a slang-module.
Upon loading slang-modules, the new IR op will be searched for and
the precompiled DXIL blob is saved with the loaded Module. During
linking, if all the Modules have precompiled blobs they will be
sent to the downstream compile commands as libraries instead of
source, skipping the downstream compilation, using DXC only for
linking.
Fixes Issue #4580
* Remove placeholder embedded SPIRV support
Code was added only to sketch out how other precompiled bins
will be supported.
* Remove the rest of the SPIRV placeholder support
* Fix warnings, test error on non-windows
* Remove lib_6_6 hack, add dxil_lib capability
* Allocate blob value from irmodule memarena
* Add null check after memarena allocation
* Restore the request->e2erequest code path for generatewholeprogram
* Update capability handling, move EmbedDXIL enum to end to preserve abi
* Remove lib_6_6 hack
* Move ICompileRequest functions to end
|
|
|
|
|
|
* Allow impliocit 'uniform' entrypoint parameters.
* Fix.
* Fix.
* Fix.
* Fix.
|
|
* Allow generic type deduction from ParameterBlock arguments.
* Fix test.
* Update expected failure list.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
* record/replay: Implement the json consumer
Finish the implementation of json consumer.
Fix some bug in the block processing as Tailer is not a necessary block
so if the Magic bit is "HEAD", we should keep processing.
* record/replay: Implement the replayer component
Implement the replayer consumer, and also finish the slang-replay
standalone app that will run the while replayer.
It can take an option "--convert-json | -cj" which will convert
the record binary file to a human readable json file.
If there is no option provided, it will replay the record file by
default.
TODO: #4764 is created to remove the std::filesystem usage.
|