warp-lang 1.0.0b2__py3-none-win_amd64.whl → 1.0.0b6__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of warp-lang might be problematic. Click here for more details.
- docs/conf.py +17 -5
- examples/env/env_ant.py +1 -1
- examples/env/env_cartpole.py +1 -1
- examples/env/env_humanoid.py +1 -1
- examples/env/env_usd.py +4 -1
- examples/env/environment.py +8 -9
- examples/example_dem.py +34 -33
- examples/example_diffray.py +364 -337
- examples/example_fluid.py +32 -23
- examples/example_jacobian_ik.py +97 -93
- examples/example_marching_cubes.py +6 -16
- examples/example_mesh.py +6 -16
- examples/example_mesh_intersect.py +16 -14
- examples/example_nvdb.py +14 -16
- examples/example_raycast.py +14 -13
- examples/example_raymarch.py +16 -23
- examples/example_render_opengl.py +19 -10
- examples/example_sim_cartpole.py +82 -78
- examples/example_sim_cloth.py +45 -48
- examples/example_sim_fk_grad.py +51 -44
- examples/example_sim_fk_grad_torch.py +47 -40
- examples/example_sim_grad_bounce.py +108 -133
- examples/example_sim_grad_cloth.py +99 -113
- examples/example_sim_granular.py +5 -6
- examples/{example_sim_sdf_shape.py → example_sim_granular_collision_sdf.py} +37 -26
- examples/example_sim_neo_hookean.py +51 -55
- examples/example_sim_particle_chain.py +4 -4
- examples/example_sim_quadruped.py +126 -81
- examples/example_sim_rigid_chain.py +54 -61
- examples/example_sim_rigid_contact.py +66 -70
- examples/example_sim_rigid_fem.py +3 -3
- examples/example_sim_rigid_force.py +1 -1
- examples/example_sim_rigid_gyroscopic.py +3 -4
- examples/example_sim_rigid_kinematics.py +28 -39
- examples/example_sim_trajopt.py +112 -110
- examples/example_sph.py +9 -8
- examples/example_wave.py +7 -7
- examples/fem/bsr_utils.py +30 -17
- examples/fem/example_apic_fluid.py +85 -69
- examples/fem/example_convection_diffusion.py +97 -93
- examples/fem/example_convection_diffusion_dg.py +142 -149
- examples/fem/example_convection_diffusion_dg0.py +141 -136
- examples/fem/example_deformed_geometry.py +146 -0
- examples/fem/example_diffusion.py +115 -84
- examples/fem/example_diffusion_3d.py +116 -86
- examples/fem/example_diffusion_mgpu.py +102 -79
- examples/fem/example_mixed_elasticity.py +139 -100
- examples/fem/example_navier_stokes.py +175 -162
- examples/fem/example_stokes.py +143 -111
- examples/fem/example_stokes_transfer.py +186 -157
- examples/fem/mesh_utils.py +59 -97
- examples/fem/plot_utils.py +138 -17
- tools/ci/publishing/build_nodes_info.py +54 -0
- warp/__init__.py +4 -3
- warp/__init__.pyi +1 -0
- warp/bin/warp-clang.dll +0 -0
- warp/bin/warp.dll +0 -0
- warp/build.py +5 -3
- warp/build_dll.py +29 -9
- warp/builtins.py +836 -492
- warp/codegen.py +864 -553
- warp/config.py +3 -1
- warp/context.py +389 -172
- warp/fem/__init__.py +24 -6
- warp/fem/cache.py +318 -25
- warp/fem/dirichlet.py +7 -3
- warp/fem/domain.py +14 -0
- warp/fem/field/__init__.py +30 -38
- warp/fem/field/field.py +149 -0
- warp/fem/field/nodal_field.py +244 -138
- warp/fem/field/restriction.py +8 -6
- warp/fem/field/test.py +127 -59
- warp/fem/field/trial.py +117 -60
- warp/fem/geometry/__init__.py +5 -1
- warp/fem/geometry/deformed_geometry.py +271 -0
- warp/fem/geometry/element.py +24 -1
- warp/fem/geometry/geometry.py +86 -14
- warp/fem/geometry/grid_2d.py +112 -54
- warp/fem/geometry/grid_3d.py +134 -65
- warp/fem/geometry/hexmesh.py +953 -0
- warp/fem/geometry/partition.py +85 -33
- warp/fem/geometry/quadmesh_2d.py +532 -0
- warp/fem/geometry/tetmesh.py +451 -115
- warp/fem/geometry/trimesh_2d.py +197 -92
- warp/fem/integrate.py +534 -268
- warp/fem/operator.py +58 -31
- warp/fem/polynomial.py +11 -0
- warp/fem/quadrature/__init__.py +1 -1
- warp/fem/quadrature/pic_quadrature.py +150 -58
- warp/fem/quadrature/quadrature.py +209 -57
- warp/fem/space/__init__.py +230 -53
- warp/fem/space/basis_space.py +489 -0
- warp/fem/space/collocated_function_space.py +105 -0
- warp/fem/space/dof_mapper.py +49 -2
- warp/fem/space/function_space.py +90 -39
- warp/fem/space/grid_2d_function_space.py +149 -496
- warp/fem/space/grid_3d_function_space.py +173 -538
- warp/fem/space/hexmesh_function_space.py +352 -0
- warp/fem/space/partition.py +129 -76
- warp/fem/space/quadmesh_2d_function_space.py +369 -0
- warp/fem/space/restriction.py +46 -34
- warp/fem/space/shape/__init__.py +15 -0
- warp/fem/space/shape/cube_shape_function.py +738 -0
- warp/fem/space/shape/shape_function.py +103 -0
- warp/fem/space/shape/square_shape_function.py +611 -0
- warp/fem/space/shape/tet_shape_function.py +567 -0
- warp/fem/space/shape/triangle_shape_function.py +429 -0
- warp/fem/space/tetmesh_function_space.py +132 -1039
- warp/fem/space/topology.py +295 -0
- warp/fem/space/trimesh_2d_function_space.py +104 -742
- warp/fem/types.py +13 -11
- warp/fem/utils.py +335 -60
- warp/native/array.h +120 -34
- warp/native/builtin.h +101 -72
- warp/native/bvh.cpp +73 -325
- warp/native/bvh.cu +406 -23
- warp/native/bvh.h +22 -40
- warp/native/clang/clang.cpp +1 -0
- warp/native/crt.h +2 -0
- warp/native/cuda_util.cpp +8 -3
- warp/native/cuda_util.h +1 -0
- warp/native/exports.h +1522 -1243
- warp/native/intersect.h +19 -4
- warp/native/intersect_adj.h +8 -8
- warp/native/mat.h +76 -17
- warp/native/mesh.cpp +33 -108
- warp/native/mesh.cu +114 -18
- warp/native/mesh.h +395 -40
- warp/native/noise.h +272 -329
- warp/native/quat.h +51 -8
- warp/native/rand.h +44 -34
- warp/native/reduce.cpp +1 -1
- warp/native/sparse.cpp +4 -4
- warp/native/sparse.cu +163 -155
- warp/native/spatial.h +2 -2
- warp/native/temp_buffer.h +18 -14
- warp/native/vec.h +103 -21
- warp/native/warp.cpp +2 -1
- warp/native/warp.cu +28 -3
- warp/native/warp.h +4 -3
- warp/render/render_opengl.py +261 -109
- warp/sim/__init__.py +1 -2
- warp/sim/articulation.py +385 -185
- warp/sim/import_mjcf.py +59 -48
- warp/sim/import_urdf.py +15 -15
- warp/sim/import_usd.py +174 -102
- warp/sim/inertia.py +17 -18
- warp/sim/integrator_xpbd.py +4 -3
- warp/sim/model.py +330 -250
- warp/sim/render.py +1 -1
- warp/sparse.py +625 -152
- warp/stubs.py +341 -309
- warp/tape.py +9 -6
- warp/tests/__main__.py +3 -6
- warp/tests/assets/curlnoise_golden.npy +0 -0
- warp/tests/assets/pnoise_golden.npy +0 -0
- warp/tests/{test_class_kernel.py → aux_test_class_kernel.py} +9 -1
- warp/tests/aux_test_conditional_unequal_types_kernels.py +21 -0
- warp/tests/{test_dependent.py → aux_test_dependent.py} +2 -2
- warp/tests/{test_reference.py → aux_test_reference.py} +1 -1
- warp/tests/aux_test_unresolved_func.py +14 -0
- warp/tests/aux_test_unresolved_symbol.py +14 -0
- warp/tests/disabled_kinematics.py +239 -0
- warp/tests/run_coverage_serial.py +31 -0
- warp/tests/test_adam.py +103 -106
- warp/tests/test_arithmetic.py +94 -74
- warp/tests/test_array.py +82 -101
- warp/tests/test_array_reduce.py +57 -23
- warp/tests/test_atomic.py +64 -28
- warp/tests/test_bool.py +22 -12
- warp/tests/test_builtins_resolution.py +1292 -0
- warp/tests/test_bvh.py +18 -18
- warp/tests/test_closest_point_edge_edge.py +54 -57
- warp/tests/test_codegen.py +165 -134
- warp/tests/test_compile_consts.py +28 -20
- warp/tests/test_conditional.py +108 -24
- warp/tests/test_copy.py +10 -12
- warp/tests/test_ctypes.py +112 -88
- warp/tests/test_dense.py +21 -14
- warp/tests/test_devices.py +98 -0
- warp/tests/test_dlpack.py +75 -75
- warp/tests/test_examples.py +237 -0
- warp/tests/test_fabricarray.py +22 -24
- warp/tests/test_fast_math.py +15 -11
- warp/tests/test_fem.py +1034 -124
- warp/tests/test_fp16.py +23 -16
- warp/tests/test_func.py +187 -86
- warp/tests/test_generics.py +194 -49
- warp/tests/test_grad.py +123 -181
- warp/tests/test_grad_customs.py +176 -0
- warp/tests/test_hash_grid.py +35 -34
- warp/tests/test_import.py +10 -23
- warp/tests/test_indexedarray.py +24 -25
- warp/tests/test_intersect.py +18 -9
- warp/tests/test_large.py +141 -0
- warp/tests/test_launch.py +14 -41
- warp/tests/test_lerp.py +64 -65
- warp/tests/test_lvalue.py +493 -0
- warp/tests/test_marching_cubes.py +12 -13
- warp/tests/test_mat.py +517 -2898
- warp/tests/test_mat_lite.py +115 -0
- warp/tests/test_mat_scalar_ops.py +2889 -0
- warp/tests/test_math.py +103 -9
- warp/tests/test_matmul.py +304 -69
- warp/tests/test_matmul_lite.py +410 -0
- warp/tests/test_mesh.py +60 -22
- warp/tests/test_mesh_query_aabb.py +21 -25
- warp/tests/test_mesh_query_point.py +111 -22
- warp/tests/test_mesh_query_ray.py +12 -24
- warp/tests/test_mlp.py +30 -22
- warp/tests/test_model.py +92 -89
- warp/tests/test_modules_lite.py +39 -0
- warp/tests/test_multigpu.py +88 -114
- warp/tests/test_noise.py +12 -11
- warp/tests/test_operators.py +16 -20
- warp/tests/test_options.py +11 -11
- warp/tests/test_pinned.py +17 -18
- warp/tests/test_print.py +32 -11
- warp/tests/test_quat.py +275 -129
- warp/tests/test_rand.py +18 -16
- warp/tests/test_reload.py +38 -34
- warp/tests/test_rounding.py +50 -43
- warp/tests/test_runlength_encode.py +168 -20
- warp/tests/test_smoothstep.py +9 -11
- warp/tests/test_snippet.py +143 -0
- warp/tests/test_sparse.py +261 -63
- warp/tests/test_spatial.py +276 -243
- warp/tests/test_streams.py +110 -85
- warp/tests/test_struct.py +268 -63
- warp/tests/test_tape.py +39 -21
- warp/tests/test_torch.py +90 -86
- warp/tests/test_transient_module.py +10 -12
- warp/tests/test_types.py +363 -0
- warp/tests/test_utils.py +451 -0
- warp/tests/test_vec.py +354 -2050
- warp/tests/test_vec_lite.py +73 -0
- warp/tests/test_vec_scalar_ops.py +2099 -0
- warp/tests/test_volume.py +418 -376
- warp/tests/test_volume_write.py +124 -134
- warp/tests/unittest_serial.py +35 -0
- warp/tests/unittest_suites.py +291 -0
- warp/tests/unittest_utils.py +342 -0
- warp/tests/{test_misc.py → unused_test_misc.py} +13 -5
- warp/tests/{test_debug.py → walkthough_debug.py} +3 -17
- warp/thirdparty/appdirs.py +36 -45
- warp/thirdparty/unittest_parallel.py +589 -0
- warp/types.py +622 -211
- warp/utils.py +54 -393
- warp_lang-1.0.0b6.dist-info/METADATA +238 -0
- warp_lang-1.0.0b6.dist-info/RECORD +409 -0
- {warp_lang-1.0.0b2.dist-info → warp_lang-1.0.0b6.dist-info}/WHEEL +1 -1
- examples/example_cache_management.py +0 -40
- examples/example_multigpu.py +0 -54
- examples/example_struct.py +0 -65
- examples/fem/example_stokes_transfer_3d.py +0 -210
- warp/bin/warp-clang.so +0 -0
- warp/bin/warp.so +0 -0
- warp/fem/field/discrete_field.py +0 -80
- warp/fem/space/nodal_function_space.py +0 -233
- warp/tests/test_all.py +0 -223
- warp/tests/test_array_scan.py +0 -60
- warp/tests/test_base.py +0 -208
- warp/tests/test_unresolved_func.py +0 -7
- warp/tests/test_unresolved_symbol.py +0 -7
- warp_lang-1.0.0b2.dist-info/METADATA +0 -26
- warp_lang-1.0.0b2.dist-info/RECORD +0 -380
- /warp/tests/{test_compile_consts_dummy.py → aux_test_compile_consts_dummy.py} +0 -0
- /warp/tests/{test_reference_reference.py → aux_test_reference_reference.py} +0 -0
- /warp/tests/{test_square.py → aux_test_square.py} +0 -0
- {warp_lang-1.0.0b2.dist-info → warp_lang-1.0.0b6.dist-info}/LICENSE.md +0 -0
- {warp_lang-1.0.0b2.dist-info → warp_lang-1.0.0b6.dist-info}/top_level.txt +0 -0
warp/native/mesh.cu
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
namespace wp
|
|
16
16
|
{
|
|
17
17
|
|
|
18
|
-
__global__ void compute_triangle_bounds(int n, const vec3* points, const int* indices,
|
|
18
|
+
__global__ void compute_triangle_bounds(int n, const vec3* points, const int* indices, vec3* lowers, vec3* uppers)
|
|
19
19
|
{
|
|
20
20
|
const int tid = blockIdx.x*blockDim.x + threadIdx.x;
|
|
21
21
|
|
|
@@ -33,7 +33,8 @@ __global__ void compute_triangle_bounds(int n, const vec3* points, const int* in
|
|
|
33
33
|
vec3 lower = min(min(p, q), r);
|
|
34
34
|
vec3 upper = max(max(p, q), r);
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
lowers[tid] = lower;
|
|
37
|
+
uppers[tid] = upper;
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
|
|
@@ -158,40 +159,135 @@ void bvh_refit_with_solid_angle_device(BVH& bvh, Mesh& mesh)
|
|
|
158
159
|
// clear child counters
|
|
159
160
|
memset_device(WP_CURRENT_CONTEXT, bvh.node_counts, 0, sizeof(int)*bvh.max_nodes);
|
|
160
161
|
|
|
161
|
-
wp_launch_device(WP_CURRENT_CONTEXT, bvh_refit_with_solid_angle_kernel, bvh.
|
|
162
|
+
wp_launch_device(WP_CURRENT_CONTEXT, bvh_refit_with_solid_angle_kernel, bvh.num_items, (bvh.num_items, bvh.node_parents, bvh.node_counts, bvh.node_lowers, bvh.node_uppers, mesh.points, mesh.indices, mesh.solid_angle_props));
|
|
162
163
|
}
|
|
164
|
+
|
|
163
165
|
} // namespace wp
|
|
164
166
|
|
|
165
|
-
|
|
167
|
+
|
|
168
|
+
uint64_t mesh_create_device(void* context, wp::array_t<wp::vec3> points, wp::array_t<wp::vec3> velocities, wp::array_t<int> indices, int num_points, int num_tris, int support_winding_number)
|
|
169
|
+
{
|
|
170
|
+
ContextGuard guard(context);
|
|
171
|
+
|
|
172
|
+
wp::Mesh mesh(points, velocities, indices, num_points, num_tris);
|
|
173
|
+
|
|
174
|
+
mesh.context = context ? context : cuda_context_get_current();
|
|
175
|
+
|
|
176
|
+
{
|
|
177
|
+
// // todo: BVH creation only on CPU at the moment so temporarily bring all the data back to host
|
|
178
|
+
// vec3* points_host = (vec3*)alloc_host(sizeof(vec3)*num_points);
|
|
179
|
+
// int* indices_host = (int*)alloc_host(sizeof(int)*num_tris*3);
|
|
180
|
+
// bounds3* bounds_host = (bounds3*)alloc_host(sizeof(bounds3)*num_tris);
|
|
181
|
+
|
|
182
|
+
// memcpy_d2h(WP_CURRENT_CONTEXT, points_host, points, sizeof(vec3)*num_points);
|
|
183
|
+
// memcpy_d2h(WP_CURRENT_CONTEXT, indices_host, indices, sizeof(int)*num_tris*3);
|
|
184
|
+
// cuda_context_synchronize(WP_CURRENT_CONTEXT);
|
|
185
|
+
|
|
186
|
+
// float sum = 0.0;
|
|
187
|
+
// for (int i=0; i < num_tris; ++i)
|
|
188
|
+
// {
|
|
189
|
+
// bounds_host[i] = bounds3();
|
|
190
|
+
// wp::vec3 p0 = points_host[indices_host[i*3+0]];
|
|
191
|
+
// wp::vec3 p1 = points_host[indices_host[i*3+1]];
|
|
192
|
+
// wp::vec3 p2 = points_host[indices_host[i*3+2]];
|
|
193
|
+
// bounds_host[i].add_point(p0);
|
|
194
|
+
// bounds_host[i].add_point(p1);
|
|
195
|
+
// bounds_host[i].add_point(p2);
|
|
196
|
+
// sum += length(p0-p1) + length(p0-p2) + length(p2-p1);
|
|
197
|
+
// }
|
|
198
|
+
// mesh.average_edge_length = sum / (num_tris*3);
|
|
199
|
+
|
|
200
|
+
// BVH bvh_host = bvh_create(bounds_host, num_tris);
|
|
201
|
+
// BVH bvh_device = bvh_clone(WP_CURRENT_CONTEXT, bvh_host);
|
|
202
|
+
|
|
203
|
+
// bvh_destroy_host(bvh_host);
|
|
204
|
+
|
|
205
|
+
// create lower upper arrays expected by GPU BVH builder
|
|
206
|
+
mesh.lowers = (wp::vec3*)alloc_temp_device(WP_CURRENT_CONTEXT, sizeof(wp::vec3)*num_tris);
|
|
207
|
+
mesh.uppers = (wp::vec3*)alloc_temp_device(WP_CURRENT_CONTEXT, sizeof(wp::vec3)*num_tris);
|
|
208
|
+
|
|
209
|
+
wp_launch_device(WP_CURRENT_CONTEXT, wp::compute_triangle_bounds, num_tris, (num_tris, points.data, indices.data, mesh.lowers, mesh.uppers));
|
|
210
|
+
|
|
211
|
+
uint64_t bvh_id = bvh_create_device(mesh.context, mesh.lowers, mesh.uppers, num_tris);
|
|
212
|
+
wp::bvh_get_descriptor(bvh_id, mesh.bvh);
|
|
213
|
+
|
|
214
|
+
if (support_winding_number)
|
|
215
|
+
{
|
|
216
|
+
int num_bvh_nodes = 2*num_tris;
|
|
217
|
+
mesh.solid_angle_props = (wp::SolidAngleProps*)alloc_device(WP_CURRENT_CONTEXT, sizeof(wp::SolidAngleProps)*num_bvh_nodes);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
wp::Mesh* mesh_device = (wp::Mesh*)alloc_device(WP_CURRENT_CONTEXT, sizeof(wp::Mesh));
|
|
222
|
+
memcpy_h2d(WP_CURRENT_CONTEXT, mesh_device, &mesh, sizeof(wp::Mesh));
|
|
223
|
+
|
|
224
|
+
// save descriptor
|
|
225
|
+
uint64_t mesh_id = (uint64_t)mesh_device;
|
|
226
|
+
mesh_add_descriptor(mesh_id, mesh);
|
|
227
|
+
|
|
228
|
+
if (support_winding_number)
|
|
229
|
+
mesh_refit_device(mesh_id);
|
|
230
|
+
|
|
231
|
+
return mesh_id;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
void mesh_destroy_device(uint64_t id)
|
|
235
|
+
{
|
|
236
|
+
wp::Mesh mesh;
|
|
237
|
+
if (wp::mesh_get_descriptor(id, mesh))
|
|
238
|
+
{
|
|
239
|
+
ContextGuard guard(mesh.context);
|
|
240
|
+
|
|
241
|
+
wp::bvh_destroy_device(mesh.bvh);
|
|
242
|
+
|
|
243
|
+
free_device(WP_CURRENT_CONTEXT, mesh.lowers);
|
|
244
|
+
free_device(WP_CURRENT_CONTEXT, mesh.uppers);
|
|
245
|
+
free_device(WP_CURRENT_CONTEXT, (wp::Mesh*)id);
|
|
246
|
+
|
|
247
|
+
if (mesh.solid_angle_props) {
|
|
248
|
+
free_device(WP_CURRENT_CONTEXT, mesh.solid_angle_props);
|
|
249
|
+
}
|
|
250
|
+
wp::mesh_rem_descriptor(id);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
void mesh_update_stats(uint64_t id)
|
|
166
255
|
{
|
|
256
|
+
|
|
257
|
+
}
|
|
167
258
|
|
|
259
|
+
void mesh_refit_device(uint64_t id)
|
|
260
|
+
{
|
|
168
261
|
// recompute triangle bounds
|
|
169
262
|
wp::Mesh m;
|
|
170
263
|
if (mesh_get_descriptor(id, m))
|
|
171
264
|
{
|
|
172
265
|
ContextGuard guard(m.context);
|
|
173
266
|
|
|
174
|
-
|
|
175
|
-
// for use in mesh_query_point_sign_normal()
|
|
176
|
-
// since it relies on an epsilon for welding
|
|
177
|
-
|
|
178
|
-
// re-use bounds memory temporarily for computing edge lengths
|
|
179
|
-
float* length_tmp_ptr = (float*)m.bounds;
|
|
180
|
-
wp_launch_device(WP_CURRENT_CONTEXT, wp::compute_mesh_edge_lengths, m.num_tris, (m.num_tris, m.points, m.indices, length_tmp_ptr));
|
|
181
|
-
|
|
182
|
-
scan_device(length_tmp_ptr, length_tmp_ptr, m.num_tris, true);
|
|
183
|
-
|
|
184
|
-
wp_launch_device(WP_CURRENT_CONTEXT, wp::compute_average_mesh_edge_length, 1, (m.num_tris, length_tmp_ptr, (wp::Mesh*)id));
|
|
185
|
-
wp_launch_device(WP_CURRENT_CONTEXT, wp::compute_triangle_bounds, m.num_tris, (m.num_tris, m.points, m.indices, m.bounds));
|
|
267
|
+
wp_launch_device(WP_CURRENT_CONTEXT, wp::compute_triangle_bounds, m.num_tris, (m.num_tris, m.points, m.indices, m.lowers, m.uppers));
|
|
186
268
|
|
|
187
269
|
if (m.solid_angle_props)
|
|
188
270
|
{
|
|
271
|
+
// we compute mesh the average edge length
|
|
272
|
+
// for use in mesh_query_point_sign_normal()
|
|
273
|
+
// since it relies on an epsilon for welding
|
|
274
|
+
|
|
275
|
+
// re-use bounds memory temporarily for computing edge lengths
|
|
276
|
+
float* length_tmp_ptr = (float*)m.lowers;
|
|
277
|
+
wp_launch_device(WP_CURRENT_CONTEXT, wp::compute_mesh_edge_lengths, m.num_tris, (m.num_tris, m.points, m.indices, length_tmp_ptr));
|
|
278
|
+
|
|
279
|
+
scan_device(length_tmp_ptr, length_tmp_ptr, m.num_tris, true);
|
|
280
|
+
|
|
281
|
+
wp_launch_device(WP_CURRENT_CONTEXT, wp::compute_average_mesh_edge_length, 1, (m.num_tris, length_tmp_ptr, (wp::Mesh*)id));
|
|
282
|
+
wp_launch_device(WP_CURRENT_CONTEXT, wp::compute_triangle_bounds, m.num_tris, (m.num_tris, m.points, m.indices, m.lowers, m.uppers));
|
|
283
|
+
|
|
284
|
+
// update solid angle data
|
|
189
285
|
bvh_refit_with_solid_angle_device(m.bvh, m);
|
|
190
286
|
}
|
|
191
287
|
else
|
|
192
288
|
{
|
|
193
|
-
bvh_refit_device(m.bvh
|
|
289
|
+
bvh_refit_device(m.bvh);
|
|
194
290
|
}
|
|
195
291
|
}
|
|
196
|
-
|
|
197
292
|
}
|
|
293
|
+
|