[Directx10] staging texture2D Map() and RowPitch

Started by
2 comments, last by dz4 14 years, 2 months ago
Hi, I'm trying to update all sub resources of a staging texture 2D uncompressed R8G8B8A8. The first subresources works well, but for the miplevel of 8x8 texel, Map() is returning a pitch of 64 byte, but I'm expecting 32 (and the documentation confirms that for uncompressed data the RowPitch is the width). How do you explain this ? This prevent me to correctly set data for these mips. Please help.
Advertisement
I encountered the same problem and EvilSteve explained to me.
The driver is free to add data at the end of every scanline. You have to read/write the data you need (the first 32 byte in this case) and skip the rest of the scanline and so on. (the driver may put there something)
Quote:Original post by dz4
Hi,
I'm trying to update all sub resources of a staging texture 2D uncompressed R8G8B8A8.

The first subresources works well, but for the miplevel of 8x8 texel, Map() is returning a pitch of 64 byte, but I'm expecting 32
What feal87 said. The driver seems to be aligning scanlines to 64 bytes (Maybe the size of a GPU cache line?)
Quote:Original post by dz4
(and the documentation confirms that for uncompressed data the RowPitch is the width).
How do you explain this ?
What documentation says that? I don't know about D3D10, but in D3D9 there's no formal agreement on what the pitch will be, other than it'll be at least bytes_per_pixel * width.
thanks for your answers, that was what i thougtht.

in the documentation (official SDK chm) it's in the "Virtual Size versus Physical Size" topic (msdn link here : http://msdn.microsoft.com/en-us/library/ee415727%28VS.85%29.aspx

This topic is closed to new replies.

Advertisement