Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 25 Jul 2008
Offline Last Active Jul 20 2016 08:10 AM

Posts I've Made

In Topic: .Net DX12

18 June 2016 - 06:27 PM

What's the best option for playing with DirectX 12 from .NET?  I think SharpDX has implemented support for DX12, but I have more experience using SlimDX.  Did the SlimDX DX12 version ever happen?  I remember hearing some plans here about it.


FYI, SharpDX Direct3D12 is being used for example in Xenko engine (see here) and afaik, It has been working well for them.



That's the second time someone's asked this week. I haven't worked with SharpDX so I can't speak to that experience apart from where he used our code -_- But I felt that duplicating his work was not necessarily productive. If that's really not the case, and people really want a hand written SlimDX-based wrapper, then I'll see if I can pull something together.


Just a little bit more context for the readers about what Promit implies by "used our code", as one may come to the simplified conclusion that SharpDX is a copy of SlimDX or it "robbed" their code:


When I started to developed the early genuine prototype behind SharpDX (AnyCPU assemblies + full code generation of the API from the DirectX SDK headers instead of handwriting as it was done in SlimDX, more info in this old blog post), I indeed used some of the infrastructure classes and samples developed by SlimDX to boostrap it (e.g things like DataStream, RenderForm, all mathematics classes...etc.).


I then proposed the concept to the SlimDX team but it didn't work well (they wanted to rebuild from the ground up my prototype, I wanted to release it asap and evolve it in smaller steps), so I decided to launch SharpDX in November 2010 (on google code at that time). I have to admit that in the rush of releasing the code + using a tool like ReSharper that was replacing automatically all the License headers in files in bulk mode + my not-enough awareness/carefulness of licensing attributions (my deep apologize for that), the copied code from SlimDX was not giving Licensing attributions.


Promit sent me an email in February 2011 to fix this situation, which I did promptly, as you can verify that files used from SlimDX have the proper licensing since then (for example DataStream.cs), I may have missed some files when I did it, but hope not...


So, to put in perspective, this "used our code" is a very small fraction, measured under < 1% to the total code base of SharpDX.

In Topic: Dynamic Vertex Streams in SharpDX

05 October 2015 - 06:15 PM

As @turnpast suggested, the `points` array is on the CPU and won't update anything on GPU side. You need to upload your CPU vertex buffer to GPU using `MapSubresource`, get a pointer to the writeable buffer, stream data to this memory location, then `UnMap` the buffer before drawing anything.

In Topic: SharpDX.Toolkit EffectPass implementation question

05 August 2015 - 10:29 PM

Not exactly sure about your question, but this code was done to optimize the resource bindings so that if you have multiple resources that are consecutive in terms of slots: for example instead of setting a shader resource for each slot 0, 1, 2, 3 we could squash them into a single call 0-3.


The part that is making the slot allocation is actually the one that is complicated, otherwise the code above is pretty standard, though it uses directly pointers (that are setup by the allocator), instead of using plain method like `SetShaderResource(int slot, ShaderResource resource)` in purpose because we wanted to be able to batch/squash multiple consecutive resource bindings.


Hope it clarifies a bit...

In Topic: SharpDX: MRT problem

03 August 2015 - 01:33 AM

Could you try the method d3d11Context.OutputMerger.SetTargets instead? as it is using internally the simpler method that doesn't touch UAV bindings... wondering if the UAV version is correctly working...

In Topic: SharpDX Shader Bytes - VertexShader accepts nothing

21 May 2015 - 08:39 PM

Whenever you have a SharpDXException, D3D provides most of the time a debug layer to help you dig into the problem. Follow this post for details.