summaryrefslogtreecommitdiff
path: root/source/slang-record-replay/replay/slang-decoder.cpp
diff options
context:
space:
mode:
authorjarcherNV <jarcher@nvidia.com>2025-08-21 11:42:49 -0700
committerGitHub <noreply@github.com>2025-08-21 18:42:49 +0000
commita5e6ddd006ecf72ad9a41961811e93e1e2f72e64 (patch)
tree869beb336a44dc1e96876a8f63818c4754c740ac /source/slang-record-replay/replay/slang-decoder.cpp
parent44815ba48c1d149137a2210ca3fccfe3bda2626e (diff)
Add record and replay support for IComponentType2 (#8215)
Add record and replay support for the IComponentType2 struct and its functions getTargetCompileResult and getEntryPointCompileResult.
Diffstat (limited to 'source/slang-record-replay/replay/slang-decoder.cpp')
-rw-r--r--source/slang-record-replay/replay/slang-decoder.cpp119
1 files changed, 119 insertions, 0 deletions
diff --git a/source/slang-record-replay/replay/slang-decoder.cpp b/source/slang-record-replay/replay/slang-decoder.cpp
index 4b5606b76..81650cd74 100644
--- a/source/slang-record-replay/replay/slang-decoder.cpp
+++ b/source/slang-record-replay/replay/slang-decoder.cpp
@@ -373,6 +373,9 @@ bool SlangDecoder::processICompositeComponentTypeMethods(
case ApiCallId::ICompositeComponentType_linkWithOptions:
ICompositeComponentType_linkWithOptions(objectId, parameterBlock);
break;
+ case ApiCallId::ICompositeComponentType_queryInterface:
+ ICompositeComponentType_queryInterface(objectId, parameterBlock);
+ break;
}
return true;
}
@@ -423,6 +426,12 @@ bool SlangDecoder::processITypeConformanceMethods(
case ApiCallId::ITypeConformance_linkWithOptions:
ITypeConformance_linkWithOptions(objectId, parameterBlock);
break;
+ case ApiCallId::IComponentType2_getTargetCompileResult:
+ IComponentType2_getTargetCompileResult(objectId, parameterBlock);
+ break;
+ case ApiCallId::IComponentType2_getEntryPointCompileResult:
+ IComponentType2_getEntryPointCompileResult(objectId, parameterBlock);
+ break;
}
return true;
}
@@ -2787,6 +2796,46 @@ void SlangDecoder::ICompositeComponentType_linkWithOptions(
}
}
+void SlangDecoder::ICompositeComponentType_queryInterface(
+ ObjectID objectId,
+ ParameterBlock const& parameterBlock)
+{
+ size_t readByte = 0;
+
+ // Decode the GUID
+ SlangUUID guid;
+ readByte = ParameterDecoder::decodeUint32(
+ parameterBlock.parameterBuffer,
+ parameterBlock.parameterBufferSize,
+ guid.data1);
+ readByte += ParameterDecoder::decodeUint16(
+ parameterBlock.parameterBuffer + readByte,
+ parameterBlock.parameterBufferSize - readByte,
+ guid.data2);
+ readByte += ParameterDecoder::decodeUint16(
+ parameterBlock.parameterBuffer + readByte,
+ parameterBlock.parameterBufferSize - readByte,
+ guid.data3);
+ for (int i = 0; i < 8; i++)
+ {
+ readByte += ParameterDecoder::decodeUint8(
+ parameterBlock.parameterBuffer + readByte,
+ parameterBlock.parameterBufferSize - readByte,
+ guid.data4[i]);
+ }
+
+ // Decode the output interface pointer
+ ObjectID outInterfaceId = 0;
+ readByte = ParameterDecoder::decodeAddress(
+ parameterBlock.outputBuffer,
+ parameterBlock.outputBufferSize,
+ outInterfaceId);
+
+ for (auto consumer : m_consumers)
+ {
+ consumer->ICompositeComponentType_queryInterface(objectId, guid, outInterfaceId);
+ }
+}
void SlangDecoder::ITypeConformance_getSession(
ObjectID objectId,
@@ -3156,4 +3205,74 @@ void SlangDecoder::ITypeConformance_linkWithOptions(
outDiagnosticsId);
}
}
+
+void SlangDecoder::IComponentType2_getTargetCompileResult(
+ ObjectID objectId,
+ ParameterBlock const& parameterBlock)
+{
+ size_t readByte = 0;
+ int64_t targetIndex = 0;
+ readByte = ParameterDecoder::decodeInt64(
+ parameterBlock.parameterBuffer,
+ parameterBlock.parameterBufferSize,
+ targetIndex);
+
+ ObjectID outCompileResultId = 0;
+ ObjectID outDiagnosticsId = 0;
+ readByte = ParameterDecoder::decodeAddress(
+ parameterBlock.outputBuffer,
+ parameterBlock.outputBufferSize,
+ outCompileResultId);
+ readByte += ParameterDecoder::decodeAddress(
+ parameterBlock.outputBuffer + readByte,
+ parameterBlock.outputBufferSize - readByte,
+ outDiagnosticsId);
+
+ for (auto consumer : m_consumers)
+ {
+ consumer->IComponentType2_getTargetCompileResult(
+ objectId,
+ targetIndex,
+ outCompileResultId,
+ outDiagnosticsId);
+ }
+}
+
+void SlangDecoder::IComponentType2_getEntryPointCompileResult(
+ ObjectID objectId,
+ ParameterBlock const& parameterBlock)
+{
+ size_t readByte = 0;
+ int64_t targetIndex = 0;
+ int64_t entryPointIndex = 0;
+ readByte = ParameterDecoder::decodeInt64(
+ parameterBlock.parameterBuffer,
+ parameterBlock.parameterBufferSize,
+ targetIndex);
+ readByte += ParameterDecoder::decodeInt64(
+ parameterBlock.parameterBuffer + readByte,
+ parameterBlock.parameterBufferSize - readByte,
+ entryPointIndex);
+
+ ObjectID outCompileResultId = 0;
+ ObjectID outDiagnosticsId = 0;
+ readByte = ParameterDecoder::decodeAddress(
+ parameterBlock.outputBuffer,
+ parameterBlock.outputBufferSize,
+ outCompileResultId);
+ readByte += ParameterDecoder::decodeAddress(
+ parameterBlock.outputBuffer + readByte,
+ parameterBlock.outputBufferSize - readByte,
+ outDiagnosticsId);
+
+ for (auto consumer : m_consumers)
+ {
+ consumer->IComponentType2_getEntryPointCompileResult(
+ objectId,
+ entryPointIndex,
+ targetIndex,
+ outCompileResultId,
+ outDiagnosticsId);
+ }
+}
} // namespace SlangRecord