From b89d0bea0f15fd4e590664e79289a80933e8d38d Mon Sep 17 00:00:00 2001 From: foreman Date: Mon, 19 Sep 2016 20:13:01 -0400 Subject: [PATCH] P4 to Git Change 1316123 by gandryey@gera-w8 on 2016/09/19 18:22:55 SWDEV-102286 - [CQE OCL][OpenCL on PAL] 32/64 "DX9" OpenCL SDK Sample is crashing - Correct DX9 device binding Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#22 edit [ROCm/clr commit: b65af32fe1628551f75c99cbb271472a7d90f0f2] --- projects/clr/rocclr/runtime/device/pal/paldevice.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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) {