我想沿着向量 vecShift 移动体积纹理的内容。我想到了这样的内核:
__global__ void
moveVolume(int* vecShift)
{
// Determine position of current voxel as ptDest
// Determine position of voxel we copy the content from as ptSrc
// Read value at ptSrc and store it to voxelColor
// __threadfence()
// Write voxelColor to voxel at position ptDest
}
threadfence 将确保所有体素都已读取其“伙伴”的内容,并且在每个体素完成读取操作之前不会写入 ptDest,是吗?
如果这是真的,为什么我(有时)会得到一种模糊的伪影?还是我对 threadfence 的功能有错误的看法?