Sign in to follow this  
dz4

[Directx10] staging texture2D Map() and RowPitch

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this