This parameter is passed to MapSubresource() and used to set the length of the
DataStream returned. However knowing the proper value for this before the call
is impossible before the D3D MapSubresource() call.
In principle the pitch returned by MapSubresource() could be arbitary for
textures, hence the size of the data stream cannot be determined in advance(ie
there is no size in bytes member in the description).
I propose that the MapSubresource() call should compute the size of the
DataStream based upon the subresource dimensions and the pitch/slice pitch
provided by D3D for textures. Use the buffer SizeInBytes for buffers etc.
A workaround is to pass in int.MaxValue(zero does not work since the DataStream
throws an ArgumentOutOfRangeException). However this means that there is no
possibility for the DataStream to validate the range written to and it returns
a meaningless length.
Original issue reported on code.google.com by dbl...@fastmail.fm on 31 May 2011 at 12:49
Original issue reported on code.google.com by
dbl...@fastmail.fm
on 31 May 2011 at 12:49