Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting SharpDX.SharpDXException while running demo with Visual Studio 2019 #68

Open
alam123 opened this issue Apr 22, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@alam123
Copy link

commented Apr 22, 2019

SharpDX.SharpDXException
HResult=0x80070057
Message=HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.

Source=SharpDX
StackTrace:
at SharpDX.Result.CheckError()
at SharpDX.Direct3D11.Device.CreateVertexShader(IntPtr shaderBytecodeRef, PointerSize bytecodeLength, ClassLinkage classLinkageRef, VertexShader vertexShaderOut)
at SharpDX.Direct3D11.VertexShader..ctor(Device device, Byte[] shaderBytecode, ClassLinkage linkage)
at DemoRenderer.ShapeDrawing.RayTracedRenderer`1..ctor(Device device, ShaderCache cache, String shaderPath, Int32 maximumInstancesPerDraw) in C:\Work\Games\bepuphysics2-master\DemoRenderer\ShapeDrawing\RayTracedRenderer.cs:line 70
at DemoRenderer.Renderer..ctor(RenderSurface surface) in C:\Work\Games\bepuphysics2-master\DemoRenderer\Renderer.cs:line 71
at Demos.GameLoop..ctor(Window window) in C:\Work\Games\bepuphysics2-master\Demos\GameLoop.cs:line 33
at Demos.Program.Main(String[] args) in C:\Work\Games\bepuphysics2-master\Demos\Program.cs:line 16

@RossNordby

This comment has been minimized.

Copy link
Member

commented Apr 22, 2019

What operating system and video card are you using? Any DX11 class GPU should suffice, and in theory windows 7 or above should work. (There's been one report that windows 7 didn't work, though; not sure why at this point.)

You can also enable the directx debug layer to get a better description of the issue.

  1. Run in debug mode to make the demos choose to create the device with the debug layer enabled, and then
  2. modify the Demos/Properties/launchSettings.json to enable native debugging:
{
  "profiles": {
    "Demos": {
      "commandName": "Project",
      "nativeDebugging": true
    }
  }

Loading all the symbols will take a little while at first, but in the visual studio debug output window, you can then see things like:

D3D11 ERROR: ID3D11Device::CreateBuffer: When createing a buffer with the MiscFlag D3D11_RESOURCE_MISC_BUFFER_STRUCTURED specified, the ByteWidth must be a multiple of the StructureByteStride. [ STATE_CREATION ERROR #2097339: CREATEBUFFER_INVALIDSTRUCTURESTRIDE]

@procfxgen

This comment has been minimized.

Copy link

commented Apr 28, 2019

SharpDX.SharpDXException
HResult=0x80070057
Message=HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: Paramètre incorrect.

Source=SharpDX
StackTrace:
at SharpDX.Result.CheckError()
at SharpDX.Direct3D11.Device.CreateBuffer(BufferDescription& descRef, Nullable1 initialDataRef, Buffer bufferOut) at SharpDX.Direct3D11.Buffer..ctor(Device device, BufferDescription description) at DemoRenderer.StructuredBuffer1.CreateBufferForSize(Int32 size, Buffer& newBuffer, ShaderResourceView& newSRV, UnorderedAccessView& newUAV) in E:\Downloaded\bepuphysics2\DemoRenderer\StructuredBuffer.cs:line 82
at DemoRenderer.StructuredBuffer`1..ctor(Device device, Int32 initialCapacity, String debugName) in E:\Downloaded\bepuphysics2\DemoRenderer\StructuredBuffer.cs:line 76
at DemoRenderer.ShapeDrawing.MeshCache..ctor(Device device, BufferPool pool, Int32 initialSizeInVertices) in E:\Downloaded\bepuphysics2\DemoRenderer\ShapeDrawing\MeshCache.cs:line 36
at DemoRenderer.ShapeDrawing.ShapesExtractor..ctor(Device device, ParallelLooper looper, BufferPool pool, Int32 initialCapacityPerShapeType) in E:\Downloaded\bepuphysics2\DemoRenderer\ShapeDrawing\ShapesExtractor.cs:line 35
at DemoRenderer.Renderer..ctor(RenderSurface surface) in E:\Downloaded\bepuphysics2\DemoRenderer\Renderer.cs:line 70
at Demos.GameLoop..ctor(Window window) in E:\Downloaded\bepuphysics2\Demos\GameLoop.cs:line 33
at Demos.Program.Main(String[] args) in E:\Downloaded\bepuphysics2\Demos\Program.cs:line 16

@RossNordby

This comment has been minimized.

Copy link
Member

commented Apr 28, 2019

Unfortunately, I can't do much with the exception alone- it's sort of a catchall. I suspect there is some sort of hardware, OS, or maybe SDK incompatibility causing these, but to make progress toward confirming that I need to know more details:

  1. What GPU are you using?
  2. What OS version are you using?
  3. What is the latest Windows SDK version you have installed? (There should be a Windows SDK Configuration Tool already installed which lists the SDKs on your computer)
  4. Do you see any D3D11 debug layer WARNING or ERROR messages in the debug output when following the instructions above?
@alam123

This comment has been minimized.

Copy link
Author

commented May 12, 2019

My graphics card is I am using NVidia Quadro FX 580.

@RossNordby

This comment has been minimized.

Copy link
Member

commented May 12, 2019

Unfortunately, that card does not support DX11, so that would explain the crash. The demos require DX11 to run. (The library itself, of course, has no GPU-related dependencies.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.