the texture is still only xsize*ysize (ie 128 x 455)
newtdesc.Width = xsize; newtdesc.Height = ysize; ... pTexture = new SlimDX.Direct3D10.Texture2D(g_pd3dDevice, newtdesc);
i map the texture and fill with new data like normal but if i am using the actual size of the texture on the new data it will wrap when it is not a 32 multiple
DataRectangle mappedTex = null; mappedTex = pTexture.Map(0, D3D10.MapMode.WriteDiscard, D3D10.MapFlags.None); mappedTex.Data.WriteRange<byte>(NewData); pTexture.Unmap(0);
so i have to pad the new data with zeros to get the multiple of 32 for the total new data size even though the texture is smaller
int texsizefix = ysize + (32 - (ysize % 32)); Byte NewData = new Byte[(int)((texsizefix * xsize) * 4)]; // * 4 due to r8g8b8a8(ie 128x480 zero padded on each line)
so now this all works fine on several cards, im running a gtx 460m, a gtx 560m, and an amd 6750m but now i picked up a bottom end amd apu with a 6520g integrated gpu and it will not work, it gives me an 'attempted to read past the end of stream' error from this size difference between the texture and the NewData on the map instruction. i tried upgrading drivers and slimdx/directx versions etc but nothing seems to change it. i know i am being a little lazy about it in that i could force all the textures to be some multiple of 32 and handle some stretching in the shaders/vertex mapping but it will set me back significantly if i have to recalculate everything involved with that. am i missing something obvious that fixes the wrapping bug in slimdx/directx or is this just an issue with the new chips not having mature enough drivers to handle this.
Edited by ucfchuck, 19 September 2012 - 03:16 PM.