Fichiers
rocm-systems/rocclr/runtime/device/pal/paldeviced3d9.cpp
T
foreman 901e67024a P4 to Git Change 2005728 by gandryey@gera-win10 on 2019/09/27 16:30:22
SWDEV-79445 - OCL generic changes and code clean-up
	- Update copyright header. No functional changes.

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_agent_amd.h#3 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_d3d9_amd.hpp#19 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_debugger_amd.h#8 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_lqdflash_amd.h#7 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_p2p_amd.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_platform_amd.h#3 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_profile_amd.h#4 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_sdi_amd.cpp#5 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_sdi_amd.h#3 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_semaphore_amd.h#4 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_thread_trace_amd.h#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldeviced3d10.cpp#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldeviced3d11.cpp#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldeviced3d9.cpp#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevicegl.cpp#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#29 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paltrap.hpp#3 edit
2019-09-27 16:36:00 -04:00

53 lignes
1.7 KiB
C++

//
// Copyright (c) 2015 Advanced Micro Devices, Inc. All rights reserved.
//
#include "paldevice.hpp"
#if defined(ATI_OS_LINUX)
namespace pal {
bool Device::associateD3D9Device(void* d3dDevice) { return false; }
} // namespace pal
#else // !ATI_OS_LINUX
#include <d3d9.h>
#include <dxgi.h>
/**************************************************************************************************************
* Note: ideally the DXX extension interfaces should be mapped from the DXX perforce branch.
* This means OCL client spec will need to change to include headers directly from the DXX perforce
*tree.
* However, OCL only cares about the DXX OpenCL extension interface class. The spec cannot change
* without notification. So it is safe to use a local copy of the relevant DXX extension interface
*classes.
**************************************************************************************************************/
#include "DxxOpenCLInteropExt.h"
namespace pal {
bool Device::associateD3D9Device(void* d3d9Device) {
D3DCAPS9 pCaps;
IDirect3D9* p3d9dev;
LUID d3d9deviceLuid = {0, 0};
IDirect3DDevice9* pd3d9Device = static_cast<IDirect3DDevice9*>(d3d9Device);
// Get D3D9 Device caps
pd3d9Device->GetDeviceCaps(&pCaps);
// Get 3D9 Device
pd3d9Device->GetDirect3D(&p3d9dev);
IDirect3D9Ex* p3d9devEx = static_cast<IDirect3D9Ex*>(p3d9dev);
p3d9devEx->GetAdapterLUID(pCaps.AdapterOrdinal, &d3d9deviceLuid);
p3d9dev->Release();
// match the adapter
bool canInteroperate = (properties().osProperties.luidHighPart == d3d9deviceLuid.HighPart) &&
(properties().osProperties.luidLowPart == d3d9deviceLuid.LowPart);
return canInteroperate;
}
} // namespace pal
#endif // !ATI_OS_WIN