summaryrefslogtreecommitdiff
path: root/geometry.py
diff options
context:
space:
mode:
Diffstat (limited to 'geometry.py')
-rw-r--r--geometry.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/geometry.py b/geometry.py
index 1709a87..5fdfa1f 100644
--- a/geometry.py
+++ b/geometry.py
@@ -4,6 +4,7 @@ import pycuda.driver as cuda
from pycuda import gpuarray
from itertools import *
from itertoolset import *
+from camera import timeit
# all material/surface properties are interpolated at these
# wavelengths when they are sent to the gpu
@@ -213,6 +214,7 @@ class Geometry(object):
return len(self.solids)-1
+ @timeit
def build(self, bits=8, shift=3):
offsets = [ (0,0) ]
for solid in self.solids:
@@ -352,18 +354,6 @@ class Geometry(object):
if unique_bit_shifted_zvalues.size == 1:
break
- def load_colors(self, module):
- self.colors = \
- np.concatenate([solid.color for solid in self.solids])[reorder]
-
- if not hasattr(self, 'colors_gpu'):
- raise Exception('cannot load colors before geometry is loaded.')
-
- self.colors_gpu.set(self.colors.astype(np.uint32))
-
- set_colors = module.get_function('set_colors')
- set_colors(self.colors_gpu, block=(1,1,1), grid=(1,1))
-
def load(self, module):
"""
Load the bounding volume hierarchy onto the GPU module,