<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/slang-capture-replay, branch master</title>
<subtitle>Making it easier to work with shaders</subtitle>
<id>https://git.yummers.dev/slang.git/atom?h=master</id>
<link rel='self' href='https://git.yummers.dev/slang.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/'/>
<updated>2024-07-23T15:45:26+00:00</updated>
<entry>
<title>Feature/capture (#4625)</title>
<updated>2024-07-23T15:45:26+00:00</updated>
<author>
<name>kaizhangNV</name>
<email>149626564+kaizhangNV@users.noreply.github.com</email>
</author>
<published>2024-07-23T15:45:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=986256ffb92ab7c8fc7cf9f2c424919a439a824f'/>
<id>urn:sha1:986256ffb92ab7c8fc7cf9f2c424919a439a824f</id>
<content type='text'>
* 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".</content>
</entry>
<entry>
<title>Initial implementation for decl-tree reflection API (#4666)</title>
<updated>2024-07-18T17:11:19+00:00</updated>
<author>
<name>Sai Praveen Bangaru</name>
<email>31557731+saipraveenb25@users.noreply.github.com</email>
</author>
<published>2024-07-18T17:11:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=0d06ebcefb36a19710d87832fc1ea027e21281af'/>
<id>urn:sha1:0d06ebcefb36a19710d87832fc1ea027e21281af</id>
<content type='text'>
* 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</content>
</entry>
<entry>
<title>Move the file public header files to `include` dir (#4636)</title>
<updated>2024-07-17T17:53:19+00:00</updated>
<author>
<name>kaizhangNV</name>
<email>149626564+kaizhangNV@users.noreply.github.com</email>
</author>
<published>2024-07-17T17:53:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=2db15080085856ed9b5f20642dbb354aac59a888'/>
<id>urn:sha1:2db15080085856ed9b5f20642dbb354aac59a888</id>
<content type='text'>
* 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 -&gt; include/slang-com-helper.h
 slang-com-ptr.h -&gt; include/slang-com-ptr.h
 slang-gfx.h -&gt; include/slang-gfx.h
 slang.h -&gt; include/slang.h

Change cmake/SlangTarget.cmake to add include path to
every target, and change the source file to use
"#include &lt;slang.h&gt;" 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 &lt;slang.h&gt;" 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</content>
</entry>
<entry>
<title>Add reflection API for functions. (#4587)</title>
<updated>2024-07-10T21:09:18+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2024-07-10T21:09:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=b89421cb3b803165455020f5b70d582b6aec6e76'/>
<id>urn:sha1:b89421cb3b803165455020f5b70d582b6aec6e76</id>
<content type='text'>
* 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.</content>
</entry>
<entry>
<title>Add API for querying dependency files on IModule (#4493)</title>
<updated>2024-06-27T15:35:17+00:00</updated>
<author>
<name>skallweitNV</name>
<email>64953474+skallweitNV@users.noreply.github.com</email>
</author>
<published>2024-06-27T15:35:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=cb610113605f62e784b63012b31b751acb6fac72'/>
<id>urn:sha1:cb610113605f62e784b63012b31b751acb6fac72</id>
<content type='text'>
* Add API for querying dependency files on IModule

* return nullptr</content>
</entry>
<entry>
<title>Add capture logic to other interfaces. (#4412)</title>
<updated>2024-06-21T03:59:33+00:00</updated>
<author>
<name>kaizhangNV</name>
<email>149626564+kaizhangNV@users.noreply.github.com</email>
</author>
<published>2024-06-21T03:59:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=d349fd9e1f65fd32b2f4ea0e38c5084256d0dd04'/>
<id>urn:sha1:d349fd9e1f65fd32b2f4ea0e38c5084256d0dd04</id>
<content type='text'>
* 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.</content>
</entry>
<entry>
<title>Feature/capture (#4397)</title>
<updated>2024-06-17T15:41:34+00:00</updated>
<author>
<name>kaizhangNV</name>
<email>149626564+kaizhangNV@users.noreply.github.com</email>
</author>
<published>2024-06-17T15:41:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=93fcb83c34c932c82deeb8a8cd626f0dc990716c'/>
<id>urn:sha1:93fcb83c34c932c82deeb8a8cd626f0dc990716c</id>
<content type='text'>
* 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</content>
</entry>
<entry>
<title>capture/replay: implement infrastructure for capture (#4372)</title>
<updated>2024-06-13T20:02:12+00:00</updated>
<author>
<name>kaizhangNV</name>
<email>149626564+kaizhangNV@users.noreply.github.com</email>
</author>
<published>2024-06-13T20:02:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f0d40ad5e1d0a0dec39fe8a141d3f81d88fc576a'/>
<id>urn:sha1:f0d40ad5e1d0a0dec39fe8a141d3f81d88fc576a</id>
<content type='text'>
* 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 &amp; cmake build error

* remove unused headers</content>
</entry>
<entry>
<title>Extend the COM-based API to support whole program compilation. (#4355)</title>
<updated>2024-06-12T16:45:50+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2024-06-12T16:45:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=ccc26c2d22d471ae649bf16f37ed1cd6cfbddd1b'/>
<id>urn:sha1:ccc26c2d22d471ae649bf16f37ed1cd6cfbddd1b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>capture/relay: Add capture interface classes (#4177)</title>
<updated>2024-05-17T16:43:08+00:00</updated>
<author>
<name>kaizhangNV</name>
<email>149626564+kaizhangNV@users.noreply.github.com</email>
</author>
<published>2024-05-17T16:43:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=9f786fdf71e90339e20979ef3ba8f073657f5a98'/>
<id>urn:sha1:9f786fdf71e90339e20979ef3ba8f073657f5a98</id>
<content type='text'>
* 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</content>
</entry>
</feed>
