I am trying to create a shared texture, using SlimDX instead of the C++ API. I get an exception when attempting to call OpenSharedResource on the Direct3D 10 device. The code is as follows:
The texture description
private static readonly Texture2DDescription SharedTextureDesc = new Texture2DDescription
{
Width = 1024,
Height = 768,
MipLevels = 1,
ArraySize = 1,
Format = Format.R8G8B8A8_UNorm,
SampleDescription = new SampleDescription(1, 0),
Usage = ResourceUsage.Default,
BindFlags = BindFlags.RenderTarget | BindFlags.ShaderResource,
CpuAccessFlags = CpuAccessFlags.None,
OptionFlags = ResourceOptionFlags.Shared
};
Attempting to open shared resource:
GraphicsDevice10 = new DX10.Device(DX10.DriverType.Hardware, DX10.DeviceCreationFlags.None);
SharedTexture = new Texture2D(GraphicsDevice11, SharedTextureDesc);
SharedResource = new SlimDX.DXGI.Resource(SharedTexture);
var shared = GraphicsDevice10.OpenSharedResource<Texture2D>(SharedResource.SharedHandle);
[font="Arial"]GraphicsDevice11 is created previously. Both devices are successfully created, checked in the debugger. However, when I call OpenSharedResource, I get the following unmanaged exception:
An unhandled exception of type 'SlimDX.Direct3D10.Direct3D10Exception' occurred in SlimDX.dll
Additional information: E_NOINTERFACE: The requested COM interface is not available (-2147467262)
On a side note, I am new to DXGI and DirectX10+, having just now transitioned from DirectX 9.0c and XNA 3.0. What other debugging measures can I take, since I can no longer just enable the debug runtimes? I only have unmanged code debugging enabled, and I feel that there should be more.
[/font]