🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Writing data to a texture in R32_UINT format

Started by
2 comments, last by Aerodactyl55 1 year, 3 months ago

here is some code to write data…. this method works with float textures, but not UINT.. I must not be understanding fully how to the proper size of each row.. any ideas?

 uint32_t* sptr = reinterpret_cast<uint32_t*>(mappedResource.pData);

 for (int row = 0; row < 1024; row++)

 {
  uint32_t* rowStart = (uint32_t*)(sptr + (mappedResource.RowPitch * row));
  for (int col = 0; col < 1024; col++)
  {
   rowStart[col] = 1000;
  }
 }
Advertisement

See if this helps…

https://www.gamedev.net/forums/topic/606100-solved-dx11-updating-texture-data/4834406/?page=1

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

The problem I see in your code, is that the RowPitch from Map() is in bytes, and you are using it to update an uint32_t pointer.

I don't know why it is working for floats.

This topic is closed to new replies.

Advertisement