   [SlimDX] DirectX 11 Shader Resource Creation question
  Hi there,I think I might have run into a bug in the DirectX 11 version of the CreateShaderResourceView code of SlimDX...I am creating a buffer with compressed data and then create two ShaderResourceViews on top of it with different offsets and counts.  After creating the view, it shows the element count as 0 even though I passed the correct count into the function...When I access the view, the first few entries come out ok, after that I get 0s.I am using Windows 7, GTX 480, latest nVidia Driver and SlimDX built for 64bit off the latest SVN branch.Anyone got some insight on this?This is the code I'm using to create the view:public static ShaderResourceView CreateShaderResourceView(Device device, Direct3D11.Resource resource, uint offset, uint recordSize, uint nbrRecords){    ShaderResourceViewDescription description = new ShaderResourceViewDescription();    description.ElementOffset = (int)offset;    description.ElementWidth = (int)recordSize;    description.ElementCount = (int)nbrRecords;    description.Dimension = ShaderResourceViewDimension.Buffer;    description.FirstElement = 0;    description.Flags = ShaderResourceViewExtendedBufferFlags.None;    description.Format = Format.R32_UInt;    ShaderResourceView result = new ShaderResourceView(device, resource, description);    return result;}
  The description doesn't look at the ElementCount or Flags fields unless you're using a dimension of type BufferEx. When using a simple Buffer, ElementOffset and ElementWidth are the only valid fields.This is kind of confusing, but you can see why it is the way it is if you look at the documentation for D3D11_SHADER_RESOURCE_VIEW_DESC, which is made up of a bunch of different unions that are accessed based upon the dimension.   ;  I was just looking through the SlimDX source code and saw that only those two fields are being used... changed the code to us nbr elements for width and it looks like I'm getting the correct buffer views now...Thanks for the quick answer...Marcel   