The data I wish to process is most
naturally stored as a 3D array of
floats:
float data[W][H][L];
The usual access pattern is as follows:
for r=0…H-1
for c=0…W-1
for d=0…L-1
process element data[r][c][d]
My first instinct when implementing this on the GPU
is to create L WxH texture maps holding scalar floats.
The access pattern above would then be
for r=0…H-1
for c=0…W-1
for d=0…L-1
process element data[r][c] from texture d
I am concerned this access pattern would not
be as efficient since elements data[r][c][d] and data[r][c][d+1]
would no longer stored next to each other in memory
(they are actually in separate texture maps).
Is this critical or does it not really matter?
–thanks, wayne