IDirect3DTexture9 *texture;
D3DXCreateTexture(d3dDevice, width, height, 1,
0, D3DFMT_R32F,
pool, &texture));
float Table[width * height];
for(unsigned int row = 0; row < height; row++)
{
for(unsigned int col = 0; col < width; col++)
{
Table[row * width + col] = (float)row / col;
}
}
D3DLOCKED_RECT lockedRect;
texture->LockRect(0, &lockedRect, NULL, 0);
for(int j = 0; j < height; j++)
{
MemCopy((byte*)(lockedRect.pBits) + j * lockedRect.Pitch, &Table[j * width], width * sizeof(float));
}
And then I look at the texels in PIX for Win, it appeard to be uv inverted.
D3DXCreateTexture(d3dDevice, width, height, 1,
0, D3DFMT_R32F,
pool, &texture));
float Table[width * height];
for(unsigned int row = 0; row < height; row++)
{
for(unsigned int col = 0; col < width; col++)
{
Table[row * width + col] = (float)row / col;
}
}
D3DLOCKED_RECT lockedRect;
texture->LockRect(0, &lockedRect, NULL, 0);
for(int j = 0; j < height; j++)
{
MemCopy((byte*)(lockedRect.pBits) + j * lockedRect.Pitch, &Table[j * width], width * sizeof(float));
}
And then I look at the texels in PIX for Win, it appeard to be uv inverted.