Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 25 Jul 2008
Offline Last Active Today, 06:36 AM

Posts I've Made

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.

In Topic: Render to a texture in D2D+DWrite+SharpDX

26 August 2014 - 04:21 PM

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.

In Topic: Problem With Creation of TypedBuffer

26 August 2014 - 04:16 PM


Excuse me , I thought u meant The message of the pop up window. In the output I got this :


This was explicitly explained in the link above, item 3) "And check the output log of Visual Studio in the Output Log tab"



D3D11 ERROR: ID3D11Device::CreateShaderResourceView: The Dimensions of the View are invalid due to at least one of the following conditions. Assuming this Format (0x2a, R32_UINT), ElementOffset (value = 0) must be between 0 and the maximum offset of the Buffer, 121599, inclusively. With the current ElementOffset, ElementWidth (value = 0) must be between 1 and 121600, inclusively, in order that the View fit on the Buffer. [ STATE_CREATION ERROR #128: CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS]


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.

In Topic: Problem With Creation of TypedBuffer

26 August 2014 - 07:12 AM

I have already done that . This is all that it gives me . 

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

In Topic: Problem With Creation of TypedBuffer

25 August 2014 - 07:54 PM

Help yourself tongue.png "How to debug a SharpDX Exception"