From 7bcc2b15c8be4aebc6b9b8f05af6db7a451b228b Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 10 Nov 2020 14:55:36 -0800 Subject: 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. --- tools/render-test/cuda/cuda-compute-util.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'tools/render-test/cuda/cuda-compute-util.cpp') diff --git a/tools/render-test/cuda/cuda-compute-util.cpp b/tools/render-test/cuda/cuda-compute-util.cpp index 73ad78f0b..cc84d4a00 100644 --- a/tools/render-test/cuda/cuda-compute-util.cpp +++ b/tools/render-test/cuda/cuda-compute-util.cpp @@ -1409,7 +1409,7 @@ static SlangResult _fillRuntimeHandlesInBuffers( { for (auto& rtti : entry.rttiEntries) { - CUdeviceptr ptrValue = 0; + uint64_t ptrValue = 0; switch (rtti.type) { case RTTIDataEntryType::RTTIObject: @@ -1422,7 +1422,7 @@ static SlangResult _fillRuntimeHandlesInBuffers( if (!outName) return SLANG_FAIL; SLANG_CUDA_RETURN_ON_FAIL(cuModuleGetGlobal( - &ptrValue, + (CUdeviceptr*)&ptrValue, nullptr, cudaModule.m_module, (char*)outName->getBufferPointer())); @@ -1438,23 +1438,15 @@ static SlangResult _fillRuntimeHandlesInBuffers( auto interfaceType = reflection->findTypeByName(rtti.interfaceName.getBuffer()); if (!interfaceType) return SLANG_FAIL; - ComPtr outName; - linkage->getTypeConformanceWitnessMangledName( - concreteType, interfaceType, outName.writeRef()); - if (!outName) - return SLANG_FAIL; - SLANG_CUDA_RETURN_ON_FAIL(cuModuleGetGlobal( - &ptrValue, - nullptr, - cudaModule.m_module, - (char*)outName->getBufferPointer())); + uint32_t id = 0xFFFFFFFF; + 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]))) -- cgit v1.2.3