P4 to Git Change 1246105 by cpaquot@hog-ocl on 2016/03/10 15:13:37

SWDEV-89711 - Adding EGL interop capability:
	- Remove Context::Info::type_ and only use flags_, it's more accurate and type_ was just redundant
	- Plumbing work for EGL at the top of the API layer.

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/9965/diff/

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_d3d10.cpp#11 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_d3d11.cpp#18 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_d3d9.cpp#28 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_gl.cpp#48 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_gl_amd.hpp#18 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpudevice.hpp#94 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#269 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#542 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#157 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsadevice.cpp#56 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsadevice.hpp#25 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/context.cpp#40 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/context.hpp#24 edit


[ROCm/clr commit: 269f599f85]
Tento commit je obsažen v:
foreman
2016-03-10 15:21:20 -05:00
rodič 6d635edb3b
revize 42c2836e5a
6 změnil soubory, kde provedl 33 přidání a 41 odebrání
+14 -23
Zobrazit soubor
@@ -1767,13 +1767,12 @@ Device::createView(amd::Memory& owner, const device::Memory& parent) const
//! Attempt to bind with external graphics API's device/context
bool
Device::bindExternalDevice(
intptr_t type, void* pDevice, void* pContext, bool validateOnly)
uint flags, void* pDevice, void* pContext, bool validateOnly)
{
assert(pDevice);
switch (type) {
#ifdef _WIN32
case CL_CONTEXT_D3D10_DEVICE_KHR:
if (flags & amd::Context::Flags::D3D10DeviceKhr) {
// There is no need to perform full initialization here
// if the GSLDevice is still uninitialized.
// Only adapter initialization is required
@@ -1786,8 +1785,8 @@ Device::bindExternalDevice(
LogError("Failed gslD3D10Associate()");
return false;
}
break;
case CL_CONTEXT_D3D11_DEVICE_KHR:
}
else if (flags & amd::Context::Flags::D3D11DeviceKhr) {
// There is no need to perform full initialization here
// if the GSLDevice is still uninitialized.
// Only adapter initialization is required to validate
@@ -1800,8 +1799,8 @@ Device::bindExternalDevice(
LogError("Failed gslD3D11Associate()");
return false;
}
break;
case CL_CONTEXT_ADAPTER_D3D9_KHR:
}
else if (flags & amd::Context::Flags::D3D9DeviceKhr) {
PerformAdapterInitialization();
// Associate GSL-D3D
@@ -1810,8 +1809,8 @@ Device::bindExternalDevice(
LogWarning("D3D9<->OpenCL adapter mismatch or D3D9Associate() failure");
return false;
}
break;
case CL_CONTEXT_ADAPTER_D3D9EX_KHR:
}
else if (flags & amd::Context::Flags::D3D9DeviceEXKhr) {
PerformAdapterInitialization();
// Associate GSL-D3D
@@ -1820,13 +1819,11 @@ Device::bindExternalDevice(
LogWarning("D3D9<->OpenCL adapter mismatch or D3D9Associate() failure");
return false;
}
break;
case CL_CONTEXT_ADAPTER_DXVA_KHR:
break;
}
else if (flags & amd::Context::Flags::D3D9DeviceVAKhr) {
}
#endif //_WIN32
case CL_GL_CONTEXT_KHR:
{
if (flags & amd::Context::Flags::GLDeviceKhr) {
// There is no need to perform full initialization here
// if the GSLDevice is still uninitialized.
// Only adapter initialization is required to validate
@@ -1841,20 +1838,14 @@ Device::bindExternalDevice(
return false;
}
}
break;
default:
LogError("Unknown external device!");
return false;
break;
}
return true;
}
bool
Device::unbindExternalDevice(intptr_t type, void* pDevice, void* pContext, bool validateOnly)
Device::unbindExternalDevice(uint flags, void* pDevice, void* pContext, bool validateOnly)
{
if (type != CL_GL_CONTEXT_KHR) {
if ((flags & amd::Context::Flags::GLDeviceKhr) == 0) {
return true;
}