<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/slang-capture-replay/parameter-encoder.cpp, 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>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>
</feed>
