Has anyone tried to use pitch memory with a 2D texture?
I have used it successfully for any case in which the size of the 2D array is a square, however, when the pitch alignment is not the same as the array width I get incorrect results.
If anyone needs some code I have a simple example.
My second question would be, is it flat out wrong to use mallocPitch memory to bind a 2D texture to?
The common is that the array width and the pitch are distinct.
The reason of this, is that the pitch are ‘padding bytes’ that go after the row of your matrix and make that the row lies in a(or more) segment of 128 bytes .
This performance (i believe) try to achieve the ‘spacial locality’ of the textures.
The common is that the array width and the pitch are distinct.
The reason of this, is that the pitch are ‘padding bytes’ that go after the row of your matrix and make that the row lies in a(or more) segment of 128 bytes .
This performance (i believe) try to achieve the ‘spacial locality’ of the textures.