AlexandreMutel

Members
  • Content count

    125
  • Joined

  • Last visited

Everything posted by AlexandreMutel

  1. DX12 .Net DX12

      FYI, SharpDX Direct3D12 is being used for example in Xenko engine (see here) and afaik, It has been working well for them.       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.
  2. Dynamic Vertex Streams in SharpDX

    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.
  3. 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...
  4. SharpDX: MRT problem

    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...
  5. 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.
  6. Render to a texture in D2D+DWrite+SharpDX

    The message is pretty explicit. Your render target is not compatible with what is expecting D2D.   As you haven't posted the declaration of your render target, it is impossible to make a clear diagnostic, but when you say "my loaded texture2d,", this is suspicious. This must be a texture declared as a render target, not a texture that you load from the disk.
  7. Problem With Creation of TypedBuffer

      This was explicitly explained in the link above, item 3) "And check the output log of Visual Studio in the Output Log tab"       You should be able to see your problem with this message.   When you create a buffer view, you need to tell the range of data that is going into the view. In your sample, you don't define this. Check the documentation D3D11_SHADER_RESOURCE_VIEW_DESC , D3D11_BUFFER_SRV doc,  For this Shader Resource View you need to define ElementOffset and ElementWidth but the error message (and documentation) is a bit misleading because they should suggest the number of elements, not the size of a single element, so prefer using ElementCount and FirstElement, like this: var desc = new ShaderResourceViewDescription(); desc.Dimension = ShaderResourceViewDimension.Buffer; desc.Format = SharpDX.DXGI.Format.R32_UInt; desc.Buffer.FirstElement = 0; // same as ElementOffset in error message but more appropriate desc.Buffer.ElementCount = MaximumCount; // same as ElementWidth in error message but more appropriate You will get probably similar error for the declaration of UAV view.
  8. Problem With Creation of TypedBuffer

    I don't really believe this. Can you copy/paste the full output log of Visual Studio?
  9. Problem With Creation of TypedBuffer

    Help yourself  "How to debug a SharpDX Exception"
  10. [SharpDX] Question about Z-Buffer

      SharpDX is providing low-level DirectX and a higher level API with the Toolkit. I assume you are talking about the Toolkit, but please in the future, try to give more context.   That being said, I don't know how you are looking at the source code or even you are usually using an API, but the method GraphicsDevice.SetDepthStencilState is well defined.   Also, GraphicsDevice.DepthStencilStates.Default and None provides default states, and can be used like this: GraphicsDevice.SetDepthStencilState(GraphicsDevice.DepthStencilStates.Default); .... GraphicsDevice.SetDepthStencilState(GraphicsDevice.DepthStencilStates.None); It is the same behavior for blend states and rasterizer states.
  11. SharpDx and d3dcompiler_XX.dll

    You need to add it to your csproj like it is done in this sample
  12. SharpDx and d3dcompiler_XX.dll

    If you are using nuget packages and building desktop applications, it will link by default the old DirectX June 2010 runtime. In order to use more recent d3dcompiler_47.dll (deployed on Windows8.x), you need to setup a config variable in your project   If you are referencing manually binaries, simply link against DirectX11_2-net40
  13. SharpDX Drawing rectangle

      You just need to add this case yes. You can also consider drawing this grid differently long horizontal/vertical lines, and a 4 long lines around to close the board. It all depends on your requirements regarding the grid (if you need to move a single point in the grid not aligned to the others or not)
  14. SharpDX Drawing rectangle

    You are using PrimitiveType.LineStrip which is as stated in the doc `Renders the vertices as a single polyline.` Instead you should use PrimitiveType.LineList which is "Renders the vertices as a list of isolated straight line segments.". You will have to change your points gen also that you have (p0-p1), (p1-p2), (p2-p3)....etc.
  15.   The external refcount on the device when using DebugDevice is normal, as it is the DebugDevice itself that is probably holding these references, so you can't really avoid them. If everything else has external refcount = 0, it can be considered clean.   When you run the device in debug mode (not using DebugDevice), the d3d11 runtime will output automatically a ReportLiveObject() if there is anything suspicious, but unlike DebugDevice, it is not holding anykind of refcounts on the main device, so if all objects are disposed correctly, you should not get any output. Note that the current auto output seems to be broken on on W8.1 (It doesn't print object type....etc.)
  16. I have the same problem here. I suspect a recent update but don't recall last time I used the debug output and it was valid. I have installed recently the VS2013 Update 2 RC, so It might be this install that messed up things here... If there is someone else with Windows8.1 but without VS2013 Update 2 RC to confirm this?
  17. C# for Xbox anyone? I'm excited!

      Hey, 3Gb RAM max - even shared - that would be fine for lots of indie games! If they are not messing with the market and that small games could be sold via this channel, that would be great
  18. C# for Xbox anyone? I'm excited!

    While this is indeed encouraging, It is still unclear if C# on XBox One will get the same level of access as the private Indie XBox One program is currently allowed. Specifically, we are not yet sure that apps developed in C# will be considered as Game Apps or plain AppOS with limited resources (don't know the details, but could have memory/GPU restrictions...etc.)
  19.   Unfortunately, SharpDX has been designed primarily to be used from C# where you can fully leverage OO programming (like overloading methods using by ref parameters) and use unsafe code whenever critical code requires it. It is unfortunate that VB.NET doesn't support these. Going through all the methods/interfaces would be quite a job and would break lots of interfaces, but it is still doable.
  20. SharpDX - read R16F into array

    You can't back read the whole texture in a float array as the number of bytes per row is more likely to be different when mapping the resource. Check the box.RowPitch that will give you exactly the number of bytes per row (that will not equal to sizeof(float) * 4097). Internally, the texture on the GPU is not having a size of 4097 but will align it to the need of its architecture.   You need to iterate on each row and copy them one at a time when the box.RowPitch doesn't match your target rowpitch.
  21. Compiling SharpDX requires to install prerequisites (as described on the download page: Windows SDK7.1 even for Windows8, DirectX June SDK 2010, Net20/Net35 on Windows8) and select the correct solution target platform (DirectX11_2Debug) when building
  22. Using the latest dev package 2.5.1 from the home page, this should be in the folder DirectX11_2-net40 and constructors are available from the DXGI assembly there. [Edit] You don't need to build yourself, there is a build 2.5.1 package build updated to the latest changes[/Edit]
  23. Model import adventures

    Actually the problem is not in the binary definition of data but lies into data filtering/transformations and semantic/organizational changes performed by each application/libraries.   Having a common binary language would just help a little in this case. Because you will still have datas organized/interpreted differently, stripped down between a big blob collada file and an optimized file suitable for loading at runtime. Data transformation is not an easy topic, well... its even the whole purpose of a program! ;)   Things as simple as bones matrices can sometimes be interpreted/organized differently, handiness is often a concern between applications. A supposedly common format like FBX is quite a challenge to master with its handling (not-always-documented or not documented at all) of matrices/skeleton/skinning/channels/animations/handiness...etc,  Add to this a bit of salt, like Maya or 3DS are exporting things differently to this format...etc
  24. Mipmaps on Windows Phone 8

    Please provide more code sample and context, this is really too vague (e.g. "generate mipmaps"? Is it by using DeviceContext.GenerateMips or your own shader using separate texture for each mipmaps or using render target view on mipmaps?...etc.)
  25. Using NVIDIA Nsight with SharpDX

    We are using it at work and afaik it is working fine. Make sure that you are running the app in x86 mode, with d3d11 and latest compatible NVidia driver. Also make sure the device is instantiated in 11.0 and not level 9.x.[Edit] Just did a test at home with latest version and it is working well. You need to set x86 as AnyCpu on a 64bit system will not work with NSight (don't think NSight is able to debug 64bits apps)