diff options
| author | Yong He <yonghe@outlook.com> | 2020-11-10 14:55:36 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-10 14:55:36 -0800 |
| commit | 7bcc2b15c8be4aebc6b9b8f05af6db7a451b228b (patch) | |
| tree | 2b89d5deaa9992cdb8c6c1ff72a399a5176be802 /tools/render-test/cuda/cuda-compute-util.cpp | |
| parent | 1c4d768bc1b400ab40c10715df98d0b2122bcd66 (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/cuda/cuda-compute-util.cpp')
| -rw-r--r-- | tools/render-test/cuda/cuda-compute-util.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
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<ISlangBlob> 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]))) |
