| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add decoder
* Add a replay executable to consume the decoded content
Add file-processor.cpp/h where we implement the logic to process
the captured file block by block. Each block is:
function header + parameter buffer + function tailer + function
output[optional].
After reading one block, the block of data is sent to decoder module
to dispatch the corresponding API.
Add slang-decoder.cpp/h where we implement the logic to dispatch
the slang API according to the input block data.
- Rename api_callId.h to capture-format.h
- Renmae capture_utility.cpp to capture-utility.cpp
- Renmae capture_utility.h to capture-utility.h
- Change the #include file name accordingly.
* Reorganize source files structure
Move all the capture logic code into `capture` directory.
- the capture code will be build with slang dll.
Move all the replay logic code into `relay` directoy.
- the replay code is not part of slang dll, it will be built
as a stand alone binary and link against slang dll.
Change the #include file names accordingly.
Add tools/slang-replay/main.cpp for the slang-replay stand alone
binary place holder. Will implement it later.
Update premake5.lua accordingly.
* Update cmake files
Update cmake files to change the build process for
capture and relay system.
- capture component should be build with slang dll, so we
should not include replay component.
- replay component should be a separate executable tool, which
should not include capture component.
- In order to easy use our current cmake infrastructure, move
the shared files to a `util` folder
- change the header include path
* Redesgin the interfaces of consumers
Fix some issues in capture
Finish implementing all slang-decoder functions
* Fix the AppleClang build issue
* Address few comments
- Fix the weird indent issues.
- Correct the function name for CreateGlobalSession()
- Rename file-processor to captureFile-processor to be more specific.
- Use Slang::List instead of std::vector
* record/replay: name refactor change
Refactor the naming.
Change the name "encoder/capture" to "record".
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial implementation for decl-tree reflection API
This patch adds Slang API methods for walking all the declarations in the AST.
We expose this functionality through an abstract `DeclReflection` class that can be a type, function or a variable declaration.
We also provide ways to cast the decl to a `FunctionReflection`, `TypeReflection` or `VariableReflection` and traverse through the child nodes (for instance, a struct type will have component variable declarations)
This patch also adds `ISlangInternal` as an internal COM interface to allow us to cast IGlobalSession to the internal Session pointer while bypassing any wrappers (such as the capture interface)
* Update slang.h
* Remove `ISlangInternal` (its causing a diamond pattern w.r.t `ISlangUnknown`) and use `ComPtr` for proper ref management.
* Update unit-test-decl-tree-reflection.cpp
* Change `FunctionDeclBase` to use `DeclRef` instead of directly using the decl.
* Update slang-reflection-api.cpp
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Move the file public header files to `include` dir
Close the issue (#4635).
Move the following headers files to a `include` dir
located at root dir of slang repo:
slang-com-helper.h -> include/slang-com-helper.h
slang-com-ptr.h -> include/slang-com-ptr.h
slang-gfx.h -> include/slang-gfx.h
slang.h -> include/slang.h
Change cmake/SlangTarget.cmake to add include path to
every target, and change the source file to use
"#include <slang.h>" to include the public headers.
The source code update is by the script like follow:
```
fileNames_slang=$(grep -r "\".*slang\.h\"" source/ -l)
for fileName in "${fileNames_slang[@]}"
do
echo "$fileName"
sed -i "s/\".*slang\.h\"/\"slang\.h\"/" $fileName
done
```
* Fix the test issues
* Fix cpu test issues by adding include seach path
* Update cmake to not add include path for every target
Also change "#include <slang.h>" to "include "slang.h" " to
make the coding style consistent with other slang code.
* Change public include to private include for unit-test and slang-glslang
|
| |
|
|
|
|
|
|
|
|
|
| |
* Add reflection API for functions.
This change adds `SlangFunctionReflection` type in the reflection API that provides methods for querying function result type, parameters and user-defined attributes.
`ProgramLayout::findFunctionByName` can now find a function with the given name and returns a `FunctionReflection`.
`IEntryPoint` now has a `getFunctionReflection` method that returns an `FunctionReflection` for the entrypoint.
* More modifiers; make reflection API consistent.
|
| |
|
|
|
| |
* Add API for querying dependency files on IModule
* return nullptr
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add capture logic to other interfaces.
Add capture logics to ISession, IModule, ITypeConformance, IEntryPoint
ICompositeComponentType.
Add few encode methods to encode the array.
Fix some capture logic in global session. We will not need to encode
the null_ptr output before actual actual of the captured APIs.
Previously we used this as a place holder, but it's actually not
necessary, it can be detected if the output is not captured during
replay.
* capture/replay: dump the shader files to disk
Dump the shader files to disk.
Also set a default directory for the capture files.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add the function tailer for appending the output
- The basic format for the capture encode is as follow:
Header:
4 bytes: magic number ('H' 'E' 'A' 'D' )
4 bytes: call id - specify the method name
8 bytes: handle id - specify 'this' pointer
8 bytes: payload size in bytes - specify the data size of parameters
8 bytes: thread id
Payload:
Encode for all the parameters.
Tailer (optional):
Tailer is an optional, it only used when the output of the method is
also stored in the method. Usually it just the opaque handle allocated
by slang.
4 bytes: magic number ('T' 'A' 'I' 'L')
4 bytes: payload size in bytes.
- Fix some issues in checking the result of write of output stream.
* Encoding methods of IGlobalSession
Add encoding logic for all the member functions of IGlobalSession,
except those query functions that do not impact the internal state
of slang.
Because some get functions will invoke allocations by slang, these
functions are account for the "query functions". Therefore those
functions are still captured.
All the allocations are stored by using their address, because those
allocations are opaque and will finally be used as inputs for other
APIs, there is no need to store the data. We just need to track
those address and know which APIs will consume them.
* Add SLANG_CAPTURE_CHECK macro
Add SLANG_CAPTURE_CHECK macro to check SLANG_OK is returned.
* Fix build error
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Define api call ID for each being captured methods
* Add parameter encoder interface
* Add outputStream and capture manager
Add infrastructure for output stream
This is the interface to record the method and parameter, and also
provide functionality to write all the serialized data into file.
Add capture manager:
Capture manager is associated to global session object, it will
provide the functionality to actual record all the APIs.
Implement some of parameter encoder functions.
* Fix some Windows & cmake build error
* remove unused headers
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* capture/relay: Add capture interface classes
Add `ModuleCapture` class for capturing `IModule`
- The `IModule` can only be created from
-- `ISession::loadModule`
-- `ISession::loadModuleFromIRBlob`
-- `ISession::loadModuleFromSource`
-- `ISession::loadModuleFromSourceString`
so, we create the `ModuleCapture` at those methods in `SessionCapture`
class. We use a hash map to store a map from `IModule` to `ModuleCapture`
to avoid creating new `ModuleCapture` when there is already an old one.
- In `SessionCapture::getLoadedModule`, we will assert on not finding
a `ModuleCapture` instance.
Add `EntryPointCapture` class for capturing `IEntryPoint`.
- The `IEntryPoint` can only be created from:
-- `IModule::findEntryPointByName`
-- `IModule::findAndCheckEntryPoint`
so, we create the `EntryPointCapture` at those methods in `ModuleCapture`.
Similarly, we use a hash map to store a map from `IEntryPoint` to
`EntryPointCapture`.
- In `IModule::getDefinedEntryPoint`, we will assert on not finding
a `EntryPointCapture` instance.
Add `CompositeComponentTypeCapture` class for capturing CompositeComponentType,
but since user is only exposed to `IComponentType`, so `CompositeComponentTypeCapture`
just inherits from `IComponentType`.
- `CompositeComponentType` can only be created from:
-- ISession::createCompositeComponentType
so create it here.
Add `TypeConformanceCapture` class for capturing `ITypeConformance`.
- The `ITypeConformance` can only be created from:
-- `ISession::createTypeConformanceComponentType`
so create it here.
In addition, because `EntryPointCapture` and `ModuleCapture` share a some
base class `IComponentType`, we generate the COM GUID for those two
classes to differentiate them.
* Fix the build issue
* Add nullptr check for output parameter
* define the SLANG_CAPTURE_ASSERT macro used in both debug and release build
|
|
|
* capture/replay: interface implementation 1
- Add global session, filesystem, and session capture interface classes:
GlobalSessionCapture for IGlobalSession
FileSystemCapture for ISlangFileSystemExt
SessionCapture for ISession
- Add environment variables to enable it
The 2 variables are SLANG_CAPTURE_LAYER and SLANG_CAPTURE_LOG_LEVEL
SLANG_CAPTURE_LAYER:
In slang_createGlobalSession(), after the compiling/loading stdlib,
we will check the capture environment variable, if it's set to 1,
we will create a GlobalSessionCapture object and return to user
code.
SLANG_CAPTURE_LOG_LEVEL: This is to set the log level, user can
choose the loglevel to debug. (We can remove this when the feature
is fully implemented).
- Update premake file and cmake file to add the capture/replay source folder
* Fix Windows build error
Fix windows build error by adding the "SLANG_MCALL" keyword.
Change to use Slang::ComPtr for those captured object pointers
to simplify the resource management.
Use __func__ macro to print the function name in the log.
|