summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorkaizhangNV <149626564+kaizhangNV@users.noreply.github.com>2024-08-22 12:18:44 -0500
committerGitHub <noreply@github.com>2024-08-22 10:18:44 -0700
commitb5bb82411cc6101b66283f7d0abca7ceb58aa2f6 (patch)
tree192a522513da30b1a92e6c319693aa541729bea9 /source
parenta3fbd8f060317332eae951d4a376e830d058469e (diff)
Feature/capture unit test (#4898)
* 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.
Diffstat (limited to 'source')
-rw-r--r--source/slang-record-replay/record/slang-composite-component-type.cpp19
-rw-r--r--source/slang-record-replay/record/slang-composite-component-type.h1
-rw-r--r--source/slang-record-replay/record/slang-entrypoint.cpp19
-rw-r--r--source/slang-record-replay/record/slang-entrypoint.h1
-rw-r--r--source/slang-record-replay/record/slang-filesystem.cpp5
-rw-r--r--source/slang-record-replay/record/slang-filesystem.h1
-rw-r--r--source/slang-record-replay/record/slang-global-session.cpp5
-rw-r--r--source/slang-record-replay/record/slang-global-session.h1
-rw-r--r--source/slang-record-replay/record/slang-module.cpp21
-rw-r--r--source/slang-record-replay/record/slang-module.h1
-rw-r--r--source/slang-record-replay/record/slang-session.cpp23
-rw-r--r--source/slang-record-replay/record/slang-session.h1
-rw-r--r--source/slang-record-replay/record/slang-type-conformance.cpp19
-rw-r--r--source/slang-record-replay/record/slang-type-conformance.h1
-rw-r--r--source/slang-record-replay/replay/json-consumer.cpp2
-rw-r--r--source/slang-record-replay/replay/replay-consumer.cpp8
16 files changed, 43 insertions, 85 deletions
diff --git a/source/slang-record-replay/record/slang-composite-component-type.cpp b/source/slang-record-replay/record/slang-composite-component-type.cpp
index e3c339adb..29ac5da8d 100644
--- a/source/slang-record-replay/record/slang-composite-component-type.cpp
+++ b/source/slang-record-replay/record/slang-composite-component-type.cpp
@@ -15,11 +15,6 @@ namespace SlangRecord
slangRecordLog(LogLevel::Verbose, "%s: %p\n", __PRETTY_FUNCTION__, componentType);
}
- CompositeComponentTypeRecorder::~CompositeComponentTypeRecorder()
- {
- m_actualCompositeComponentType->release();
- }
-
ISlangUnknown* CompositeComponentTypeRecorder::getInterface(const Guid& guid)
{
if (guid == IComponentType::getTypeGuid())
@@ -65,7 +60,7 @@ namespace SlangRecord
slang::ProgramLayout* programLayout = m_actualCompositeComponentType->getLayout(targetIndex, outDiagnostics);
{
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
recorder->recordAddress(programLayout);
m_recordManager->apendOutput();
}
@@ -101,7 +96,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outCode);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -126,7 +121,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outCode);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -201,7 +196,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outSpecializedComponentType);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -224,7 +219,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outLinkedComponentType);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -251,7 +246,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outSharedLibrary);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -300,7 +295,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outLinkedComponentType);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
diff --git a/source/slang-record-replay/record/slang-composite-component-type.h b/source/slang-record-replay/record/slang-composite-component-type.h
index 758a59434..2374bcda2 100644
--- a/source/slang-record-replay/record/slang-composite-component-type.h
+++ b/source/slang-record-replay/record/slang-composite-component-type.h
@@ -19,7 +19,6 @@ namespace SlangRecord
ISlangUnknown* getInterface(const Guid& guid);
explicit CompositeComponentTypeRecorder(slang::IComponentType* componentType, RecordManager* recordManager);
- ~CompositeComponentTypeRecorder();
// Interfaces for `IComponentType`
virtual SLANG_NO_THROW slang::ISession* SLANG_MCALL getSession() override;
diff --git a/source/slang-record-replay/record/slang-entrypoint.cpp b/source/slang-record-replay/record/slang-entrypoint.cpp
index e5c76a5af..7d43700e2 100644
--- a/source/slang-record-replay/record/slang-entrypoint.cpp
+++ b/source/slang-record-replay/record/slang-entrypoint.cpp
@@ -14,11 +14,6 @@ namespace SlangRecord
slangRecordLog(LogLevel::Verbose, "%s: %p\n", __PRETTY_FUNCTION__, entryPoint);
}
- EntryPointRecorder::~EntryPointRecorder()
- {
- m_actualEntryPoint->release();
- }
-
ISlangUnknown* EntryPointRecorder::getInterface(const Guid& guid)
{
if(guid == EntryPointRecorder::getTypeGuid())
@@ -63,7 +58,7 @@ namespace SlangRecord
slang::ProgramLayout* programLayout = m_actualEntryPoint->getLayout(targetIndex, outDiagnostics);
{
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
recorder->recordAddress(programLayout);
m_recordManager->apendOutput();
}
@@ -99,7 +94,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outCode);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -124,7 +119,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outCode);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -199,7 +194,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outSpecializedComponentType);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -222,7 +217,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outLinkedComponentType);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -249,7 +244,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outSharedLibrary);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -298,7 +293,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outLinkedComponentType);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
diff --git a/source/slang-record-replay/record/slang-entrypoint.h b/source/slang-record-replay/record/slang-entrypoint.h
index 17c6fab6f..60c1bf369 100644
--- a/source/slang-record-replay/record/slang-entrypoint.h
+++ b/source/slang-record-replay/record/slang-entrypoint.h
@@ -21,7 +21,6 @@ namespace SlangRecord
ISlangUnknown* getInterface(const Guid& guid);
explicit EntryPointRecorder(slang::IEntryPoint* entryPoint, RecordManager* recordManager);
- ~EntryPointRecorder();
// Interfaces for `IComponentType`
virtual SLANG_NO_THROW slang::ISession* SLANG_MCALL getSession() override;
diff --git a/source/slang-record-replay/record/slang-filesystem.cpp b/source/slang-record-replay/record/slang-filesystem.cpp
index 310fecd78..87a7182fc 100644
--- a/source/slang-record-replay/record/slang-filesystem.cpp
+++ b/source/slang-record-replay/record/slang-filesystem.cpp
@@ -18,11 +18,6 @@ namespace SlangRecord
slangRecordLog(LogLevel::Verbose, "%s: %p\n", __PRETTY_FUNCTION__, m_actualFileSystem.get());
}
- FileSystemRecorder::~FileSystemRecorder()
- {
- m_actualFileSystem->release();
- }
-
void* FileSystemRecorder::castAs(const Slang::Guid& guid)
{
return getInterface(guid);
diff --git a/source/slang-record-replay/record/slang-filesystem.h b/source/slang-record-replay/record/slang-filesystem.h
index ff7004fa1..6f73e479c 100644
--- a/source/slang-record-replay/record/slang-filesystem.h
+++ b/source/slang-record-replay/record/slang-filesystem.h
@@ -18,7 +18,6 @@ namespace SlangRecord
{
public:
explicit FileSystemRecorder(ISlangFileSystemExt* fileSystem, RecordManager* recordManager);
- ~FileSystemRecorder();
// ISlangUnknown
SLANG_REF_OBJECT_IUNKNOWN_ALL
diff --git a/source/slang-record-replay/record/slang-global-session.cpp b/source/slang-record-replay/record/slang-global-session.cpp
index f8fe6c65b..c5350f760 100644
--- a/source/slang-record-replay/record/slang-global-session.cpp
+++ b/source/slang-record-replay/record/slang-global-session.cpp
@@ -29,11 +29,6 @@ namespace SlangRecord
m_recordManager->apendOutput();
}
- GlobalSessionRecorder::~GlobalSessionRecorder()
- {
- m_actualGlobalSession->release();
- }
-
SLANG_NO_THROW SlangResult SLANG_MCALL GlobalSessionRecorder::queryInterface(SlangUUID const& uuid, void** outObject)
{
if (uuid == Session::getTypeGuid())
diff --git a/source/slang-record-replay/record/slang-global-session.h b/source/slang-record-replay/record/slang-global-session.h
index 3fd584ef4..4242f4bff 100644
--- a/source/slang-record-replay/record/slang-global-session.h
+++ b/source/slang-record-replay/record/slang-global-session.h
@@ -15,7 +15,6 @@ namespace SlangRecord
{
public:
explicit GlobalSessionRecorder(slang::IGlobalSession* session);
- virtual ~GlobalSessionRecorder();
SLANG_REF_OBJECT_IUNKNOWN_ADD_REF
SLANG_REF_OBJECT_IUNKNOWN_RELEASE
diff --git a/source/slang-record-replay/record/slang-module.cpp b/source/slang-record-replay/record/slang-module.cpp
index 42dcd9eea..b116fa99b 100644
--- a/source/slang-record-replay/record/slang-module.cpp
+++ b/source/slang-record-replay/record/slang-module.cpp
@@ -14,11 +14,6 @@ namespace SlangRecord
slangRecordLog(LogLevel::Verbose, "%s: %p\n", __PRETTY_FUNCTION__, module);
}
- ModuleRecorder::~ModuleRecorder()
- {
- m_actualModule->release();
- }
-
ISlangUnknown* ModuleRecorder::getInterface(const Guid& guid)
{
if(guid == ModuleRecorder::getTypeGuid())
@@ -185,7 +180,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outEntryPoint);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -249,7 +244,7 @@ namespace SlangRecord
slang::ProgramLayout* programLayout = m_actualModule->getLayout(targetIndex, outDiagnostics);
{
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
recorder->recordAddress(programLayout);
m_recordManager->apendOutput();
}
@@ -285,7 +280,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outCode);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -310,7 +305,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outCode);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -386,7 +381,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outSpecializedComponentType);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -409,7 +404,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outLinkedComponentType);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -436,7 +431,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outSharedLibrary);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -485,7 +480,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outLinkedComponentType);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
diff --git a/source/slang-record-replay/record/slang-module.h b/source/slang-record-replay/record/slang-module.h
index 22339f1cd..1b1cc5de9 100644
--- a/source/slang-record-replay/record/slang-module.h
+++ b/source/slang-record-replay/record/slang-module.h
@@ -21,7 +21,6 @@ namespace SlangRecord
ISlangUnknown* getInterface(const Guid& guid);
explicit ModuleRecorder(slang::IModule* module, RecordManager* recordManager);
- ~ModuleRecorder();
// Interfaces for `IModule`
virtual SLANG_NO_THROW SlangResult SLANG_MCALL findEntryPointByName(
diff --git a/source/slang-record-replay/record/slang-session.cpp b/source/slang-record-replay/record/slang-session.cpp
index 7c0ccd2e1..3eb944082 100644
--- a/source/slang-record-replay/record/slang-session.cpp
+++ b/source/slang-record-replay/record/slang-session.cpp
@@ -17,11 +17,6 @@ namespace SlangRecord
slangRecordLog(LogLevel::Verbose, "%s: %p\n", "SessionRecorder create:", session);
}
- SessionRecorder::~SessionRecorder()
- {
- m_actualSession->release();
- }
-
ISlangUnknown* SessionRecorder::getInterface(const Guid& guid)
{
if(guid == ISlangUnknown::getTypeGuid() || guid == ISession::getTypeGuid())
@@ -54,7 +49,7 @@ namespace SlangRecord
slang::IModule* pModule = m_actualSession->loadModule(moduleName, outDiagnostics);
{
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
recorder->recordAddress(pModule);
m_recordManager->apendOutput();
}
@@ -83,7 +78,7 @@ namespace SlangRecord
slang::IModule* pModule = m_actualSession->loadModuleFromIRBlob(moduleName, path, source, outDiagnostics);
{
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
recorder->recordAddress(pModule);
m_recordManager->apendOutput();
}
@@ -112,7 +107,7 @@ namespace SlangRecord
slang::IModule* pModule = m_actualSession->loadModuleFromSource(moduleName, path, source, outDiagnostics);
{
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
recorder->recordAddress(pModule);
m_recordManager->apendOutput();
}
@@ -142,7 +137,7 @@ namespace SlangRecord
{
// TODO: Not sure if we need to record the diagnostics blob.
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
recorder->recordAddress(pModule);
m_recordManager->apendOutput();
}
@@ -179,7 +174,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outCompositeComponentType);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -213,7 +208,7 @@ namespace SlangRecord
slang::TypeReflection* pTypeReflection = m_actualSession->specializeType(type, specializationArgs, specializationArgCount, outDiagnostics);
{
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
recorder->recordAddress(pTypeReflection);
m_recordManager->apendOutput();
}
@@ -241,7 +236,7 @@ namespace SlangRecord
slang::TypeLayoutReflection* pTypeLayoutReflection = m_actualSession->getTypeLayout(type, targetIndex, rules, outDiagnostics);
{
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
recorder->recordAddress(pTypeLayoutReflection);
m_recordManager->apendOutput();
}
@@ -267,7 +262,7 @@ namespace SlangRecord
slang::TypeReflection* pTypeReflection = m_actualSession->getContainerType(elementType, containerType, outDiagnostics);
{
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
recorder->recordAddress(pTypeReflection);
m_recordManager->apendOutput();
}
@@ -386,7 +381,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outConformance);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
diff --git a/source/slang-record-replay/record/slang-session.h b/source/slang-record-replay/record/slang-session.h
index ca06e25a0..bc56003a9 100644
--- a/source/slang-record-replay/record/slang-session.h
+++ b/source/slang-record-replay/record/slang-session.h
@@ -20,7 +20,6 @@ namespace SlangRecord
ISlangUnknown* getInterface(const Guid& guid);
explicit SessionRecorder(slang::ISession* session, RecordManager* recordManager);
- ~SessionRecorder();
SLANG_NO_THROW slang::IGlobalSession* SLANG_MCALL getGlobalSession() override;
SLANG_NO_THROW slang::IModule* SLANG_MCALL loadModule(
diff --git a/source/slang-record-replay/record/slang-type-conformance.cpp b/source/slang-record-replay/record/slang-type-conformance.cpp
index 91f108786..56433f700 100644
--- a/source/slang-record-replay/record/slang-type-conformance.cpp
+++ b/source/slang-record-replay/record/slang-type-conformance.cpp
@@ -14,11 +14,6 @@ namespace SlangRecord
slangRecordLog(LogLevel::Verbose, "%s: %p\n", __PRETTY_FUNCTION__, typeConformance);
}
- TypeConformanceRecorder::~TypeConformanceRecorder()
- {
- m_actualTypeConformance->release();
- }
-
ISlangUnknown* TypeConformanceRecorder::getInterface(const Guid& guid)
{
if (guid == TypeConformanceRecorder::getTypeGuid())
@@ -67,7 +62,7 @@ namespace SlangRecord
slang::ProgramLayout* programLayout = m_actualTypeConformance->getLayout(targetIndex, outDiagnostics);
{
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
recorder->recordAddress(programLayout);
m_recordManager->apendOutput();
}
@@ -102,7 +97,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outCode);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -127,7 +122,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outCode);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -202,7 +197,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outSpecializedComponentType);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -225,7 +220,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outLinkedComponentType);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -252,7 +247,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outSharedLibrary);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
@@ -301,7 +296,7 @@ namespace SlangRecord
{
recorder->recordAddress(*outLinkedComponentType);
- recorder->recordAddress(*outDiagnostics);
+ recorder->recordAddress(outDiagnostics ? *outDiagnostics : nullptr);
m_recordManager->apendOutput();
}
diff --git a/source/slang-record-replay/record/slang-type-conformance.h b/source/slang-record-replay/record/slang-type-conformance.h
index 7bcae0d15..7beabcca5 100644
--- a/source/slang-record-replay/record/slang-type-conformance.h
+++ b/source/slang-record-replay/record/slang-type-conformance.h
@@ -21,7 +21,6 @@ namespace SlangRecord
ISlangUnknown* getInterface(const Guid& guid);
explicit TypeConformanceRecorder(slang::ITypeConformance* typeConformance, RecordManager* recordManager);
- ~TypeConformanceRecorder();
// Interfaces for `IComponentType`
virtual SLANG_NO_THROW slang::ISession* SLANG_MCALL getSession() override;
diff --git a/source/slang-record-replay/replay/json-consumer.cpp b/source/slang-record-replay/replay/json-consumer.cpp
index 0faf5267b..456988bdb 100644
--- a/source/slang-record-replay/replay/json-consumer.cpp
+++ b/source/slang-record-replay/replay/json-consumer.cpp
@@ -448,7 +448,7 @@ namespace SlangRecord
_writePair(builder, indent, "name", Slang::StringUtil::makeStringWithFormat("\"%s\"",
desc.preprocessorMacros[i].name != nullptr ? desc.preprocessorMacros[i].name : "nullptr"));
- _writePair(builder, indent, "value", Slang::StringUtil::makeStringWithFormat("\"%s\"",
+ _writePairNoComma(builder, indent, "value", Slang::StringUtil::makeStringWithFormat("\"%s\"",
desc.preprocessorMacros[i].value != nullptr ? desc.preprocessorMacros[i].value : "nullptr"));
}
}
diff --git a/source/slang-record-replay/replay/replay-consumer.cpp b/source/slang-record-replay/replay/replay-consumer.cpp
index cb1117bc0..7710b50e9 100644
--- a/source/slang-record-replay/replay/replay-consumer.cpp
+++ b/source/slang-record-replay/replay/replay-consumer.cpp
@@ -106,7 +106,6 @@ namespace SlangRecord
SlangResult CommonInterfaceReplayer::getEntryPointHash(ObjectID objectId, SlangInt entryPointIndex, SlangInt targetIndex, ObjectID outHashId)
{
InputObjectSanityCheck(objectId);
- OutputObjectSanityCheck(outHashId);
SlangResult res = SLANG_OK;
slang::IComponentType* pObj = getObjectPointer(objectId);
@@ -115,16 +114,17 @@ namespace SlangRecord
if (outHash)
{
- m_objectMap.add(outHashId, outHash);
if (outHash->getBufferSize())
{
uint8_t* buffer = (uint8_t*)outHash->getBufferPointer();
Slang::StringBuilder strBuilder;
+ strBuilder << "entrypoint: "<< entryPointIndex << ", target: " << targetIndex << ", hash: ";
+
for (size_t i = 0; i < outHash->getBufferSize(); i++)
{
- strBuilder<<Slang::StringUtil::makeStringWithFormat("%.2X ", buffer[i]);
+ strBuilder<<Slang::StringUtil::makeStringWithFormat("%.2X", buffer[i]);
}
- slangRecordLog(LogLevel::Verbose, "getEntryPointHash: %s\n", strBuilder.begin());
+ slangRecordLog(LogLevel::Verbose, "%s\n", strBuilder.begin());
}
else
{