pandap / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

D3D10 Texture2D Map() and subresource access #784

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, I encountered an inconsistency with Texture2D's Map() method. The docs 
state the first parameter is the subresource index, but the source treats it as 
the mipslice. The method always uses it to calculate the sub resource index 
(and only for the first array slice), and to calculate the mipsize. 

I noticed this while setting data for each face in a cubemap representation. 
After the first face, an exception would be thrown in DataStream's constructor 
due to "numBytes" being out of range. I would assume this is an oversight, 
since it diverges from the native call, and I don't really see another way to 
access array slices from a mappable resource?

Looks like the same thing is going on inside Texture3D's Map() too.

Original issue reported on code.google.com by nicholas.woodfield on 14 Mar 2011 at 12:08

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I agree that this a problem. Trying to figure out how to fix it, I see the 
following issues:

1. We've already shipped the library and people may be relying on the semantics 
of the current Map() function. Just changing the behavior of the parameter 
won't break a compile, but will silently change how it runs.

2. We need to have a concrete size in order to calculate the size of the 
returned DataStream.

I think the best solution is to add an overload to Map() that takes an 
additional arraySlice parameter, and incorporate that into the existing 
structure.

Original comment by Mike.Popoloski on 9 Jun 2011 at 4:19

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2080.

Original comment by Mike.Popoloski on 9 Jun 2011 at 4:29