diff --git a/projects/clr/rocclr/runtime/device/pal/paldevice.cpp b/projects/clr/rocclr/runtime/device/pal/paldevice.cpp index 85005d30e3..11696f8bc7 100644 --- a/projects/clr/rocclr/runtime/device/pal/paldevice.cpp +++ b/projects/clr/rocclr/runtime/device/pal/paldevice.cpp @@ -1585,7 +1585,6 @@ Device::createView(amd::Memory& owner, const device::Memory& parent) const return gpuImage; } - //! Attempt to bind with external graphics API's device/context bool Device::bindExternalDevice(uint flags, void* const pDevice[], void* pContext, bool validateOnly) @@ -1607,13 +1606,19 @@ Device::bindExternalDevice(uint flags, void* const pDevice[], void* pContext, bo } } - if (flags & (amd::Context::Flags::D3D9DeviceKhr | - amd::Context::Flags::D3D9DeviceEXKhr)) { + if (flags & amd::Context::Flags::D3D9DeviceKhr) { if (!associateD3D9Device(pDevice[amd::Context::DeviceFlagIdx::D3D9DeviceKhrIdx])) { LogWarning("D3D9<->OpenCL adapter mismatch or D3D9Associate() failure"); return false; } } + + if (flags & amd::Context::Flags::D3D9DeviceEXKhr) { + if (!associateD3D9Device(pDevice[amd::Context::DeviceFlagIdx::D3D9DeviceEXKhrIdx])) { + LogWarning("D3D9<->OpenCL adapter mismatch or D3D9Associate() failure"); + return false; + } + } #endif //_WIN32 if (flags & amd::Context::Flags::GLDeviceKhr) {