Advertisement

Writing data to a texture in R32_UINT format

Started by March 18, 2023 07:57 PM
2 comments, last by Aerodactyl55 1 year, 9 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;
  }
 }

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.

Advertisement

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