summaryrefslogtreecommitdiffstats
path: root/tools/render-test/cpu-compute-util.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2020-11-10 14:55:36 -0800
committerGitHub <noreply@github.com>2020-11-10 14:55:36 -0800
commit7bcc2b15c8be4aebc6b9b8f05af6db7a451b228b (patch)
tree2b89d5deaa9992cdb8c6c1ff72a399a5176be802 /tools/render-test/cpu-compute-util.cpp
parent1c4d768bc1b400ab40c10715df98d0b2122bcd66 (diff)
Use integer RTTI/witness handles in existential tuples. (#1598)
* Use integer RTTI/witness handles in existential tuples. * Fix clang error. * Fix IR serialization to use 16bits for opcode. * Undo accidental comment change. * Use variable length encoding for opcode. * Fix compile error. * Fixing issues * Fix code review issues.
Diffstat (limited to 'tools/render-test/cpu-compute-util.cpp')
-rw-r--r--tools/render-test/cpu-compute-util.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/tools/render-test/cpu-compute-util.cpp b/tools/render-test/cpu-compute-util.cpp
index a861dadf3..72e44fb78 100644
--- a/tools/render-test/cpu-compute-util.cpp
+++ b/tools/render-test/cpu-compute-util.cpp
@@ -427,7 +427,7 @@ SlangResult CPUComputeUtil::fillRuntimeHandleInBuffers(
{
for (auto& rtti : entry.rttiEntries)
{
- void* ptrValue = nullptr;
+ uint64_t ptrValue = 0;
switch (rtti.type)
{
case RTTIDataEntryType::RTTIObject:
@@ -439,7 +439,7 @@ SlangResult CPUComputeUtil::fillRuntimeHandleInBuffers(
linkage->getTypeRTTIMangledName(concreteType, outName.writeRef());
if (!outName)
return SLANG_FAIL;
- ptrValue = sharedLib->findSymbolAddressByName((char*)outName->getBufferPointer());
+ ptrValue = (uint64_t)sharedLib->findSymbolAddressByName((char*)outName->getBufferPointer());
}
break;
case RTTIDataEntryType::WitnessTable:
@@ -451,18 +451,14 @@ SlangResult CPUComputeUtil::fillRuntimeHandleInBuffers(
auto interfaceType = reflection->findTypeByName(rtti.interfaceName.getBuffer());
if (!interfaceType)
return SLANG_FAIL;
- ComPtr<ISlangBlob> outName;
- linkage->getTypeConformanceWitnessMangledName(concreteType, interfaceType, outName.writeRef());
- if (!outName)
- return SLANG_FAIL;
- ptrValue = sharedLib->findSymbolAddressByName((char*)outName->getBufferPointer());
+ uint32_t id = -1;
+ linkage->getTypeConformanceWitnessSequentialID(concreteType, interfaceType, &id);
+ ptrValue = id;
break;
}
default:
break;
}
- if (!ptrValue)
- return SLANG_FAIL;
if (rtti.offset >= 0 && rtti.offset + sizeof(ptrValue) <= entry.bufferData.getCount() * sizeof(decltype(entry.bufferData[0])))
{
memcpy(