Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 25 Jul 2008
Offline Last Active Apr 21 2016 03:17 PM

Topics I've Started

SharpDX 2.4 on WP8 and high level XNA like API

30 October 2012 - 07:41 PM

Hi All!

I'm glad to announce the availability of a new version 2.4 of SharpDX - a Managed .NET framework supporting the whole DirectX API - with two new major features:
  • Adds support for Windows Phone 8: This new version provides full access to WP8 DirectX from .NET (Direct3D11.1, XAudio2, MediaEngine). It allows you to add 3D content seamlessly integrated into your XAML DrawingSurface very easily. Like SharpDX for Windows RT, you can develop a game using Direct3D from .NET without using C++.
  • New SharpDX.Toolkit (beta), a high level API that greatly simplifies access to Direct3D11 by providing a XNA like API with the full power Direct3D11.1 The toolkit allows you to develop a 3D application to target Windows Desktop, Windows RT or Windows Phone 8 using exactly the same code base.
You can find more information here.

ShaderResourceView/ D3D11_BUFFER_SRV doc and usage mistmatch

19 October 2012 - 01:07 AM

Usually when I was creating a ShaderResourceView on a Buffer (in hlsl: Buffer<float4> for example) or a StructuredBuffer (for example: StructuredBuffer<float4>), I was using something like:

[source lang="cpp"]D3D11_SHADER_RESOURCE_VIEW_DESC desc;desc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER;desc.Format = ...;desc.Buffer.FirstElement = index; // Index in element countdesc.Buffer.NumElements = count; // Number of elements[/source]

It is working fine with both type of buffers (plain or structured), but today, I was checking the documentation of D3D11_BUFFER_SRV, and It says something completely invalid to the usage I have of it.
First of all, there is an union:

[source lang="cpp"]typedef struct D3D11_BUFFER_SRV { union { UINT FirstElement; UINT ElementOffset; }; union { UINT NumElements; UINT ElementWidth; };} D3D11_BUFFER_SRV;[/source]

I have two questions:

1) And as stated in the doc FirstElement is "Number of bytes between the beginning of the buffer and the first element to access.", which is not what I'm experiencing, as I use the index of element, not the index * sizeof(element).
Is it the documentation that is wrong or Am I missing something here?

2) Also, ElementOffset would appear to be used with a byte offset, and ElementWidth as the size of the element, but in which case these fields are interpreted like this? I can't find any relevant doc about this.

Any hint highly appreciated! Posted Image

Edit: Sorry for the source code, I can't get the source tag to work correctly, everything is collapsed.

[SharpDX] New version 2.1.0 with Windows 8 Metro Support

10 May 2012 - 04:52 PM

Hi All,
There is a new version 2.1.0 for the managed DirectX wrapper SharpDX, that provides, along lots of new features and bug fixes, full support for Windows 8 Metro development.
Also a new official website is available at http://shardx.org

Closure and function pointers in HLSL

24 November 2011 - 09:36 AM

Hi all,
I just wrote an article on faking closure/chained function pointers in HLSL in order to permit new kind of code reuse/abstraction. This technique is working on SM3.0, 4.0 and 5.0, so It might be useful if you need to perform some code combination without requiring copy/paste or preprocessors directives to work.

SharpDX 1.0 released. A new .Net managed DirectX API

30 November 2010 - 01:29 AM

Hi all,

I'm pleased to announce the 1st release of SharpDX 1.0, an opensource project that provides a new plartform independent .Net managed DirectX API.

Key features of this project are:
  • API is generated from DirectX SDK headers : meaning a complete and reliable API and an easy support for future API.

  • Full support for the following DirectX API:
    • Direct3D10
    • Direct3D10.1
    • Direct3D11
    • Direct2D1 (including custom rendering, tessellation callbacks)
    • DirectWrite (including custom client callbacks)
    • D3DCompiler
    • DXGI
    • DXGI 1.1
    • DirectSound
    • XAudio2
    • XAPO
    • An integrated math API directly ported from SlimMath

  • Pure managed .NET API, platform independent : assemblies are compiled with AnyCpu target. You can run your code on a x64 or a x86 machine with the same assemblies, without recompiling your project.

  • Lightweight individual assemblies : a core assembly - SharpDX - containing common classes and an assembly for each subgroup API (Direct3D10, Direct3D11, DXGI, D3DCompiler...etc.). Assemblies are also lightweight.

  • C++/CLI Speed : the framework is using a genuine way to avoid any C++/CLI while still achieving comparable performance.

  • API naming convention mostly compatible with SlimDX API.

  • Raw DirectX object life management : No overhead of ObjectTable or RCW mechanism, the API is using direct native management with classic COM method "Release".

  • Easily mergeable / obfuscatable : If you need to obfuscate SharpDX assemblies, they are easily obfusctable due to the fact the framework is not using any mixed assemblies. You can also merge SharpDX assemblies into a single exe using with tool like ILMerge.

You will also find a growing collection of samples in the Samples Gallery of SharpDX. Most notably with some additional support for Direct2D1 and DirectWrite client callbacks.