[SlimDX] SoftwareVertexProcessing problem

Started by
3 comments, last by ArcticHammer 14 years, 6 months ago
I'm unable to get the DirectX9 device created with SoftwareVertexProcessing. The chip supports DX9, but it does not support HardwareVertexProcessing. My customer has Intel GMA 950 chip and after many fix tries I have to turn to you, guys. Sadly, I don't have the the GMA 950 available here so I can't test it by myself. The customer starts to get fed up with this... I've tried with March 2009 SlimDX version. The device creating code: m_pp = new PresentParameters(); m_pp.Windowed = true; m_pp.PresentationInterval = PresentInterval.One; m_pp.PresentFlags = PresentFlags.None; m_pp.BackBufferHeight = 0;//auto m_pp.BackBufferWidth = 0; //auto m_pp.BackBufferFormat = Format.A8R8G8B8; m_pp.AutoDepthStencilFormat = Format.D16; m_pp.SwapEffect = SwapEffect.Discard; m_D3D = new Direct3D(); CreateFlags createFlags = 0; Capabilities caps = m_D3D.GetDeviceCaps(0, DeviceType.Hardware); if ((caps.DeviceCaps & DeviceCaps.HWTransformAndLight) != 0) { createFlags |= CreateFlags.HardwareVertexProcessing; if ((caps.DeviceCaps & DeviceCaps.PureDevice) != 0) { createFlags |= CreateFlags.PureDevice; } } else { createFlags |= CreateFlags.SoftwareVertexProcessing; } m_dxDevice = new SlimDX.Direct3D9.Device(m_D3D, 0, DeviceType.Hardware, a_parentControl.Handle, createFlags, m_pp); //THROWS SOME EXCEPTION with the Intel GMA 950 chip the same kind of initialization code perfectly works with ManagedDirectX, but not with SlimDX. Does somebody know where's the problem? Bug in SlimDX?
Advertisement
Hard to say without knowing what exception was thrown and what the HRESULT was. Are you sure you copied and pasted the exact same code in MDX? Generally SlimDX does nothing but pass values through to the native call.

Why do you want a backbuffer format with alpha?

August 2009 is the latest version of the SDK.
Hey, I'm having a similar problem with pretty much identical code (although I am trying with a card which supports hardware VP.) The error I get is an unhandled Direct3D9Exception and the code was D3DERR_INVALIDCALL.

            // Create the d3d handle            Engine.g_d3d = new Direct3D();            // Check the display mode.            DisplayMode mode = Engine.g_d3d.Adapters.DefaultAdapter.CurrentDisplayMode;            Engine.g_d3d.CheckDeviceType(Engine.g_d3d.Adapters.DefaultAdapter.Adapter,                DeviceType.Hardware, mode.Format, mode.Format, true);            Engine.g_d3d.CheckDeviceType(Engine.g_d3d.Adapters.DefaultAdapter.Adapter,                DeviceType.Hardware, Format.X8R8G8B8, Format.X8R8G8B8, false);            // Check for HW T&L            Capabilities caps = Engine.g_d3d.GetDeviceCaps(Engine.g_d3d.Adapters.DefaultAdapter.Adapter,                DeviceType.Hardware);            CreateFlags devBehaviourFlags = CreateFlags.None;            if ((caps.DeviceCaps & DeviceCaps.HWTransformAndLight) != 0)            {                devBehaviourFlags |= m_RequestedVP;            }            else            {                devBehaviourFlags |= CreateFlags.SoftwareVertexProcessing;            }            // If pure device and HW T&L supported            if ((caps.DeviceCaps & DeviceCaps.PureDevice) != 0 &&               (devBehaviourFlags & CreateFlags.HardwareVertexProcessing) != 0)            {                devBehaviourFlags |= CreateFlags.PureDevice;            }            m_d3dPP = new PresentParameters();            m_d3dPP.BackBufferWidth = 800;            m_d3dPP.BackBufferHeight = 600;            m_d3dPP.BackBufferFormat = Format.X8R8G8B8;            m_d3dPP.BackBufferCount = 1;            m_d3dPP.Multisample = MultisampleType.None;            m_d3dPP.MultisampleQuality = 0;            m_d3dPP.SwapEffect = SwapEffect.Discard;            m_d3dPP.DeviceWindowHandle = this.Handle;            m_d3dPP.Windowed = true;            m_d3dPP.EnableAutoDepthStencil = true;            m_d3dPP.AutoDepthStencilFormat = Format.D24S8;            m_d3dPP.PresentFlags = PresentFlags.None;            m_d3dPP.FullScreenRefreshRateInHertz = Engine.g_d3d.Adapters.DefaultAdapter.CurrentDisplayMode.RefreshRate;            m_d3dPP.PresentationInterval = PresentInterval.Immediate;            // Create the device            Engine.g_d3dDevice = new Device(Engine.g_d3d, 0,                m_DevType, this.Handle, devBehaviourFlags, m_d3dPP); // This throws the exception.
What do the debug runtimes say?
Mike Popoloski | Journal | SlimDX
Thanks guys for trying to help.

I downloaded the SlimDX source code and analyzed it from the Device creating part. I found out that the fault really can not be in SlimDX.

Today I got the troubleful PC from the customer and resolved the problem. Intel GMA950 does not seem to support any kind of multisampling. In other part of the code I have setting for the PresentParameters.Multisample. It must be MultisampleType.None for GMA.

Furthermore, as adviced, I changed the backbuffer format from Format.A8R8G8B8 to BackBufferFormat = Format.X8R8G8B8. There's really no reason to have alpha in backbuffer.

Thanks.

This topic is closed to new replies.

Advertisement