From 8235cb446280515df3fe3549249cf34aa28ec8ab Mon Sep 17 00:00:00 2001 From: Jason Tang Date: Wed, 28 Jul 2021 17:18:21 -0400 Subject: [PATCH] SWDEV-296911 - Enable clgl interop for both MesaGL and OrcaGL Change-Id: Ie3ad85a8335b1fc751812c09bb0cd30aad38dcae [ROCm/clr commit: f1657370969acf86d8fbc6d5164694f8806bcc20] --- projects/clr/rocclr/cmake/ROCclr.cmake | 2 +- projects/clr/rocclr/device/rocm/rocmemory.cpp | 9 ++++----- projects/clr/rocclr/device/rocm/rocsettings.cpp | 2 -- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/projects/clr/rocclr/cmake/ROCclr.cmake b/projects/clr/rocclr/cmake/ROCclr.cmake index 9b1fced624..0eebda08ad 100644 --- a/projects/clr/rocclr/cmake/ROCclr.cmake +++ b/projects/clr/rocclr/cmake/ROCclr.cmake @@ -96,7 +96,7 @@ else() option(BUILD_LINUXPRO "Build LinuxPro" OFF) if(BUILD_LINUXPRO) target_compile_definitions(rocclr PUBLIC - ROCCLR_DISABLE_PREVEGA ROCCLR_ENABLE_GL_SHARING) + ROCCLR_DISABLE_PREVEGA ) endif() endif() diff --git a/projects/clr/rocclr/device/rocm/rocmemory.cpp b/projects/clr/rocclr/device/rocm/rocmemory.cpp index 5a35d85031..f4e6ee1e8d 100644 --- a/projects/clr/rocclr/device/rocm/rocmemory.cpp +++ b/projects/clr/rocclr/device/rocm/rocmemory.cpp @@ -269,13 +269,12 @@ bool Memory::createInteropBuffer(GLenum targetType, int miplevel) { if (status != HSA_STATUS_SUCCESS) return false; - //! @todo Need to handle metadata correctly -#if 0 - // if map_buffer wrote anything in metadata, copy it to amdImageDesc_ - if (metadata_size != 0) { + // if map_buffer wrote a legitimate SRD, copy it to amdImageDesc_ + if ((metadata_size != 0) && + (reinterpret_cast(metadata)->deviceID == + amdImageDesc_->deviceID)) { memcpy(amdImageDesc_, metadata, metadata_size); } -#endif //0 kind_ = MEMORY_KIND_INTEROP; assert(deviceMemory_ != nullptr && "Interop map failed to produce a pointer!"); diff --git a/projects/clr/rocclr/device/rocm/rocsettings.cpp b/projects/clr/rocclr/device/rocm/rocsettings.cpp index a1845caa91..17c940e3f3 100644 --- a/projects/clr/rocclr/device/rocm/rocsettings.cpp +++ b/projects/clr/rocclr/device/rocm/rocsettings.cpp @@ -129,11 +129,9 @@ bool Settings::create(bool fullProfile, uint32_t gfxipMajor, uint32_t gfxipMinor enableExtension(ClAmdMediaOps2); enableExtension(ClKhrImage2dFromBuffer); -#ifdef ROCCLR_ENABLE_GL_SHARING if (MesaInterop::Supported()) { enableExtension(ClKhrGlSharing); } -#endif // Enable platform extension enableExtension(ClAmdDeviceAttributeQuery);