Jump to content
  • Advertisement
Sign in to follow this  
GL3336563

DX11 About DX11 to DX9 in WPF with SharpDX and two video cards laptop

This topic is 2154 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I use SharpDX with DX11 to DX9 in WPF with my laptop has intel and nvida video card. When I use the Default Intel video card,it work very well. But when I use the nvida video card with change the code like this:
using (Factory1 factory = new Factory1())
{
Adapter1 adapter = factory.GetAdapter1(1
);//0 is intel, 1 is nvida
this.Device = new Device(adapter, DeviceCreationFlags.BgraSupport|DeviceCreationFlags.Debug, FeatureLevel.Level_10_0);
}

When  I  share the  handle  to DX9'Texture.  It report this error in this code :

"this.m_RenderTarget = new Texture(DX11ImageSource.m_D3DDevice, renderTarget.Description.Width, renderTarget.Description.Height,1, Usage.RenderTarget, format, Pool.Default, ref handle);"

 and report:

"HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments]":

Use  Debug mode  with  control panel report:

"Direct3D9: (ERROR) :Error during initialization of texture. CreateTexture failed."
 

Please help Me! Thanks..

 

 

 I can't solve it. I have search the internet,Nobody has similar problem.I only change the adapter ID 0 to 1,in order to use discrete video card in DX11 Part, Then share the handle to DX9 Texture. When I change adpterID and use swapchain in WinForm it work very well. But in wpf I can't use swapchain. Maybe the DX9'Device and DX11'Device must use the same video card? But When I change the DX9'Device adpterID it even can't initialize.

" DX11ImageSource.m_D3DDevice = new DeviceEx(m_D3DContext, 1, DeviceType.Hardware, IntPtr.Zero, CreateFlags.HardwareVertexProcessing, presentparams);"

Edited by GL3336563

Share this post


Link to post
Share on other sites
Advertisement

This topic is 2154 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!