dragonyzl
28-Mar-2007, 11:28
Hi,
This is my first post to the Forum.
I have generate two arrays in fragment shader, named amp and DistanceIndex. Now I want to implement the following function(described in C)
for(int i=0;i<Width*Height;i++)
mySignal[ DistanceIndex[i] ] += amp[i];
After reading some documents on web. It is said that the scatter and gather techniques should be implemented here. The solutions for scatter includes: 1. read back to the CPU, 2. Using Vertex texture. But I think these methods are not suitable for me because of the efficiency (after read back to the main memory, the above loops takes about 8 minutes for Width=Height=1024, I did not test the method that using vertex texture, some one did it?:?: ) From the documentation of Nvidia G80 GPU and Shader model 4.0, it seems that the function above can be implemented, but I don't know how. So I am asking for help from the forum and hope some experts can help me or give some information.
Thanks!
This is my first post to the Forum.
I have generate two arrays in fragment shader, named amp and DistanceIndex. Now I want to implement the following function(described in C)
for(int i=0;i<Width*Height;i++)
mySignal[ DistanceIndex[i] ] += amp[i];
After reading some documents on web. It is said that the scatter and gather techniques should be implemented here. The solutions for scatter includes: 1. read back to the CPU, 2. Using Vertex texture. But I think these methods are not suitable for me because of the efficiency (after read back to the main memory, the above loops takes about 8 minutes for Width=Height=1024, I did not test the method that using vertex texture, some one did it?:?: ) From the documentation of Nvidia G80 GPU and Shader model 4.0, it seems that the function above can be implemented, but I don't know how. So I am asking for help from the forum and hope some experts can help me or give some information.
Thanks!