warp-lang 1.6.0__py3-none-win_amd64.whl → 1.6.2__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.
- warp/__init__.py +14 -6
- warp/autograd.py +14 -6
- warp/bin/warp-clang.dll +0 -0
- warp/bin/warp.dll +0 -0
- warp/build.py +14 -6
- warp/build_dll.py +14 -6
- warp/builtins.py +16 -7
- warp/codegen.py +24 -9
- warp/config.py +79 -27
- warp/constants.py +14 -6
- warp/context.py +236 -71
- warp/dlpack.py +14 -6
- warp/examples/__init__.py +14 -6
- warp/examples/benchmarks/benchmark_api.py +14 -6
- warp/examples/benchmarks/benchmark_cloth.py +14 -6
- warp/examples/benchmarks/benchmark_cloth_cupy.py +14 -6
- warp/examples/benchmarks/benchmark_cloth_jax.py +14 -6
- warp/examples/benchmarks/benchmark_cloth_numba.py +15 -0
- warp/examples/benchmarks/benchmark_cloth_numpy.py +14 -6
- warp/examples/benchmarks/benchmark_cloth_paddle.py +14 -6
- warp/examples/benchmarks/benchmark_cloth_pytorch.py +14 -6
- warp/examples/benchmarks/benchmark_cloth_taichi.py +14 -6
- warp/examples/benchmarks/benchmark_cloth_warp.py +14 -6
- warp/examples/benchmarks/benchmark_gemm.py +82 -48
- warp/examples/benchmarks/benchmark_interop_paddle.py +14 -6
- warp/examples/benchmarks/benchmark_interop_torch.py +14 -6
- warp/examples/benchmarks/benchmark_launches.py +14 -6
- warp/examples/browse.py +14 -6
- warp/examples/core/example_cupy.py +14 -6
- warp/examples/core/example_dem.py +14 -6
- warp/examples/core/example_fluid.py +14 -6
- warp/examples/core/example_graph_capture.py +14 -6
- warp/examples/core/example_marching_cubes.py +15 -7
- warp/examples/core/example_mesh.py +15 -7
- warp/examples/core/example_mesh_intersect.py +14 -6
- warp/examples/core/example_nvdb.py +14 -6
- warp/examples/core/example_raycast.py +14 -6
- warp/examples/core/example_raymarch.py +14 -6
- warp/examples/core/example_render_opengl.py +14 -6
- warp/examples/core/example_sph.py +14 -6
- warp/examples/core/example_torch.py +14 -6
- warp/examples/core/example_wave.py +15 -7
- warp/examples/fem/example_adaptive_grid.py +14 -6
- warp/examples/fem/example_apic_fluid.py +14 -6
- warp/examples/fem/example_burgers.py +14 -6
- warp/examples/fem/example_convection_diffusion.py +14 -6
- warp/examples/fem/example_convection_diffusion_dg.py +14 -6
- warp/examples/fem/example_deformed_geometry.py +14 -6
- warp/examples/fem/example_diffusion.py +14 -6
- warp/examples/fem/example_diffusion_3d.py +14 -6
- warp/examples/fem/example_diffusion_mgpu.py +14 -6
- warp/examples/fem/example_distortion_energy.py +14 -6
- warp/examples/fem/example_magnetostatics.py +14 -6
- warp/examples/fem/example_mixed_elasticity.py +14 -6
- warp/examples/fem/example_navier_stokes.py +14 -6
- warp/examples/fem/example_nonconforming_contact.py +14 -6
- warp/examples/fem/example_stokes.py +14 -6
- warp/examples/fem/example_stokes_transfer.py +14 -6
- warp/examples/fem/example_streamlines.py +14 -6
- warp/examples/fem/utils.py +15 -0
- warp/examples/optim/example_bounce.py +14 -6
- warp/examples/optim/example_cloth_throw.py +14 -6
- warp/examples/optim/example_diffray.py +14 -6
- warp/examples/optim/example_drone.py +14 -6
- warp/examples/optim/example_inverse_kinematics.py +14 -6
- warp/examples/optim/example_inverse_kinematics_torch.py +14 -6
- warp/examples/optim/example_softbody_properties.py +14 -6
- warp/examples/optim/example_spring_cage.py +14 -6
- warp/examples/optim/example_trajectory.py +14 -6
- warp/examples/optim/example_walker.py +14 -6
- warp/examples/sim/example_cartpole.py +14 -6
- warp/examples/sim/example_cloth.py +14 -6
- warp/examples/sim/example_cloth_self_contact.py +95 -33
- warp/examples/sim/example_granular.py +14 -6
- warp/examples/sim/example_granular_collision_sdf.py +14 -6
- warp/examples/sim/example_jacobian_ik.py +14 -6
- warp/examples/sim/example_particle_chain.py +14 -6
- warp/examples/sim/example_quadruped.py +14 -6
- warp/examples/sim/example_rigid_chain.py +14 -6
- warp/examples/sim/example_rigid_contact.py +14 -6
- warp/examples/sim/example_rigid_force.py +14 -6
- warp/examples/sim/example_rigid_gyroscopic.py +14 -6
- warp/examples/sim/example_rigid_soft_contact.py +14 -6
- warp/examples/sim/example_soft_body.py +14 -6
- warp/examples/tile/example_tile_cholesky.py +14 -6
- warp/examples/tile/example_tile_convolution.py +14 -6
- warp/examples/tile/example_tile_fft.py +14 -6
- warp/examples/tile/example_tile_filtering.py +14 -6
- warp/examples/tile/example_tile_matmul.py +14 -6
- warp/examples/tile/example_tile_mlp.py +14 -6
- warp/examples/tile/example_tile_nbody.py +40 -21
- warp/examples/tile/example_tile_walker.py +14 -6
- warp/fabric.py +15 -0
- warp/fem/__init__.py +15 -0
- warp/fem/adaptivity.py +15 -0
- warp/fem/cache.py +15 -0
- warp/fem/dirichlet.py +15 -0
- warp/fem/domain.py +15 -0
- warp/fem/field/__init__.py +15 -0
- warp/fem/field/field.py +15 -0
- warp/fem/field/nodal_field.py +15 -0
- warp/fem/field/restriction.py +15 -0
- warp/fem/field/virtual.py +15 -0
- warp/fem/geometry/__init__.py +15 -0
- warp/fem/geometry/adaptive_nanogrid.py +15 -0
- warp/fem/geometry/closest_point.py +15 -0
- warp/fem/geometry/deformed_geometry.py +15 -0
- warp/fem/geometry/element.py +15 -0
- warp/fem/geometry/geometry.py +15 -0
- warp/fem/geometry/grid_2d.py +15 -0
- warp/fem/geometry/grid_3d.py +15 -0
- warp/fem/geometry/hexmesh.py +15 -0
- warp/fem/geometry/nanogrid.py +15 -0
- warp/fem/geometry/partition.py +15 -0
- warp/fem/geometry/quadmesh.py +15 -0
- warp/fem/geometry/tetmesh.py +15 -0
- warp/fem/geometry/trimesh.py +15 -0
- warp/fem/integrate.py +15 -0
- warp/fem/linalg.py +15 -0
- warp/fem/operator.py +15 -0
- warp/fem/polynomial.py +15 -0
- warp/fem/quadrature/__init__.py +15 -0
- warp/fem/quadrature/pic_quadrature.py +15 -0
- warp/fem/quadrature/quadrature.py +15 -0
- warp/fem/space/__init__.py +15 -0
- warp/fem/space/basis_function_space.py +15 -0
- warp/fem/space/basis_space.py +15 -0
- warp/fem/space/dof_mapper.py +15 -0
- warp/fem/space/function_space.py +15 -0
- warp/fem/space/grid_2d_function_space.py +15 -0
- warp/fem/space/grid_3d_function_space.py +15 -0
- warp/fem/space/hexmesh_function_space.py +15 -0
- warp/fem/space/nanogrid_function_space.py +15 -0
- warp/fem/space/partition.py +15 -0
- warp/fem/space/quadmesh_function_space.py +15 -0
- warp/fem/space/restriction.py +15 -0
- warp/fem/space/shape/__init__.py +15 -0
- warp/fem/space/shape/cube_shape_function.py +15 -0
- warp/fem/space/shape/shape_function.py +15 -0
- warp/fem/space/shape/square_shape_function.py +15 -0
- warp/fem/space/shape/tet_shape_function.py +15 -0
- warp/fem/space/shape/triangle_shape_function.py +15 -0
- warp/fem/space/tetmesh_function_space.py +15 -0
- warp/fem/space/topology.py +15 -0
- warp/fem/space/trimesh_function_space.py +15 -0
- warp/fem/types.py +15 -0
- warp/fem/utils.py +15 -0
- warp/jax.py +14 -6
- warp/jax_experimental.py +14 -6
- warp/math.py +14 -6
- warp/native/array.h +15 -6
- warp/native/builtin.h +15 -6
- warp/native/bvh.cpp +15 -6
- warp/native/bvh.cu +15 -6
- warp/native/bvh.h +15 -6
- warp/native/clang/clang.cpp +16 -7
- warp/native/coloring.cpp +15 -6
- warp/native/crt.cpp +15 -6
- warp/native/crt.h +16 -6
- warp/native/cuda_crt.h +15 -6
- warp/native/cuda_util.cpp +15 -6
- warp/native/cuda_util.h +15 -6
- warp/native/cutlass_gemm.cpp +15 -6
- warp/native/cutlass_gemm.cu +16 -7
- warp/native/error.cpp +15 -6
- warp/native/error.h +15 -6
- warp/native/exports.h +17 -0
- warp/native/fabric.h +15 -6
- warp/native/hashgrid.cpp +15 -6
- warp/native/hashgrid.cu +15 -6
- warp/native/hashgrid.h +15 -6
- warp/native/initializer_array.h +15 -6
- warp/native/intersect.h +15 -6
- warp/native/intersect_adj.h +15 -6
- warp/native/intersect_tri.h +17 -0
- warp/native/marching.cpp +16 -0
- warp/native/marching.cu +15 -6
- warp/native/marching.h +17 -0
- warp/native/mat.h +31 -9
- warp/native/mathdx.cpp +15 -6
- warp/native/matnn.h +15 -6
- warp/native/mesh.cpp +15 -6
- warp/native/mesh.cu +15 -6
- warp/native/mesh.h +15 -6
- warp/native/noise.h +15 -6
- warp/native/quat.h +15 -6
- warp/native/rand.h +15 -6
- warp/native/range.h +15 -6
- warp/native/reduce.cpp +15 -6
- warp/native/reduce.cu +15 -6
- warp/native/runlength_encode.cpp +15 -6
- warp/native/runlength_encode.cu +15 -6
- warp/native/scan.cpp +15 -6
- warp/native/scan.cu +15 -6
- warp/native/scan.h +15 -6
- warp/native/solid_angle.h +17 -0
- warp/native/sort.cpp +15 -6
- warp/native/sort.cu +15 -6
- warp/native/sort.h +15 -6
- warp/native/sparse.cpp +15 -6
- warp/native/sparse.cu +15 -6
- warp/native/spatial.h +15 -6
- warp/native/svd.h +15 -6
- warp/native/temp_buffer.h +15 -6
- warp/native/tile.h +27 -14
- warp/native/tile_reduce.h +15 -6
- warp/native/vec.h +15 -6
- warp/native/volume.cpp +15 -6
- warp/native/volume.cu +15 -6
- warp/native/volume.h +15 -6
- warp/native/volume_builder.cu +15 -6
- warp/native/volume_builder.h +15 -6
- warp/native/volume_impl.h +15 -6
- warp/native/warp.cpp +15 -6
- warp/native/warp.cu +15 -6
- warp/native/warp.h +15 -6
- warp/optim/__init__.py +14 -6
- warp/optim/adam.py +14 -6
- warp/optim/linear.py +15 -0
- warp/optim/sgd.py +14 -6
- warp/paddle.py +14 -6
- warp/render/__init__.py +14 -6
- warp/render/render_opengl.py +37 -21
- warp/render/render_usd.py +24 -8
- warp/render/utils.py +14 -6
- warp/sim/__init__.py +14 -7
- warp/sim/articulation.py +14 -6
- warp/sim/collide.py +43 -22
- warp/sim/graph_coloring.py +14 -6
- warp/sim/import_mjcf.py +14 -7
- warp/sim/import_snu.py +14 -7
- warp/sim/import_urdf.py +34 -11
- warp/sim/import_usd.py +14 -7
- warp/sim/inertia.py +14 -6
- warp/sim/integrator.py +14 -6
- warp/sim/integrator_euler.py +14 -6
- warp/sim/integrator_featherstone.py +18 -17
- warp/sim/integrator_vbd.py +15 -6
- warp/sim/integrator_xpbd.py +14 -6
- warp/sim/model.py +76 -65
- warp/sim/particles.py +14 -6
- warp/sim/render.py +16 -8
- warp/sim/utils.py +15 -0
- warp/sparse.py +15 -0
- warp/stubs.py +16 -1
- warp/tape.py +14 -6
- warp/tests/__main__.py +15 -0
- warp/tests/aux_test_class_kernel.py +14 -6
- warp/tests/aux_test_compile_consts_dummy.py +14 -6
- warp/tests/aux_test_conditional_unequal_types_kernels.py +14 -6
- warp/tests/aux_test_dependent.py +14 -6
- warp/tests/aux_test_grad_customs.py +14 -6
- warp/tests/aux_test_instancing_gc.py +14 -6
- warp/tests/aux_test_module_unload.py +14 -6
- warp/tests/aux_test_name_clash1.py +14 -6
- warp/tests/aux_test_name_clash2.py +14 -6
- warp/tests/aux_test_unresolved_func.py +14 -6
- warp/tests/aux_test_unresolved_symbol.py +14 -6
- warp/tests/disabled_kinematics.py +14 -6
- warp/tests/flaky_test_sim_grad.py +14 -6
- warp/tests/run_coverage_serial.py +14 -6
- warp/tests/test_adam.py +14 -6
- warp/tests/test_arithmetic.py +14 -6
- warp/tests/test_array.py +40 -6
- warp/tests/test_array_reduce.py +14 -6
- warp/tests/test_assert.py +14 -6
- warp/tests/test_async.py +14 -6
- warp/tests/test_atomic.py +14 -6
- warp/tests/test_bool.py +14 -6
- warp/tests/test_builtins_resolution.py +14 -6
- warp/tests/test_bvh.py +14 -6
- warp/tests/test_closest_point_edge_edge.py +14 -6
- warp/tests/test_codegen.py +14 -6
- warp/tests/test_codegen_instancing.py +14 -6
- warp/tests/test_collision.py +20 -12
- warp/tests/test_coloring.py +14 -7
- warp/tests/test_compile_consts.py +14 -6
- warp/tests/test_conditional.py +14 -6
- warp/tests/test_context.py +14 -6
- warp/tests/test_copy.py +14 -6
- warp/tests/test_ctypes.py +14 -6
- warp/tests/test_dense.py +14 -6
- warp/tests/test_devices.py +14 -6
- warp/tests/test_dlpack.py +14 -6
- warp/tests/test_examples.py +21 -7
- warp/tests/test_fabricarray.py +14 -6
- warp/tests/test_fast_math.py +14 -6
- warp/tests/test_fem.py +14 -6
- warp/tests/test_fp16.py +14 -6
- warp/tests/test_func.py +14 -6
- warp/tests/test_future_annotations.py +14 -6
- warp/tests/test_generics.py +14 -6
- warp/tests/test_grad.py +14 -6
- warp/tests/test_grad_customs.py +14 -6
- warp/tests/test_grad_debug.py +14 -6
- warp/tests/test_hash_grid.py +14 -6
- warp/tests/test_implicit_init.py +14 -6
- warp/tests/test_import.py +14 -6
- warp/tests/test_indexedarray.py +14 -6
- warp/tests/test_intersect.py +14 -6
- warp/tests/test_ipc.py +14 -6
- warp/tests/test_iter.py +14 -6
- warp/tests/test_jax.py +14 -6
- warp/tests/test_large.py +14 -6
- warp/tests/test_launch.py +91 -32
- warp/tests/test_lerp.py +14 -6
- warp/tests/test_linear_solvers.py +15 -0
- warp/tests/test_lvalue.py +14 -6
- warp/tests/test_marching_cubes.py +14 -6
- warp/tests/test_mat.py +89 -7
- warp/tests/test_mat_lite.py +14 -6
- warp/tests/test_mat_scalar_ops.py +14 -6
- warp/tests/test_math.py +14 -6
- warp/tests/test_matmul.py +14 -6
- warp/tests/test_matmul_lite.py +14 -6
- warp/tests/test_mempool.py +14 -6
- warp/tests/test_mesh.py +14 -6
- warp/tests/test_mesh_query_aabb.py +14 -6
- warp/tests/test_mesh_query_point.py +14 -6
- warp/tests/test_mesh_query_ray.py +14 -6
- warp/tests/test_mlp.py +14 -6
- warp/tests/test_model.py +14 -6
- warp/tests/test_module_hashing.py +14 -6
- warp/tests/test_modules_lite.py +14 -6
- warp/tests/test_multigpu.py +14 -6
- warp/tests/test_noise.py +14 -6
- warp/tests/test_operators.py +14 -6
- warp/tests/test_options.py +14 -6
- warp/tests/test_overwrite.py +19 -3
- warp/tests/test_paddle.py +14 -6
- warp/tests/test_peer.py +14 -6
- warp/tests/test_pinned.py +14 -6
- warp/tests/test_print.py +14 -6
- warp/tests/test_quat.py +14 -6
- warp/tests/test_rand.py +14 -6
- warp/tests/test_reload.py +14 -6
- warp/tests/test_rounding.py +14 -6
- warp/tests/test_runlength_encode.py +14 -6
- warp/tests/test_scalar_ops.py +14 -6
- warp/tests/test_sim_grad_bounce_linear.py +14 -6
- warp/tests/test_sim_kinematics.py +14 -6
- warp/tests/test_smoothstep.py +14 -6
- warp/tests/test_snippet.py +15 -0
- warp/tests/test_sparse.py +14 -6
- warp/tests/test_spatial.py +14 -6
- warp/tests/test_special_values.py +14 -6
- warp/tests/test_static.py +14 -6
- warp/tests/test_streams.py +14 -6
- warp/tests/test_struct.py +14 -6
- warp/tests/test_tape.py +14 -6
- warp/tests/test_tile.py +14 -6
- warp/tests/test_tile_load.py +58 -7
- warp/tests/test_tile_mathdx.py +14 -6
- warp/tests/test_tile_mlp.py +14 -6
- warp/tests/test_tile_reduce.py +14 -6
- warp/tests/test_tile_shared_memory.py +14 -6
- warp/tests/test_tile_view.py +14 -6
- warp/tests/test_torch.py +14 -6
- warp/tests/test_transient_module.py +14 -6
- warp/tests/test_triangle_closest_point.py +14 -6
- warp/tests/test_types.py +14 -6
- warp/tests/test_utils.py +14 -6
- warp/tests/test_vbd.py +14 -6
- warp/tests/test_vec.py +14 -6
- warp/tests/test_vec_lite.py +14 -6
- warp/tests/test_vec_scalar_ops.py +14 -6
- warp/tests/test_verify_fp.py +14 -6
- warp/tests/test_volume.py +14 -6
- warp/tests/test_volume_write.py +14 -6
- warp/tests/unittest_serial.py +14 -6
- warp/tests/unittest_suites.py +14 -6
- warp/tests/unittest_utils.py +14 -6
- warp/tests/unused_test_misc.py +14 -6
- warp/tests/walkthrough_debug.py +14 -6
- warp/thirdparty/unittest_parallel.py +15 -7
- warp/torch.py +14 -6
- warp/types.py +80 -74
- warp/utils.py +14 -6
- warp_lang-1.6.2.dist-info/LICENSE.md +202 -0
- {warp_lang-1.6.0.dist-info → warp_lang-1.6.2.dist-info}/METADATA +44 -22
- warp_lang-1.6.2.dist-info/RECORD +419 -0
- {warp_lang-1.6.0.dist-info → warp_lang-1.6.2.dist-info}/WHEEL +1 -1
- warp_lang-1.6.0.dist-info/LICENSE.md +0 -126
- warp_lang-1.6.0.dist-info/RECORD +0 -419
- {warp_lang-1.6.0.dist-info → warp_lang-1.6.2.dist-info}/top_level.txt +0 -0
warp/native/tile_reduce.h
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
* NVIDIA CORPORATION
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
7
16
|
*/
|
|
8
17
|
|
|
9
18
|
#pragma once
|
warp/native/vec.h
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
* NVIDIA CORPORATION
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
7
16
|
*/
|
|
8
17
|
|
|
9
18
|
#pragma once
|
warp/native/volume.cpp
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
* NVIDIA CORPORATION
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
7
16
|
*/
|
|
8
17
|
|
|
9
18
|
#include "cuda_util.h"
|
warp/native/volume.cu
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
* NVIDIA CORPORATION
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
7
16
|
*/
|
|
8
17
|
|
|
9
18
|
#include "cuda_util.h"
|
warp/native/volume.h
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
* NVIDIA CORPORATION
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
7
16
|
*/
|
|
8
17
|
|
|
9
18
|
#pragma once
|
warp/native/volume_builder.cu
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
* NVIDIA CORPORATION
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
7
16
|
*/
|
|
8
17
|
|
|
9
18
|
#include "volume_builder.h"
|
warp/native/volume_builder.h
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
* NVIDIA CORPORATION
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
7
16
|
*/
|
|
8
17
|
|
|
9
18
|
#pragma once
|
warp/native/volume_impl.h
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
* NVIDIA CORPORATION
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
7
16
|
*/
|
|
8
17
|
|
|
9
18
|
#pragma once
|
warp/native/warp.cpp
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
* NVIDIA CORPORATION
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
7
16
|
*/
|
|
8
17
|
|
|
9
18
|
#include "warp.h"
|
warp/native/warp.cu
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
* NVIDIA CORPORATION
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
7
16
|
*/
|
|
8
17
|
|
|
9
18
|
#include "warp.h"
|
warp/native/warp.h
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
* NVIDIA CORPORATION
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
7
16
|
*/
|
|
8
17
|
|
|
9
18
|
#pragma once
|
warp/optim/__init__.py
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
# Copyright (c) 2022 NVIDIA CORPORATION.
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
7
15
|
|
|
8
16
|
from .adam import Adam
|
|
9
17
|
from .sgd import SGD
|
warp/optim/adam.py
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
# Copyright (c) 2022 NVIDIA CORPORATION.
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
7
15
|
|
|
8
16
|
import warp as wp
|
|
9
17
|
|
warp/optim/linear.py
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
1
16
|
from math import sqrt
|
|
2
17
|
from typing import Any, Callable, Optional, Tuple, Union
|
|
3
18
|
|
warp/optim/sgd.py
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
# Copyright (c) 2022 NVIDIA CORPORATION.
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
7
15
|
|
|
8
16
|
from typing import Any
|
|
9
17
|
|
warp/paddle.py
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
# Copyright (c) 2022 NVIDIA CORPORATION.
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
7
15
|
|
|
8
16
|
from __future__ import annotations
|
|
9
17
|
|
warp/render/__init__.py
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
# Copyright (c) 2022 NVIDIA CORPORATION.
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
7
15
|
|
|
8
16
|
from .render_opengl import OpenGLRenderer
|
|
9
17
|
from .render_usd import UsdRenderer
|
warp/render/render_opengl.py
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
# Copyright (c) 2022 NVIDIA CORPORATION.
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
7
15
|
|
|
8
16
|
import ctypes
|
|
9
17
|
import sys
|
|
@@ -1083,7 +1091,7 @@ class OpenGLRenderer:
|
|
|
1083
1091
|
self.app = pyglet.app
|
|
1084
1092
|
|
|
1085
1093
|
# making window current opengl rendering context
|
|
1086
|
-
self.
|
|
1094
|
+
self._switch_context()
|
|
1087
1095
|
|
|
1088
1096
|
self.screen_width, self.screen_height = self.window.get_framebuffer_size()
|
|
1089
1097
|
|
|
@@ -1435,7 +1443,7 @@ class OpenGLRenderer:
|
|
|
1435
1443
|
def clear(self):
|
|
1436
1444
|
gl = OpenGLRenderer.gl
|
|
1437
1445
|
|
|
1438
|
-
self.
|
|
1446
|
+
self._switch_context()
|
|
1439
1447
|
|
|
1440
1448
|
if not self.headless:
|
|
1441
1449
|
self.app.event_loop.dispatch_event("on_exit")
|
|
@@ -1631,7 +1639,7 @@ class OpenGLRenderer:
|
|
|
1631
1639
|
def _setup_framebuffer(self):
|
|
1632
1640
|
gl = OpenGLRenderer.gl
|
|
1633
1641
|
|
|
1634
|
-
self.
|
|
1642
|
+
self._switch_context()
|
|
1635
1643
|
|
|
1636
1644
|
if self._frame_texture is None:
|
|
1637
1645
|
self._frame_texture = gl.GLuint()
|
|
@@ -1801,7 +1809,7 @@ class OpenGLRenderer:
|
|
|
1801
1809
|
def update_model_matrix(self, model_matrix: Optional[Mat44] = None):
|
|
1802
1810
|
gl = OpenGLRenderer.gl
|
|
1803
1811
|
|
|
1804
|
-
self.
|
|
1812
|
+
self._switch_context()
|
|
1805
1813
|
|
|
1806
1814
|
if model_matrix is None:
|
|
1807
1815
|
self._model_matrix = self.compute_model_matrix(self._camera_axis, self._scaling)
|
|
@@ -1898,7 +1906,7 @@ class OpenGLRenderer:
|
|
|
1898
1906
|
def _draw(self):
|
|
1899
1907
|
gl = OpenGLRenderer.gl
|
|
1900
1908
|
|
|
1901
|
-
self.
|
|
1909
|
+
self._switch_context()
|
|
1902
1910
|
|
|
1903
1911
|
if not self.headless:
|
|
1904
1912
|
# catch key hold events
|
|
@@ -1999,7 +2007,7 @@ Instances: {len(self._instances)}"""
|
|
|
1999
2007
|
def _draw_grid(self, is_tiled=False):
|
|
2000
2008
|
gl = OpenGLRenderer.gl
|
|
2001
2009
|
|
|
2002
|
-
self.
|
|
2010
|
+
self._switch_context()
|
|
2003
2011
|
|
|
2004
2012
|
if not is_tiled:
|
|
2005
2013
|
gl.glUseProgram(self._grid_shader.id)
|
|
@@ -2014,7 +2022,7 @@ Instances: {len(self._instances)}"""
|
|
|
2014
2022
|
def _draw_sky(self, is_tiled=False):
|
|
2015
2023
|
gl = OpenGLRenderer.gl
|
|
2016
2024
|
|
|
2017
|
-
self.
|
|
2025
|
+
self._switch_context()
|
|
2018
2026
|
|
|
2019
2027
|
if not is_tiled:
|
|
2020
2028
|
gl.glUseProgram(self._sky_shader.id)
|
|
@@ -2030,7 +2038,7 @@ Instances: {len(self._instances)}"""
|
|
|
2030
2038
|
def _render_scene(self):
|
|
2031
2039
|
gl = OpenGLRenderer.gl
|
|
2032
2040
|
|
|
2033
|
-
self.
|
|
2041
|
+
self._switch_context()
|
|
2034
2042
|
|
|
2035
2043
|
start_instance_idx = 0
|
|
2036
2044
|
|
|
@@ -2055,7 +2063,7 @@ Instances: {len(self._instances)}"""
|
|
|
2055
2063
|
def _render_scene_tiled(self):
|
|
2056
2064
|
gl = OpenGLRenderer.gl
|
|
2057
2065
|
|
|
2058
|
-
self.
|
|
2066
|
+
self._switch_context()
|
|
2059
2067
|
|
|
2060
2068
|
for i, viewport in enumerate(self._tile_viewports):
|
|
2061
2069
|
projection_matrix_ptr = arr_pointer(self._tile_projection_matrices[i])
|
|
@@ -2205,7 +2213,7 @@ Instances: {len(self._instances)}"""
|
|
|
2205
2213
|
def register_shape(self, geo_hash, vertices, indices, color1=None, color2=None):
|
|
2206
2214
|
gl = OpenGLRenderer.gl
|
|
2207
2215
|
|
|
2208
|
-
self.
|
|
2216
|
+
self._switch_context()
|
|
2209
2217
|
|
|
2210
2218
|
shape = len(self._shapes)
|
|
2211
2219
|
if color1 is None:
|
|
@@ -2256,7 +2264,7 @@ Instances: {len(self._instances)}"""
|
|
|
2256
2264
|
def deregister_shape(self, shape):
|
|
2257
2265
|
gl = OpenGLRenderer.gl
|
|
2258
2266
|
|
|
2259
|
-
self.
|
|
2267
|
+
self._switch_context()
|
|
2260
2268
|
|
|
2261
2269
|
if shape not in self._shape_gl_buffers:
|
|
2262
2270
|
return
|
|
@@ -2317,7 +2325,7 @@ Instances: {len(self._instances)}"""
|
|
|
2317
2325
|
def update_instance_colors(self):
|
|
2318
2326
|
gl = OpenGLRenderer.gl
|
|
2319
2327
|
|
|
2320
|
-
self.
|
|
2328
|
+
self._switch_context()
|
|
2321
2329
|
|
|
2322
2330
|
colors1, colors2 = [], []
|
|
2323
2331
|
all_instances = list(self._instances.values())
|
|
@@ -2340,7 +2348,7 @@ Instances: {len(self._instances)}"""
|
|
|
2340
2348
|
def allocate_shape_instances(self):
|
|
2341
2349
|
gl = OpenGLRenderer.gl
|
|
2342
2350
|
|
|
2343
|
-
self.
|
|
2351
|
+
self._switch_context()
|
|
2344
2352
|
|
|
2345
2353
|
self._add_shape_instances = False
|
|
2346
2354
|
self._wp_instance_transforms = wp.array(
|
|
@@ -2444,7 +2452,7 @@ Instances: {len(self._instances)}"""
|
|
|
2444
2452
|
"""
|
|
2445
2453
|
gl = OpenGLRenderer.gl
|
|
2446
2454
|
|
|
2447
|
-
self.
|
|
2455
|
+
self._switch_context()
|
|
2448
2456
|
|
|
2449
2457
|
if name in self._instances:
|
|
2450
2458
|
i, body, shape, tf, scale, old_color1, old_color2, v = self._instances[name]
|
|
@@ -2558,7 +2566,7 @@ Instances: {len(self._instances)}"""
|
|
|
2558
2566
|
"""
|
|
2559
2567
|
gl = OpenGLRenderer.gl
|
|
2560
2568
|
|
|
2561
|
-
self.
|
|
2569
|
+
self._switch_context()
|
|
2562
2570
|
|
|
2563
2571
|
channels = 3 if mode == "rgb" else 1
|
|
2564
2572
|
|
|
@@ -3497,6 +3505,14 @@ Instances: {len(self._instances)}"""
|
|
|
3497
3505
|
# fmt: on
|
|
3498
3506
|
return np.array(vertices, dtype=np.float32), np.array(indices, dtype=np.uint32)
|
|
3499
3507
|
|
|
3508
|
+
def _switch_context(self):
|
|
3509
|
+
try:
|
|
3510
|
+
self.window.switch_to()
|
|
3511
|
+
except AttributeError:
|
|
3512
|
+
# The window could be in the process of being closed, in which case
|
|
3513
|
+
# its corresponding context might have been destroyed and set to `None`.
|
|
3514
|
+
pass
|
|
3515
|
+
|
|
3500
3516
|
|
|
3501
3517
|
if __name__ == "__main__":
|
|
3502
3518
|
renderer = OpenGLRenderer()
|