Jump to content
  • Advertisement
Sign in to follow this  
dz4

[Directx10] staging texture2D Map() and RowPitch

This topic is 3165 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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)

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!