diff options
Diffstat (limited to 'src/mesh.h')
-rw-r--r-- | src/mesh.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -122,11 +122,20 @@ __global__ void distance_to_mesh(int nthreads, float3 *_origin, float3 *_direction, Geometry *g, float *_distance) { + __shared__ Geometry sg; + + if (threadIdx.x == 0) + sg = *g; + + __syncthreads(); + int id = blockIdx.x*blockDim.x + threadIdx.x; if (id >= nthreads) return; + g = &sg; + float3 origin = _origin[id]; float3 direction = _direction[id]; direction /= norm(direction); |