hyperray 0.0.1__py3-none-any.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.
- hyperdrone/__init__.py +53 -0
- hyperdrone/_cuda/__init__.py +76 -0
- hyperdrone/_dlpack.py +30 -0
- hyperdrone/_jit/__init__.py +131 -0
- hyperdrone/_jit/_build.py +113 -0
- hyperdrone/_jit/_lock.py +23 -0
- hyperdrone/_jit/_patches.py +99 -0
- hyperdrone/_jit/_toolchain.py +17 -0
- hyperdrone/_jit/_workspace.py +94 -0
- hyperdrone/_native/cmake/hyperdrone_jit.cmake +65 -0
- hyperdrone/_native/common/bindings.h +39 -0
- hyperdrone/_native/common/cuda_staging.h +80 -0
- hyperdrone/_native/common/jit_host.h +69 -0
- hyperdrone/_native/common/models.h +24 -0
- hyperdrone/_native/common/verbosity.h +52 -0
- hyperdrone/_native/dynamics/CMakeLists.txt +63 -0
- hyperdrone/_native/dynamics/host.cpp +188 -0
- hyperdrone/_native/dynamics/iface.h +71 -0
- hyperdrone/_native/dynamics/impl.cpp +638 -0
- hyperdrone/_native/env/CMakeLists.txt +98 -0
- hyperdrone/_native/env/environment.cpp +190 -0
- hyperdrone/_native/env/environment.h +282 -0
- hyperdrone/_native/env/impl.cpp +779 -0
- hyperdrone/_native/env/rotorcraft_bindings.cpp +53 -0
- hyperdrone/_native/render/CMakeLists.txt +96 -0
- hyperdrone/_native/render/renderer.cpp +973 -0
- hyperdrone/_native/render/rig_bindings.h +152 -0
- hyperdrone/_native/render/scene_bindings.cpp +515 -0
- hyperdrone/_outputs.py +32 -0
- hyperdrone/_parameters.py +36 -0
- hyperdrone/_vendor/rl-tools/CMakeLists.txt +207 -0
- hyperdrone/_vendor/rl-tools/LICENSE +21 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/all.cmake +34 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/git-diff.cmake +100 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/git-hash.cmake +24 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/summary.cmake +65 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier0-compiler.cmake +18 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier1-blas.cmake +51 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier2-json-hdf5-zlib.cmake +82 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier3-tensorboard.cmake +25 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier4-cuda.cmake +42 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier5-cli11.cmake +24 -0
- hyperdrone/_vendor/rl-tools/cmake/dependencies/assimp.cmake +19 -0
- hyperdrone/_vendor/rl-tools/cmake/legacy_flags.cmake +33 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/assimp.cmake +30 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/googletest.cmake +20 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/metal.cmake +25 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/mujoco.cmake +89 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/optix.cmake +25 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/raytracing.cmake +105 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/raytracing_generic.cmake +2 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/vulkan.cmake +4 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/webgpu.cmake +24 -0
- hyperdrone/_vendor/rl-tools/cmake/scripts/embed_text.cmake +7 -0
- hyperdrone/_vendor/rl-tools/cmake/scripts/generate-git-snapshot.cmake +138 -0
- hyperdrone/_vendor/rl-tools/include/conta/conta.h +1480 -0
- hyperdrone/_vendor/rl-tools/include/metra/metra.h +381 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/matrix.h +143 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_arm.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu.h +314 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_accelerate.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_blas.h +67 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_mkl.h +38 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_openblas.h +34 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cuda.h +289 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_dummy.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_esp32.h +29 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_generic.h +944 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_wasm32.h +13 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/persist_code.h +136 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_arm.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu.h +94 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_accelerate.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_blas.h +115 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_mkl.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_openblas.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cuda.h +713 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_generic.h +1356 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/persist_code.h +130 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/tensor.h +490 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/arm.h +91 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu.h +210 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_accelerate.h +23 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_blas.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_emscripten.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_mkl.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_openblas.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_tensorboard.h +34 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cuda.h +464 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cuda_streams.h +23 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/devices.h +105 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/dummy.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/esp32.h +85 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/generic.h +0 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/wasm32.h +59 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/model.h +218 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/operations_generic.h +769 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/persist.h +278 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/policy_adapter.h +100 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/policy_adapter_persist.h +52 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/tensor_operations_generic.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/c_backend.h +117 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/c_interface.h +36 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/l2f.h +98 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/operations_dyn.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/operations_generic.h +268 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/debugging_pool/c_backend.h +31 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/debugging_pool/c_interface.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/c_backend.h +98 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/c_interface.h +50 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/executor.h +133 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/helper.h +109 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/operations_generic.h +219 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_arduino.h +117 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_arm.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_cpu.h +57 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_cpu_tensorboard.h +151 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_cuda.h +65 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_dummy.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_wasm32.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_arm.h +98 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_cpu.h +138 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_cuda.h +380 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_dummy.h +93 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_esp32.h +92 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_generic.h +295 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_wasm32.h +230 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/mode/mode.h +98 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/activation_functions.h +113 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/capability/capability.h +61 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/capability/persist_code.h +31 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/group.h +99 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/layer.h +122 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/operations_cuda.h +64 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/operations_generic.h +186 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/persist.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/layer.h +300 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/operations_cpu_mkl.h +590 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/operations_cuda.h +809 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/operations_generic.h +1219 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/persist.h +99 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/persist_code.h +170 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/layer.h +145 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_arm/dsp.h +63 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_arm/opt.h +173 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu.h +13 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_accelerate.h +66 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_blas.h +282 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_mkl.h +66 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_openblas.h +65 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cuda.h +519 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_dummy.h +8 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_esp32/dsp.h +58 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_esp32/opt.h +167 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_generic.h +429 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/persist.h +62 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/persist_code.h +178 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/persist_common.h +59 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/layer.h +188 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/operations_cuda.h +356 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/operations_generic.h +536 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/persist.h +32 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/embedding/layer.h +119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/embedding/operations_generic.h +223 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/embedding/persist.h +46 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/layer.h +121 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/operations_generic.h +154 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/persist.h +44 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/persist_code.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/helper_operations_cuda.h +602 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/helper_operations_generic.h +251 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/layer.h +206 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/operations_generic.h +889 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/persist.h +75 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/persist_code.h +199 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/layers.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/layer.h +143 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/operations_cuda.h +80 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/operations_generic.h +216 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/persist.h +39 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_accelerate.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_blas.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_mkl.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_openblas.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cuda.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_dummy.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_generic.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/layer.h +223 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/operations_cuda.h +138 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/operations_generic.h +446 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/persist.h +70 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/layer.h +154 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/operations_cuda.h +119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/operations_generic.h +502 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/persist.h +50 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/persist_code.h +173 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/layer.h +116 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/operations_cuda.h +156 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/operations_generic.h +295 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/persist.h +83 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/persist_code.h +163 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/layer.h +123 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/operations_generic.h +272 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/persist.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/persist_code.h +164 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/layer.h +122 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/operations_cuda.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/operations_generic.h +160 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/persist.h +47 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/persist_code.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/upsample2d/layer.h +132 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/upsample2d/operations_cuda.h +141 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/upsample2d/operations_generic.h +230 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/categorical_cross_entropy/operations_generic.h +102 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/mse/operations_cuda.h +97 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/mse/operations_generic.h +101 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/operations_generic.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/nn.h +14 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_accelerate.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_blas.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_mkl.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_mux.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_openblas.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cuda.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_dummy.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_generic.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/adam.h +121 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/operations_cuda.h +98 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/operations_generic.h +150 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/persist.h +39 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/persist_code.h +80 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/operations_cuda.h +85 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/operations_generic.h +109 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/persist.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/lamb/instance/operations_generic.h +107 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/lamb/lamb.h +40 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/lamb/operations_generic.h +68 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/optimizers.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/operations_cuda.h +85 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/operations_generic.h +140 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/persist.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/persist_code.h +72 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/operations_cuda.h +49 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/operations_generic.h +50 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/sgd.h +92 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/update.h +54 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/operations_cuda.h +0 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/operations_generic.h +98 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/parameters.h +79 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/persist.h +34 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/persist_code.h +136 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/persist.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/persist_code.h +27 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/behaviors/skip_parameter_gradients.h +65 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/group/README.md +107 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/group/model.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/group/persist_code.h +77 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/network.h +174 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/operations_cuda.h +10 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/operations_dummy.h +8 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/operations_generic.h +407 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/persist.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/persist_code.h +137 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/network.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/operations_generic.h +86 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/persist.h +43 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/persist_code.h +142 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/models.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/model.h +148 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/operations_generic.h +288 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/persist.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/persist_code.h +71 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_cpu.h +0 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_cuda.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_dummy.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_generic.h +4 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/model.h +290 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/operations_cuda.h +174 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/operations_generic.h +623 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/persist.h +80 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/persist_code.h +200 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/persist.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/persist_code.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/random_uniform/model.h +43 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/random_uniform/operations_generic.h +73 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/resnet/resnet.h +97 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/model.h +270 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/operations_generic.h +625 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/persist.h +99 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/persist_code.h +115 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/bf16.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/categories.h +22 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/persist_code.h +54 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/policy.h +48 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm/group_1.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm/group_2.h +14 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm/group_3.h +14 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu/group_1.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate/group_1.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl/group_1.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mux.h +158 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas/group_1.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard/group_1.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda/group_1.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda/group_3.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy/group_1.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy/group_3.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32/group_1.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32/group_3.h +13 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32/group_1.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32/group_3.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/hdf5/hdf5.h +54 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/hdf5/operations_cpu.h +419 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/io.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/operations_cpu.h +58 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/operations_generic.h +620 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/operations_posix.h +63 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/tar.h +74 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/code.h +38 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_arm.h +39 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_cpu.h +81 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_cuda.h +172 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_dummy.h +72 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_esp32.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_generic.h +133 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_generic_array.h +73 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_wasm32.h +57 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/persist.h +77 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/camera.h +105 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/annotations/cache.h +26 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/annotations/free_space.h +60 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/annotations/operations_cpu.h +411 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/glb/glb.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/glb/operations_cpu.h +1288 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/operations_cpu.h +136 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/procthor/catalog.h +232 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/procthor/conversion.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/procthor/operations_cpu.h +123 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/datasets/procthor/procthor.h +39 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/generic/operations_cpu.h +717 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/generic/operations_generic.h +1283 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/metal/context.h +193 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/metal/device_source.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/metal/operations_cpu.h +1123 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/device.h +207 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/device_impl.h +1043 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/operations_cuda.h +1747 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/overlay_accel.h +64 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/specialization.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/vulkan/context.h +251 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/vulkan/device_source.h +48 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/vulkan/operations_cpu.h +2067 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/webgpu/bvh_sah.h +182 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/webgpu/context.h +280 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/webgpu/device_source.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/webgpu/operations_cpu.h +1405 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/operations_cpu_common.h +948 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/operations_cpu_mux.h +32 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/operations_cpu_post.h +96 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/renderer.h +484 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/save_cpu.h +314 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/scene.h +44 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/transforms_generic.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/types.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/rig/operations_cpu.h +119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/rig/operations_generic.h +121 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/rig/rig.h +70 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/scene.h +132 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/segmentation_cpu.h +145 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/transforms.h +204 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/types.h +76 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/algorithms.h +6 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/operations_cpu.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/operations_cpu_mkl.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/operations_generic.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/config.h +243 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/operations_cuda.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/operations_generic.h +205 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/persist.h +109 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/state.h +51 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/mixed_imitation.h +63 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/operations_cuda.h +190 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/operations_generic.h +332 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/operations_generic_mixed_imitation.h +81 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/persist.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/ppo.h +105 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/approximators_gru.h +84 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/approximators_mlp.h +61 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/config.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/operations_generic.h +193 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/state.h +52 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu_accelerate.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu_mkl.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu_mux.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cuda.h +131 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_generic.h +580 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/sac.h +151 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/approximators_gru.h +72 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/approximators_mlp.h +54 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/config.h +107 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/operations_generic.h +174 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/state.h +46 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu_accelerate.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu_mkl.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu_mux.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cuda.h +117 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_generic.h +359 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/td3.h +141 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/components.h +4 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/off_policy_runner.h +225 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cpu.h +95 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cpu_accelerate.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cpu_mkl.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cuda.h +237 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_generic.h +498 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_generic_per_env.h +112 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/collection.h +57 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/on_policy_runner.h +122 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cpu.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cpu_accelerate.h +8 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cpu_mkl.h +8 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cpu_mux.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cuda.h +183 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_generic.h +366 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_generic_common.h +74 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/persist.h +47 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_cpu.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_cpu_accelerate.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_cpu_mkl.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_generic.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/operations_cpu.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/operations_generic.h +123 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/persist.h +57 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/replay_buffer.h +93 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/running_normalizer/operations_generic.h +76 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/running_normalizer/persist.h +31 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/running_normalizer/running_normalizer.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/operations_generic.h +58 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/scale_observations/operations_generic.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/scale_observations/wrapper.h +26 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/wrappers.h +29 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/acrobot/acrobot.h +88 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/acrobot/operations_cpu.h +152 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/acrobot/operations_generic.h +202 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/batch/environment.h +40 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/batch/operations_cuda.h +204 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/batch/operations_generic.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/batch/operations_generic_common.h +26 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/batch/persist.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/car.h +119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/operations_cpu.h +110 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/operations_generic.h +206 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/operations_json.h +59 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/track.h +23 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/ui.h +189 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/environments.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/flag/environment.h +87 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/flag/operations_cpu.h +212 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/flag/operations_generic.h +215 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/observation.h +75 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/operations_cpu.h +1063 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/operations_cuda.h +564 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/pose.h +253 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/presets.h +154 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/raptor/operations_cpu.h +26 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/raptor/operations_generic.h +91 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/raptor/raptor.h +71 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/rig/operations_cpu.h +190 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/rig/operations_generic.h +32 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/rig/rig.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/spy/capture_cpu.h +86 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/spy/capture_cuda.h +69 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/spy/capture_optix.h +163 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/spy/operations_cpu.h +223 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/spy/operations_cpu_spectator.h +194 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/spy/operations_cuda.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/spy/operations_cuda_spectator.h +109 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/spy/spectator.h +82 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/spy/spy.h +107 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/spy/ui.h +30 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/moving_gate/moving_gate.h +103 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/moving_gate/operations_cpu.h +279 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/moving_gate/operations_cuda.h +242 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/target_frame/operations_cpu.h +322 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/target_frame/operations_cuda.h +312 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/target_frame/operations_generic_position_hold.h +128 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/target_frame/position_hold.h +22 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/target_frame/target_frame.h +92 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/visual_inertial_localization/baseline.h +46 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/visual_inertial_localization/calibration.h +62 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/visual_inertial_localization/metrics.h +101 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/visual_inertial_localization/operations_cpu.h +374 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/visual_inertial_localization/visual_inertial_localization.h +126 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/world.h +333 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/inertial_velocity.h +27 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/metrics.h +266 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/multirotor.h +1138 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_cpu.h +2252 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/05_state_is_nan.h +148 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/10_sample_initial_parameters.h +228 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/20_initial_state.h +208 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/30_sample_initial_state.h +300 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/35_get_desired_state.h +63 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/40_observe.h +637 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/50_state_algebra.h +57 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/60_dynamics.h +134 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/70_post_integration.h +368 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/80_abs_diff.h +312 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic.h +367 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic_inertial_velocity.h +44 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_helper_generic.h +43 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_multitask_generic.h +70 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_multitask_generic_forward.h +24 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/default.h +209 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/arpl.h +112 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/crazyflie.h +127 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/crazyflie_openmv.h +119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/flightmare.h +111 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/fs.h +113 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/mrs.h +110 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/soft.h +117 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/soft_rigid.h +118 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/x500.h +88 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/x500_real.h +88 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/x500_sim.h +114 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/init/default.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/registry.h +96 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/default.h +64 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/reward_functions.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/squared/operations_generic.h +202 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/squared/squared.h +52 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/termination/default.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/trajectories/lissajous.h +72 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/trajectories/trajectory.h +78 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/persist.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/persist_code.h +53 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/quaternion_helper.h +103 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/ui.h +180 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/memory/environment.h +69 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/memory/operations_cpu.h +46 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/memory/operations_generic.h +78 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/README.MD +5 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/ant.h +77 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/model.h +415 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/operations_cpu.h +162 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/persist.h +86 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/ui.h +141 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/mujoco.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/bottleneck/bottleneck.h +113 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/bottleneck/operations_cpu.h +289 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/bottleneck/operations_generic.h +495 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/environments.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/observation.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/operations_cpu.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/operations_generic.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/operations_cpu.h +146 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/operations_generic.h +262 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/pendulum.h +197 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/ui.h +97 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/ui_xeus.h +124 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/reacher/operations_cpu.h +426 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/reacher/operations_generic.h +424 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/reacher/reacher.h +137 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/loop.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/config.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/operations_cpu.h +233 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/persist.h +30 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/state.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/config.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/operations_generic.h +47 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/persist.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/state.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/config.h +47 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/operations_generic.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/persist.h +40 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/state.h +36 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/config.h +22 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/operations_cpu.h +44 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/persist.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/state.h +26 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/config.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/operations_cpu.h +113 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/persist.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/state.h +24 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/config.h +43 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/operations_cpu.h +190 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/persist.h +30 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/state.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/steps.h +4 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/config.h +27 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/operations_cpu.h +52 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/persist.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/state.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/operations_generic.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/rl.h +5 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/evaluation/evaluation.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/evaluation/operations_cpu.h +48 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/evaluation/operations_generic.h +275 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/validation.h +269 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/validation_analysis.h +85 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl_tools.h +80 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/client.h +50 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/operations_boost.h +92 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/operations_cpu.h +174 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/operations_websocket.h +208 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/server.h +448 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/universe.h +4 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/declarations_cpu.h +13 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/declarations_cpu_emscripten.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_arm.h +29 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_cpu.h +24 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_cpu_emscripten.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_cuda.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_dummy.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_esp32.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_generic.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_wasm32.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/env/operations_cpu.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/env/operations_generic.h +14 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/extrack/extrack.h +129 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/extrack/operations_cpu.h +588 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/integrators.h +103 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/memcpy.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/tuple/operations_generic.h +48 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/tuple/tuple.h +147 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/typing.h +122 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/vector_operations.h +172 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/polyak/operations_cuda.h +53 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/polyak/operations_generic.h +93 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/string/operations_generic.h +201 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/zlib/operations_cpu.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/version.h +28 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/CMakeLists.txt +15 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/README.md +214 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/CMakeLists.txt +11 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/generic/CMakeLists.txt +17 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/generic/freestanding_check.cpp +134 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/metal/CMakeLists.txt +31 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/metal/device.metal +912 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/metal/metal_cpp_impl.cpp +6 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/optix/CMakeLists.txt +51 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/optix/device.cu +1 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/optix/overlay_accel.cu +308 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/vulkan/CMakeLists.txt +37 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/vulkan/device.comp +970 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/vulkan/device_spirv.cpp +44 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/webgpu/CMakeLists.txt +31 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/webgpu/device.wgsl +1381 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/CMakeLists.txt +129 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/README.md +131 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/benchmark.cpp +180 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/benchmark_dynamic.cpp +491 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/download_paper_scene.py +74 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/ios_app/CMakeLists.txt +104 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/ios_app/Info.plist +36 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/ios_app/Sources/BenchmarkApp.swift +172 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/ios_app/benchmark.h +10 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/ios_app/benchmark.mm +46 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/ios_app/build.sh +17 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/rig.cpp +119 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix.cpp +1382 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix.h +5 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix_config.h.in +25 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix_identity.cmake +11 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix_main.cpp +5 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix_physics.cu +125 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix_physics.h +58 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix_physics_contract.h +179 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix_physics_cpu.cpp +77 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/camera_orbit.h +51 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/CMakeLists.txt +199 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/antialiasing.cpp +214 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/drone.cpp +320 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/drone_device.cu +359 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/environment/environment.h +96 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/environment/operations_cpu.h +263 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/example.cpp +273 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/fixed_pose.cpp +221 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/flow.cpp +120 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/interactive.cpp +1015 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/make_drone_glb.py +172 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/minimal.cpp +82 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/minimal_overlay.cpp +137 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/motion_blur.cpp +232 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/render_pose_trace.cpp +1829 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/render_pose_trace_motion_blur.cpp +647 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/CMakeLists.txt +147 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/README.md +15 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/job.sbatch +28 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model.h +260 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_config.h +24 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_forward_cuda.h +397 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_operations.h +418 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_persist.h +45 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_student.h +70 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/scene.cpp +222 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/scene.h +68 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/.gitignore +4 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/CMakeLists.txt +4 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Info.plist +24 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Info_ios.plist +36 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/CameraManager.swift +120 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/ContentView.swift +703 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/DatasetRecorder.swift +285 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/YawPredictorApp.swift +25 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/YawPredictor.entitlements +8 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/build.sh +66 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/build_ios.sh +133 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/generate.sh +6 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/h5_to_tar.cpp +82 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/inference.cpp +166 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/inference.h +26 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/project.yml +30 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/test_tar_vs_hdf5.cpp +173 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_cuda.cu +699 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_dataset_overlay.cpp +475 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_distill_cuda.cu +995 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_eval.cu +457 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_real_world_eval.cpp +660 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_viewer.cu +443 -0
- hyperdrone/_vendor/rl-tools/src/rl/environments/hyperdrone/spy/CMakeLists.txt +63 -0
- hyperdrone/_vendor/rl-tools/src/rl/environments/hyperdrone/spy/example.cpp +101 -0
- hyperdrone/_vendor/rl-tools/src/rl/environments/hyperdrone/spy/ui.cpp +380 -0
- hyperdrone/dynamics/__init__.py +5 -0
- hyperdrone/dynamics/_component.py +31 -0
- hyperdrone/dynamics/_config.py +46 -0
- hyperdrone/dynamics/_sim.py +166 -0
- hyperdrone/env/__init__.py +23 -0
- hyperdrone/env/_multi_environment.py +566 -0
- hyperdrone/env/_rotorcraft.py +29 -0
- hyperdrone/env/_spy.py +39 -0
- hyperdrone/examples/.gitignore +3 -0
- hyperdrone/examples/Benchmark.ipynb +113 -0
- hyperdrone/examples/HyperDrone.ipynb +589 -0
- hyperdrone/examples/Orbiter.ipynb +496 -0
- hyperdrone/examples/Renderer.ipynb +218 -0
- hyperdrone/examples/__init__.py +16 -0
- hyperdrone/examples/articulation.py +55 -0
- hyperdrone/examples/benchmark.py +236 -0
- hyperdrone/examples/benchmark_minimal.py +65 -0
- hyperdrone/examples/data.py +71 -0
- hyperdrone/examples/drone_flythrough.py +169 -0
- hyperdrone/examples/hyperdrone_videos/my_world_preview.h +17 -0
- hyperdrone/examples/my_world.h +17 -0
- hyperdrone/examples/render_procthor.py +40 -0
- hyperdrone/examples/shots.py +108 -0
- hyperdrone/examples/spy.py +40 -0
- hyperdrone/examples/visual_inertial_localization.py +158 -0
- hyperdrone/gym/__init__.py +67 -0
- hyperdrone/render/__init__.py +57 -0
- hyperdrone/render/_component.py +51 -0
- hyperdrone/render/_config.py +76 -0
- hyperdrone/render/_renderer.py +498 -0
- hyperdrone/render/_rig.py +136 -0
- hyperdrone/render/_sampling.py +69 -0
- hyperdrone/render/_scene.py +38 -0
- hyperdrone/render/datasets.py +15 -0
- hyperray-0.0.1.dist-info/METADATA +519 -0
- hyperray-0.0.1.dist-info/RECORD +788 -0
- hyperray-0.0.1.dist-info/WHEEL +4 -0
hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/operations_cuda.h
ADDED
|
@@ -0,0 +1,1747 @@
|
|
|
1
|
+
#include "../../../../version.h"
|
|
2
|
+
#include "../../../../rl_tools.h"
|
|
3
|
+
#if (defined(RL_TOOLS_DISABLE_INCLUDE_GUARDS) || !defined(RL_TOOLS_RENDERING_RAYTRACING_BACKENDS_OPTIX_OPERATIONS_CUDA_H)) && (RL_TOOLS_USE_THIS_VERSION == 1)
|
|
4
|
+
#pragma once
|
|
5
|
+
#define RL_TOOLS_RENDERING_RAYTRACING_BACKENDS_OPTIX_OPERATIONS_CUDA_H
|
|
6
|
+
|
|
7
|
+
#include "../../renderer.h"
|
|
8
|
+
#include "../../operations_cpu_common.h"
|
|
9
|
+
#include "device.h"
|
|
10
|
+
#include "overlay_accel.h"
|
|
11
|
+
#include "../../../../devices/cuda_streams.h"
|
|
12
|
+
|
|
13
|
+
#include "owl/owl.h"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
#include <vector>
|
|
17
|
+
#include <limits>
|
|
18
|
+
#include <algorithm>
|
|
19
|
+
#include <functional>
|
|
20
|
+
#include <string>
|
|
21
|
+
#include <map>
|
|
22
|
+
#include <chrono>
|
|
23
|
+
#include <cmath>
|
|
24
|
+
#include <cstring>
|
|
25
|
+
#include <cuda_runtime.h>
|
|
26
|
+
|
|
27
|
+
RL_TOOLS_NAMESPACE_WRAPPER_START
|
|
28
|
+
namespace rl_tools {
|
|
29
|
+
extern "C" char device_ptx[];
|
|
30
|
+
extern "C" char device_depth_ptx[];
|
|
31
|
+
extern "C" char device_segmentation_ptx[];
|
|
32
|
+
extern "C" char device_depth_segmentation_ptx[];
|
|
33
|
+
extern "C" char device_normals_ptx[];
|
|
34
|
+
extern "C" char device_depth_normals_ptx[];
|
|
35
|
+
extern "C" char device_segmentation_normals_ptx[];
|
|
36
|
+
extern "C" char device_depth_segmentation_normals_ptx[];
|
|
37
|
+
|
|
38
|
+
namespace rendering::raytracing::backends::optix {
|
|
39
|
+
// inactive overlay slots point at a shared degenerate-triangle BLAS, so every overlay
|
|
40
|
+
// TLAS keeps a fixed instance count and instance-id layout across rebuilds
|
|
41
|
+
struct OverlayState {
|
|
42
|
+
std::vector<OWLGroup> object_groups;
|
|
43
|
+
OWLGroup filler_group = nullptr;
|
|
44
|
+
OverlayAccelState* accel = nullptr;
|
|
45
|
+
OWLBuffer traversables_buffer = nullptr;
|
|
46
|
+
OWLBuffer attachments_buffer = nullptr;
|
|
47
|
+
OWLBuffer instance_classes_buffer = nullptr;
|
|
48
|
+
// pageable staging for host-verb writes: cudaMemcpyAsync returns only after pageable
|
|
49
|
+
// sources are consumed, so the lists can be refilled right away. The pending rows of a
|
|
50
|
+
// staging mirror compact into row_indices/rows and scatter on the render stream.
|
|
51
|
+
std::vector<OverlaySlotStructure> structure_staging;
|
|
52
|
+
std::vector<unsigned int> row_indices;
|
|
53
|
+
std::vector<float> rows;
|
|
54
|
+
unsigned int* row_indices_device = nullptr;
|
|
55
|
+
float* rows_device = nullptr;
|
|
56
|
+
OWLBuffer traversables_previous_buffer = nullptr; // flow: the previous instant's TLAS handles
|
|
57
|
+
size_t num_scene_instances = 0;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
struct State {
|
|
61
|
+
OWLContext context = nullptr;
|
|
62
|
+
OWLModule module = nullptr;
|
|
63
|
+
OWLMissProg miss_prog = nullptr;
|
|
64
|
+
OWLBuffer cameras_buffer = nullptr;
|
|
65
|
+
OWLBuffer cameras_open_buffer = nullptr;
|
|
66
|
+
OWLGroup world = nullptr;
|
|
67
|
+
OWLParams launch_params = nullptr;
|
|
68
|
+
OWLRayGen collision_ray_gen = nullptr;
|
|
69
|
+
OWLBuffer collision_results_buffer = nullptr;
|
|
70
|
+
OWLBuffer probe_dirs_buffer = nullptr;
|
|
71
|
+
OWLParams coll_launch_params = nullptr;
|
|
72
|
+
OverlayState* overlay_state = nullptr;
|
|
73
|
+
OWLRayGen ray_gen = nullptr;
|
|
74
|
+
OWLBuffer frame_buffer = nullptr;
|
|
75
|
+
OWLRayGen depth_ray_gen = nullptr;
|
|
76
|
+
OWLBuffer depth_buffer = nullptr;
|
|
77
|
+
OWLRayGen segmentation_ray_gen = nullptr;
|
|
78
|
+
OWLBuffer segmentation_buffer = nullptr;
|
|
79
|
+
OWLRayGen normals_ray_gen = nullptr;
|
|
80
|
+
OWLBuffer normals_buffer = nullptr;
|
|
81
|
+
OWLRayGen flow_ray_gen = nullptr;
|
|
82
|
+
OWLRayGen flow_forward_ray_gen = nullptr;
|
|
83
|
+
OWLBuffer flow_buffer = nullptr;
|
|
84
|
+
OWLBuffer flow_status_buffer = nullptr;
|
|
85
|
+
OWLBuffer flow_forward_buffer = nullptr;
|
|
86
|
+
OWLBuffer flow_forward_status_buffer = nullptr;
|
|
87
|
+
OWLBuffer flow_deltas_buffer = nullptr; // internal [2][slots][12] delta table, composed by update_launch
|
|
88
|
+
OWLBuffer cameras_previous_buffer = nullptr;
|
|
89
|
+
OWLBuffer observation_buffer = nullptr;
|
|
90
|
+
OWLBuffer rgb_accumulator_buffer = nullptr;
|
|
91
|
+
float* shutter_device = nullptr; // per-pass shutter time, written by the overlay fill kernel
|
|
92
|
+
cudaEvent_t ordering_event = nullptr; // reused for every stream-to-stream ordering (record/wait pairs are consumed on the spot)
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
namespace rendering::raytracing::backends {
|
|
97
|
+
template <typename SPEC>
|
|
98
|
+
struct RendererState<rendering::raytracing::backends::Optix, SPEC>: optix::State {
|
|
99
|
+
rendering::raytracing::AssetLibrary<SPEC, rendering::raytracing::backends::Optix>* library = nullptr;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
template <typename SPEC>
|
|
103
|
+
struct LibraryState<rendering::raytracing::backends::Optix, SPEC> {
|
|
104
|
+
OWLContext context = nullptr;
|
|
105
|
+
OWLModule module = nullptr;
|
|
106
|
+
OWLMissProg miss_prog = nullptr;
|
|
107
|
+
OWLGeomType geom_type = nullptr;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
template <typename SPEC>
|
|
111
|
+
struct SceneState<rendering::raytracing::backends::Optix, SPEC> {
|
|
112
|
+
OWLGroup world = nullptr;
|
|
113
|
+
OWLBuffer instance_classes_buffer = nullptr;
|
|
114
|
+
OWLGroup filler_group = nullptr;
|
|
115
|
+
std::vector<OWLGroup> object_groups;
|
|
116
|
+
size_t num_scene_instances = 0;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
namespace rendering::raytracing::detail {
|
|
121
|
+
template <typename SPEC>
|
|
122
|
+
const char* ray_gen_program_name(const char* srgb_name, const char* linear_name) {
|
|
123
|
+
if constexpr (SPEC::SHADING::SRGB_OUTPUT) {
|
|
124
|
+
return srgb_name;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
return linear_name;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
template <typename SPEC>
|
|
132
|
+
const char* ray_gen_program_name() {
|
|
133
|
+
if constexpr (SPEC::ENABLE_DYNAMIC_MOTION_BLUR) {
|
|
134
|
+
// the motion loop runs at launch level (one pass per sample), so only the AA grid
|
|
135
|
+
// is compiled in; accumulation is linear, srgb/linear resolve happens later
|
|
136
|
+
if constexpr (SPEC::ENABLE_ANTI_ALIASING) {
|
|
137
|
+
if constexpr (SPEC::ANTI_ALIASING_GRID_SIZE == 2) {
|
|
138
|
+
return "accumRayGenAA2";
|
|
139
|
+
}
|
|
140
|
+
else if constexpr (SPEC::ANTI_ALIASING_GRID_SIZE == 3) {
|
|
141
|
+
return "accumRayGenAA3";
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
return "accumRayGenAA4";
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
return "accumRayGen";
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
else if constexpr (SPEC::ENABLE_MOTION_BLUR) {
|
|
152
|
+
if constexpr (SPEC::ENABLE_ANTI_ALIASING) {
|
|
153
|
+
if constexpr (SPEC::MOTION_BLUR_SAMPLES == 2) {
|
|
154
|
+
if constexpr (SPEC::ANTI_ALIASING_GRID_SIZE == 2) {
|
|
155
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur2AA2", "linearRayGenMotionBlur2AA2");
|
|
156
|
+
}
|
|
157
|
+
else if constexpr (SPEC::ANTI_ALIASING_GRID_SIZE == 3) {
|
|
158
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur2AA3", "linearRayGenMotionBlur2AA3");
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur2AA4", "linearRayGenMotionBlur2AA4");
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
else if constexpr (SPEC::MOTION_BLUR_SAMPLES == 4) {
|
|
165
|
+
if constexpr (SPEC::ANTI_ALIASING_GRID_SIZE == 2) {
|
|
166
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur4AA2", "linearRayGenMotionBlur4AA2");
|
|
167
|
+
}
|
|
168
|
+
else if constexpr (SPEC::ANTI_ALIASING_GRID_SIZE == 3) {
|
|
169
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur4AA3", "linearRayGenMotionBlur4AA3");
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur4AA4", "linearRayGenMotionBlur4AA4");
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
else if constexpr (SPEC::MOTION_BLUR_SAMPLES == 8) {
|
|
176
|
+
if constexpr (SPEC::ANTI_ALIASING_GRID_SIZE == 2) {
|
|
177
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur8AA2", "linearRayGenMotionBlur8AA2");
|
|
178
|
+
}
|
|
179
|
+
else if constexpr (SPEC::ANTI_ALIASING_GRID_SIZE == 3) {
|
|
180
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur8AA3", "linearRayGenMotionBlur8AA3");
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur8AA4", "linearRayGenMotionBlur8AA4");
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
else if constexpr (SPEC::MOTION_BLUR_SAMPLES == 16) {
|
|
187
|
+
if constexpr (SPEC::ANTI_ALIASING_GRID_SIZE == 2) {
|
|
188
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur16AA2", "linearRayGenMotionBlur16AA2");
|
|
189
|
+
}
|
|
190
|
+
else if constexpr (SPEC::ANTI_ALIASING_GRID_SIZE == 3) {
|
|
191
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur16AA3", "linearRayGenMotionBlur16AA3");
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur16AA4", "linearRayGenMotionBlur16AA4");
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
if constexpr (SPEC::ANTI_ALIASING_GRID_SIZE == 2) {
|
|
199
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur32AA2", "linearRayGenMotionBlur32AA2");
|
|
200
|
+
}
|
|
201
|
+
else if constexpr (SPEC::ANTI_ALIASING_GRID_SIZE == 3) {
|
|
202
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur32AA3", "linearRayGenMotionBlur32AA3");
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur32AA4", "linearRayGenMotionBlur32AA4");
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
else if constexpr (SPEC::MOTION_BLUR_SAMPLES == 2) {
|
|
210
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur2", "linearRayGenMotionBlur2");
|
|
211
|
+
}
|
|
212
|
+
else if constexpr (SPEC::MOTION_BLUR_SAMPLES == 4) {
|
|
213
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur4", "linearRayGenMotionBlur4");
|
|
214
|
+
}
|
|
215
|
+
else if constexpr (SPEC::MOTION_BLUR_SAMPLES == 8) {
|
|
216
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur8", "linearRayGenMotionBlur8");
|
|
217
|
+
}
|
|
218
|
+
else if constexpr (SPEC::MOTION_BLUR_SAMPLES == 16) {
|
|
219
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur16", "linearRayGenMotionBlur16");
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
return ray_gen_program_name<SPEC>("simpleRayGenMotionBlur32", "linearRayGenMotionBlur32");
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
else if constexpr (SPEC::ENABLE_ANTI_ALIASING) {
|
|
226
|
+
if constexpr (SPEC::ANTI_ALIASING_GRID_SIZE == 2) {
|
|
227
|
+
return ray_gen_program_name<SPEC>("simpleRayGenAA2", "linearRayGenAA2");
|
|
228
|
+
}
|
|
229
|
+
else if constexpr (SPEC::ANTI_ALIASING_GRID_SIZE == 3) {
|
|
230
|
+
return ray_gen_program_name<SPEC>("simpleRayGenAA3", "linearRayGenAA3");
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
return ray_gen_program_name<SPEC>("simpleRayGenAA4", "linearRayGenAA4");
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
return ray_gen_program_name<SPEC>("simpleRayGen", "linearRayGen");
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
template <typename SPEC>
|
|
242
|
+
const char* closest_hit_program_name() {
|
|
243
|
+
if constexpr (SPEC::SHADING::PBR_SHADING) {
|
|
244
|
+
return SPEC::SHADING::PUNCTUAL_LIGHT_SHADOWS ? "TriangleMeshPBRShadows" : "TriangleMeshPBR";
|
|
245
|
+
}
|
|
246
|
+
else if constexpr (SPEC::SHADING::LOAD_TEXTURES) {
|
|
247
|
+
if constexpr (SPEC::SHADING::NORMAL_SHADING) {
|
|
248
|
+
return SPEC::SHADING::METALLIC_REFLECTIONS ? "TriangleMeshBasicTTT" : "TriangleMeshBasicTTF";
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
return SPEC::SHADING::METALLIC_REFLECTIONS ? "TriangleMeshBasicTFT" : "TriangleMeshBasicTFF";
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
if constexpr (SPEC::SHADING::NORMAL_SHADING) {
|
|
256
|
+
return SPEC::SHADING::METALLIC_REFLECTIONS ? "TriangleMeshBasicFTT" : "TriangleMeshBasicFTF";
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
return SPEC::SHADING::METALLIC_REFLECTIONS ? "TriangleMeshBasicFFT" : "TriangleMeshBasicFFF";
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
template <typename SPEC>
|
|
265
|
+
struct MediumShadingUsage {
|
|
266
|
+
static constexpr bool USES_INDEX = SPEC::SHADING::LOAD_TEXTURES || SPEC::SHADING::NORMAL_SHADING || SPEC::SHADING::METALLIC_REFLECTIONS;
|
|
267
|
+
static constexpr bool USES_VERTEX = SPEC::SHADING::NORMAL_SHADING || SPEC::SHADING::METALLIC_REFLECTIONS;
|
|
268
|
+
static constexpr bool USES_TEXTURE = SPEC::SHADING::LOAD_TEXTURES;
|
|
269
|
+
static constexpr bool USES_WORLD = SPEC::SHADING::METALLIC_REFLECTIONS;
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// =========================================================================
|
|
274
|
+
// malloc: create OWL context and allocate buffers
|
|
275
|
+
// =========================================================================
|
|
276
|
+
namespace rendering::raytracing::backends::optix{
|
|
277
|
+
// context-scoped resources (context, module, miss programs): created once per renderer
|
|
278
|
+
// in standalone mode, once per AssetLibrary in shared mode. The context is bound to the
|
|
279
|
+
// CUDA device that is current at creation (multi-GPU targets cudaSetDevice before malloc);
|
|
280
|
+
// owlContextCreate(nullptr, 1) would always pick ordinal 0
|
|
281
|
+
template <typename SPEC>
|
|
282
|
+
void create_context_resources(OWLContext& context_out, OWLModule& module_out, OWLMissProg& miss_prog_out){
|
|
283
|
+
int32_t cuda_device_id = 0;
|
|
284
|
+
cudaGetDevice(&cuda_device_id);
|
|
285
|
+
OWLContext context = owlContextCreate(&cuda_device_id, 1);
|
|
286
|
+
// ray type 2 (normals) only exists in the normals-enabled PTX variants; the count
|
|
287
|
+
// must match the NUM_RAY_TYPES the selected PTX was compiled with (SBT stride)
|
|
288
|
+
owlContextSetRayTypeCount(context, SPEC::HAS_NORMALS ? 3 : 2);
|
|
289
|
+
owlContextSetNumPayloadValues(context, 4); // color ptr (2), recursion depth, hit distance
|
|
290
|
+
const char* ptx = nullptr;
|
|
291
|
+
if constexpr (SPEC::HAS_NORMALS) {
|
|
292
|
+
if constexpr (SPEC::HAS_SEGMENTATION && SPEC::HAS_DEPTH) {
|
|
293
|
+
ptx = device_depth_segmentation_normals_ptx;
|
|
294
|
+
}
|
|
295
|
+
else if constexpr (SPEC::HAS_SEGMENTATION) {
|
|
296
|
+
ptx = device_segmentation_normals_ptx;
|
|
297
|
+
}
|
|
298
|
+
else if constexpr (SPEC::HAS_DEPTH) {
|
|
299
|
+
ptx = device_depth_normals_ptx;
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
ptx = device_normals_ptx;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
else if constexpr (SPEC::HAS_SEGMENTATION && SPEC::HAS_DEPTH) {
|
|
306
|
+
ptx = device_depth_segmentation_ptx;
|
|
307
|
+
}
|
|
308
|
+
else if constexpr (SPEC::HAS_SEGMENTATION) {
|
|
309
|
+
ptx = device_segmentation_ptx;
|
|
310
|
+
}
|
|
311
|
+
else if constexpr (SPEC::HAS_DEPTH) {
|
|
312
|
+
ptx = device_depth_ptx;
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
ptx = device_ptx;
|
|
316
|
+
}
|
|
317
|
+
OWLModule module = owlModuleCreate(context, ptx);
|
|
318
|
+
|
|
319
|
+
// RGB miss program (ray type 0)
|
|
320
|
+
OWLVarDecl miss_prog_vars[] = {
|
|
321
|
+
{ "color_0", OWL_FLOAT3, OWL_OFFSETOF(MissProgData, color_0)},
|
|
322
|
+
{ "color_1", OWL_FLOAT3, OWL_OFFSETOF(MissProgData, color_1)},
|
|
323
|
+
{ /* sentinel */ }
|
|
324
|
+
};
|
|
325
|
+
const char* miss_program_name = "miss";
|
|
326
|
+
if constexpr (SPEC::HAS_RGB && !SPEC::SHADING::CHECKER_BACKGROUND) {
|
|
327
|
+
miss_program_name = "missConstant";
|
|
328
|
+
}
|
|
329
|
+
OWLMissProg miss_prog = owlMissProgCreate(context, module, miss_program_name,
|
|
330
|
+
sizeof(MissProgData), miss_prog_vars, -1);
|
|
331
|
+
// colors are scene content (Scene::Environment), resolved and set at init before the
|
|
332
|
+
// SBT build; the creation-time values are placeholders
|
|
333
|
+
owlMissProgSet3f(miss_prog, "color_0", owl3f{0.f, 0.f, 0.f});
|
|
334
|
+
owlMissProgSet3f(miss_prog, "color_1", owl3f{0.f, 0.f, 0.f});
|
|
335
|
+
miss_prog_out = miss_prog;
|
|
336
|
+
|
|
337
|
+
// Collision miss program (ray type 1) — always registered to keep SBT consistent
|
|
338
|
+
OWLVarDecl collision_miss_vars[] = {
|
|
339
|
+
{ "dummy", OWL_INT, OWL_OFFSETOF(CollisionMissData, dummy)},
|
|
340
|
+
{ /* sentinel */ }
|
|
341
|
+
};
|
|
342
|
+
OWLMissProg collision_miss_prog = owlMissProgCreate(context, module, "collisionMiss",
|
|
343
|
+
sizeof(CollisionMissData), collision_miss_vars, -1);
|
|
344
|
+
(void)collision_miss_prog;
|
|
345
|
+
|
|
346
|
+
context_out = context;
|
|
347
|
+
module_out = module;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
namespace rendering::raytracing::backends::optix::detail{
|
|
352
|
+
// everything renderer-private: framebuffers, cameras, ray gens, collision resources
|
|
353
|
+
template <typename DEVICE, typename SPEC>
|
|
354
|
+
void malloc_renderer(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer, OWLContext context, OWLModule module){
|
|
355
|
+
using TI = typename SPEC::TI;
|
|
356
|
+
|
|
357
|
+
if constexpr (SPEC::ENABLE_OVERLAYS) {
|
|
358
|
+
// device-resident transform input (see transforms(device, renderer)): producers write
|
|
359
|
+
// it directly, update_launch consumes it on the render stream
|
|
360
|
+
using TRANSFORMS_SPEC = typename decltype(renderer.transforms)::SPEC;
|
|
361
|
+
float* transforms_device = nullptr;
|
|
362
|
+
cudaMalloc(&transforms_device, TRANSFORMS_SPEC::SIZE_BYTES);
|
|
363
|
+
cudaMemset(transforms_device, 0, TRANSFORMS_SPEC::SIZE_BYTES);
|
|
364
|
+
renderer.transforms._data = transforms_device;
|
|
365
|
+
rendering::raytracing::detail::malloc_overlay_staging(renderer);
|
|
366
|
+
}
|
|
367
|
+
if constexpr (SPEC::HAS_FLOW_OVERLAYS) {
|
|
368
|
+
using TRANSFORMS_PREVIOUS_SPEC = typename decltype(renderer.transforms_previous)::SPEC;
|
|
369
|
+
float* transforms_previous_device = nullptr;
|
|
370
|
+
cudaMalloc(&transforms_previous_device, TRANSFORMS_PREVIOUS_SPEC::SIZE_BYTES);
|
|
371
|
+
cudaMemset(transforms_previous_device, 0, TRANSFORMS_PREVIOUS_SPEC::SIZE_BYTES);
|
|
372
|
+
renderer.transforms_previous._data = transforms_previous_device;
|
|
373
|
+
}
|
|
374
|
+
if constexpr (SPEC::ENABLE_DYNAMIC_MOTION_BLUR) {
|
|
375
|
+
using TRANSFORMS_MOTION_SPEC = typename decltype(renderer.transforms_motion)::SPEC;
|
|
376
|
+
float* transforms_motion_device = nullptr;
|
|
377
|
+
cudaMalloc(&transforms_motion_device, TRANSFORMS_MOTION_SPEC::SIZE_BYTES);
|
|
378
|
+
cudaMemset(transforms_motion_device, 0, TRANSFORMS_MOTION_SPEC::SIZE_BYTES);
|
|
379
|
+
renderer.transforms_motion._data = transforms_motion_device;
|
|
380
|
+
cudaMalloc(&renderer.backend->shutter_device, sizeof(float));
|
|
381
|
+
cudaMemset(renderer.backend->shutter_device, 0, sizeof(float));
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
constexpr TI cam_pixels = SPEC::CAM_PIXELS;
|
|
385
|
+
// device-resident outputs (see frame_buffer/depth_buffer/segmentation_buffer/observation
|
|
386
|
+
// accessors): the tensors alias the OWL buffers the ray gens write, so device consumers
|
|
387
|
+
// read them in place and host readers stage through an explicit copy
|
|
388
|
+
OWLBuffer frame_buffer = nullptr;
|
|
389
|
+
if constexpr (SPEC::HAS_RGB) {
|
|
390
|
+
frame_buffer = owlDeviceBufferCreate(context, OWL_INT,
|
|
391
|
+
(size_t)SPEC::NUM_CAMERAS * cam_pixels, nullptr);
|
|
392
|
+
renderer.frame_buffer._data = (uint32_t*)owlBufferGetPointer(frame_buffer, 0);
|
|
393
|
+
}
|
|
394
|
+
OWLBuffer observation_buffer = nullptr;
|
|
395
|
+
if constexpr (SPEC::HAS_OBSERVATION) {
|
|
396
|
+
static_assert(utils::typing::is_same_v<typename SPEC::OBSERVATION_T, float>, "The OptiX raytracing backend requires OBSERVATION_T = float");
|
|
397
|
+
observation_buffer = owlDeviceBufferCreate(context, OWL_FLOAT,
|
|
398
|
+
(size_t)SPEC::NUM_CAMERAS * cam_pixels * SPEC::OBSERVATION_CHANNELS, nullptr);
|
|
399
|
+
renderer.backend->observation_buffer = observation_buffer;
|
|
400
|
+
renderer.observation._data = (float*)owlBufferGetPointer(observation_buffer, 0);
|
|
401
|
+
}
|
|
402
|
+
OWLBuffer depth_buffer = nullptr;
|
|
403
|
+
if constexpr (SPEC::HAS_DEPTH) {
|
|
404
|
+
depth_buffer = owlDeviceBufferCreate(context, OWL_FLOAT,
|
|
405
|
+
(size_t)SPEC::NUM_CAMERAS * cam_pixels, nullptr);
|
|
406
|
+
renderer.depth_buffer._data = (float*)owlBufferGetPointer(depth_buffer, 0);
|
|
407
|
+
}
|
|
408
|
+
OWLBuffer segmentation_buffer = nullptr;
|
|
409
|
+
if constexpr (SPEC::HAS_SEGMENTATION) {
|
|
410
|
+
segmentation_buffer = owlDeviceBufferCreate(context, OWL_UINT,
|
|
411
|
+
(size_t)SPEC::NUM_CAMERAS * cam_pixels, nullptr);
|
|
412
|
+
renderer.segmentation_buffer._data = (uint32_t*)owlBufferGetPointer(segmentation_buffer, 0);
|
|
413
|
+
}
|
|
414
|
+
OWLBuffer normals_buffer = nullptr;
|
|
415
|
+
if constexpr (SPEC::HAS_NORMALS) {
|
|
416
|
+
normals_buffer = owlDeviceBufferCreate(context, OWL_FLOAT,
|
|
417
|
+
(size_t)SPEC::NUM_CAMERAS * cam_pixels * 3, nullptr);
|
|
418
|
+
renderer.normals_buffer._data = (float*)owlBufferGetPointer(normals_buffer, 0);
|
|
419
|
+
}
|
|
420
|
+
OWLBuffer flow_buffer = nullptr;
|
|
421
|
+
OWLBuffer flow_status_buffer = nullptr;
|
|
422
|
+
OWLBuffer flow_forward_buffer = nullptr;
|
|
423
|
+
OWLBuffer flow_forward_status_buffer = nullptr;
|
|
424
|
+
OWLBuffer flow_deltas_buffer = nullptr;
|
|
425
|
+
if constexpr (SPEC::HAS_FLOW) {
|
|
426
|
+
flow_buffer = owlDeviceBufferCreate(context, OWL_FLOAT,
|
|
427
|
+
(size_t)SPEC::NUM_CAMERAS * cam_pixels * 2, nullptr);
|
|
428
|
+
renderer.flow_buffer._data = (float*)owlBufferGetPointer(flow_buffer, 0);
|
|
429
|
+
flow_status_buffer = owlDeviceBufferCreate(context, OWL_UINT,
|
|
430
|
+
(size_t)SPEC::NUM_CAMERAS * cam_pixels, nullptr);
|
|
431
|
+
renderer.flow_status_buffer._data = (uint32_t*)owlBufferGetPointer(flow_status_buffer, 0);
|
|
432
|
+
if constexpr (SPEC::HAS_FLOW_OVERLAYS) {
|
|
433
|
+
flow_deltas_buffer = owlDeviceBufferCreate(context, OWL_FLOAT,
|
|
434
|
+
(size_t)2 * SPEC::NUM_OVERLAYS * SPEC::MAX_OVERLAY_INSTANCES * 12, nullptr);
|
|
435
|
+
renderer.backend->flow_deltas_buffer = flow_deltas_buffer;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
if constexpr (SPEC::HAS_FLOW_FORWARD) {
|
|
439
|
+
flow_forward_buffer = owlDeviceBufferCreate(context, OWL_FLOAT,
|
|
440
|
+
(size_t)SPEC::NUM_CAMERAS * cam_pixels * 2, nullptr);
|
|
441
|
+
renderer.flow_forward_buffer._data = (float*)owlBufferGetPointer(flow_forward_buffer, 0);
|
|
442
|
+
flow_forward_status_buffer = owlDeviceBufferCreate(context, OWL_UINT,
|
|
443
|
+
(size_t)SPEC::NUM_CAMERAS * cam_pixels, nullptr);
|
|
444
|
+
renderer.flow_forward_status_buffer._data = (uint32_t*)owlBufferGetPointer(flow_forward_status_buffer, 0);
|
|
445
|
+
}
|
|
446
|
+
OWLBuffer rgb_accumulator_buffer = nullptr;
|
|
447
|
+
if constexpr (SPEC::ENABLE_DYNAMIC_MOTION_BLUR) {
|
|
448
|
+
if constexpr (SPEC::HAS_RGB) {
|
|
449
|
+
rgb_accumulator_buffer = owlDeviceBufferCreate(context, OWL_FLOAT,
|
|
450
|
+
(size_t)SPEC::NUM_CAMERAS * cam_pixels * 3, nullptr);
|
|
451
|
+
renderer.backend->rgb_accumulator_buffer = rgb_accumulator_buffer;
|
|
452
|
+
renderer.rgb_accumulator._data = (float*)owlBufferGetPointer(rgb_accumulator_buffer, 0);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
OWLRayGen ray_gen = nullptr;
|
|
457
|
+
if constexpr (SPEC::HAS_RGB) {
|
|
458
|
+
if constexpr (SPEC::ENABLE_DYNAMIC_MOTION_BLUR) {
|
|
459
|
+
OWLVarDecl ray_gen_vars[] = {
|
|
460
|
+
{ "accum_ptr", OWL_RAW_POINTER, OWL_OFFSETOF(AccumulateRayGenData, accum_ptr)},
|
|
461
|
+
{ "shutter_ptr", OWL_RAW_POINTER, OWL_OFFSETOF(AccumulateRayGenData, shutter_ptr)},
|
|
462
|
+
{ "fb_size", OWL_INT2, OWL_OFFSETOF(AccumulateRayGenData, fb_size)},
|
|
463
|
+
{ "cam_size", OWL_INT2, OWL_OFFSETOF(AccumulateRayGenData, cam_size)},
|
|
464
|
+
{ "grid_cols", OWL_INT, OWL_OFFSETOF(AccumulateRayGenData, grid_cols)},
|
|
465
|
+
{ "num_cameras", OWL_INT, OWL_OFFSETOF(AccumulateRayGenData, num_cameras)},
|
|
466
|
+
{ "world", OWL_GROUP, OWL_OFFSETOF(AccumulateRayGenData, world)},
|
|
467
|
+
{ "cameras_open", OWL_BUFPTR, OWL_OFFSETOF(AccumulateRayGenData, cameras_open)},
|
|
468
|
+
{ "cameras_close", OWL_BUFPTR, OWL_OFFSETOF(AccumulateRayGenData, cameras_close)},
|
|
469
|
+
{ /* sentinel */ }
|
|
470
|
+
};
|
|
471
|
+
const char* ray_gen_name = rendering::raytracing::detail::ray_gen_program_name<SPEC>();
|
|
472
|
+
ray_gen = owlRayGenCreate(context, module, ray_gen_name,
|
|
473
|
+
sizeof(AccumulateRayGenData), ray_gen_vars, -1);
|
|
474
|
+
}
|
|
475
|
+
else if constexpr (SPEC::ENABLE_MOTION_BLUR) {
|
|
476
|
+
OWLVarDecl ray_gen_vars[] = {
|
|
477
|
+
{ "fb_ptr", OWL_BUFPTR, OWL_OFFSETOF(MotionBlurRayGenData, fb_ptr)},
|
|
478
|
+
{ "obs_ptr", OWL_RAW_POINTER, OWL_OFFSETOF(MotionBlurRayGenData, obs_ptr)},
|
|
479
|
+
{ "fb_size", OWL_INT2, OWL_OFFSETOF(MotionBlurRayGenData, fb_size)},
|
|
480
|
+
{ "cam_size", OWL_INT2, OWL_OFFSETOF(MotionBlurRayGenData, cam_size)},
|
|
481
|
+
{ "grid_cols", OWL_INT, OWL_OFFSETOF(MotionBlurRayGenData, grid_cols)},
|
|
482
|
+
{ "num_cameras", OWL_INT, OWL_OFFSETOF(MotionBlurRayGenData, num_cameras)},
|
|
483
|
+
{ "world", OWL_GROUP, OWL_OFFSETOF(MotionBlurRayGenData, world)},
|
|
484
|
+
{ "cameras_open", OWL_BUFPTR, OWL_OFFSETOF(MotionBlurRayGenData, cameras_open)},
|
|
485
|
+
{ "cameras_close", OWL_BUFPTR, OWL_OFFSETOF(MotionBlurRayGenData, cameras_close)},
|
|
486
|
+
{ /* sentinel */ }
|
|
487
|
+
};
|
|
488
|
+
const char* ray_gen_name = rendering::raytracing::detail::ray_gen_program_name<SPEC>();
|
|
489
|
+
ray_gen = owlRayGenCreate(context, module, ray_gen_name,
|
|
490
|
+
sizeof(MotionBlurRayGenData), ray_gen_vars, -1);
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
OWLVarDecl ray_gen_vars[] = {
|
|
494
|
+
{ "fb_ptr", OWL_BUFPTR, OWL_OFFSETOF(RayGenData, fb_ptr)},
|
|
495
|
+
{ "obs_ptr", OWL_RAW_POINTER, OWL_OFFSETOF(RayGenData, obs_ptr)},
|
|
496
|
+
{ "fb_size", OWL_INT2, OWL_OFFSETOF(RayGenData, fb_size)},
|
|
497
|
+
{ "cam_size", OWL_INT2, OWL_OFFSETOF(RayGenData, cam_size)},
|
|
498
|
+
{ "grid_cols", OWL_INT, OWL_OFFSETOF(RayGenData, grid_cols)},
|
|
499
|
+
{ "num_cameras", OWL_INT, OWL_OFFSETOF(RayGenData, num_cameras)},
|
|
500
|
+
{ "world", OWL_GROUP, OWL_OFFSETOF(RayGenData, world)},
|
|
501
|
+
{ "cameras", OWL_BUFPTR, OWL_OFFSETOF(RayGenData, cameras)},
|
|
502
|
+
{ /* sentinel */ }
|
|
503
|
+
};
|
|
504
|
+
const char* ray_gen_name = rendering::raytracing::detail::ray_gen_program_name<SPEC>();
|
|
505
|
+
ray_gen = owlRayGenCreate(context, module, ray_gen_name,
|
|
506
|
+
sizeof(RayGenData), ray_gen_vars, -1);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
OWLRayGen depth_ray_gen = nullptr;
|
|
511
|
+
if constexpr (SPEC::HAS_DEPTH) {
|
|
512
|
+
OWLVarDecl depth_ray_gen_vars[] = {
|
|
513
|
+
{ "depth_ptr", OWL_BUFPTR, OWL_OFFSETOF(DepthRayGenData, depth_ptr)},
|
|
514
|
+
{ "fb_size", OWL_INT2, OWL_OFFSETOF(DepthRayGenData, fb_size)},
|
|
515
|
+
{ "cam_size", OWL_INT2, OWL_OFFSETOF(DepthRayGenData, cam_size)},
|
|
516
|
+
{ "grid_cols", OWL_INT, OWL_OFFSETOF(DepthRayGenData, grid_cols)},
|
|
517
|
+
{ "num_cameras", OWL_INT, OWL_OFFSETOF(DepthRayGenData, num_cameras)},
|
|
518
|
+
{ "world", OWL_GROUP, OWL_OFFSETOF(DepthRayGenData, world)},
|
|
519
|
+
{ "cameras", OWL_BUFPTR, OWL_OFFSETOF(DepthRayGenData, cameras)},
|
|
520
|
+
{ /* sentinel */ }
|
|
521
|
+
};
|
|
522
|
+
depth_ray_gen = owlRayGenCreate(context, module, "depthRayGen",
|
|
523
|
+
sizeof(DepthRayGenData), depth_ray_gen_vars, -1);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
OWLRayGen segmentation_ray_gen = nullptr;
|
|
527
|
+
if constexpr (SPEC::HAS_SEGMENTATION) {
|
|
528
|
+
OWLVarDecl segmentation_ray_gen_vars[] = {
|
|
529
|
+
{ "seg_ptr", OWL_BUFPTR, OWL_OFFSETOF(SegmentationRayGenData, seg_ptr)},
|
|
530
|
+
{ "fb_size", OWL_INT2, OWL_OFFSETOF(SegmentationRayGenData, fb_size)},
|
|
531
|
+
{ "cam_size", OWL_INT2, OWL_OFFSETOF(SegmentationRayGenData, cam_size)},
|
|
532
|
+
{ "grid_cols", OWL_INT, OWL_OFFSETOF(SegmentationRayGenData, grid_cols)},
|
|
533
|
+
{ "num_cameras", OWL_INT, OWL_OFFSETOF(SegmentationRayGenData, num_cameras)},
|
|
534
|
+
{ "world", OWL_GROUP, OWL_OFFSETOF(SegmentationRayGenData, world)},
|
|
535
|
+
{ "cameras", OWL_BUFPTR, OWL_OFFSETOF(SegmentationRayGenData, cameras)},
|
|
536
|
+
{ /* sentinel */ }
|
|
537
|
+
};
|
|
538
|
+
segmentation_ray_gen = owlRayGenCreate(context, module, "segmentationRayGen",
|
|
539
|
+
sizeof(SegmentationRayGenData), segmentation_ray_gen_vars, -1);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
OWLRayGen normals_ray_gen = nullptr;
|
|
543
|
+
if constexpr (SPEC::HAS_NORMALS) {
|
|
544
|
+
OWLVarDecl normals_ray_gen_vars[] = {
|
|
545
|
+
{ "normals_ptr", OWL_BUFPTR, OWL_OFFSETOF(NormalsRayGenData, normals_ptr)},
|
|
546
|
+
{ "fb_size", OWL_INT2, OWL_OFFSETOF(NormalsRayGenData, fb_size)},
|
|
547
|
+
{ "cam_size", OWL_INT2, OWL_OFFSETOF(NormalsRayGenData, cam_size)},
|
|
548
|
+
{ "grid_cols", OWL_INT, OWL_OFFSETOF(NormalsRayGenData, grid_cols)},
|
|
549
|
+
{ "num_cameras", OWL_INT, OWL_OFFSETOF(NormalsRayGenData, num_cameras)},
|
|
550
|
+
{ "world", OWL_GROUP, OWL_OFFSETOF(NormalsRayGenData, world)},
|
|
551
|
+
{ "cameras", OWL_BUFPTR, OWL_OFFSETOF(NormalsRayGenData, cameras)},
|
|
552
|
+
{ /* sentinel */ }
|
|
553
|
+
};
|
|
554
|
+
normals_ray_gen = owlRayGenCreate(context, module, "normalsRayGen",
|
|
555
|
+
sizeof(NormalsRayGenData), normals_ray_gen_vars, -1);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
OWLRayGen flow_ray_gen = nullptr;
|
|
559
|
+
OWLRayGen flow_forward_ray_gen = nullptr;
|
|
560
|
+
if constexpr (SPEC::HAS_FLOW) {
|
|
561
|
+
OWLVarDecl flow_ray_gen_vars[] = {
|
|
562
|
+
{ "flow_ptr", OWL_BUFPTR, OWL_OFFSETOF(FlowRayGenData, flow_ptr)},
|
|
563
|
+
{ "status_ptr", OWL_BUFPTR, OWL_OFFSETOF(FlowRayGenData, status_ptr)},
|
|
564
|
+
{ "fb_size", OWL_INT2, OWL_OFFSETOF(FlowRayGenData, fb_size)},
|
|
565
|
+
{ "cam_size", OWL_INT2, OWL_OFFSETOF(FlowRayGenData, cam_size)},
|
|
566
|
+
{ "grid_cols", OWL_INT, OWL_OFFSETOF(FlowRayGenData, grid_cols)},
|
|
567
|
+
{ "num_cameras", OWL_INT, OWL_OFFSETOF(FlowRayGenData, num_cameras)},
|
|
568
|
+
{ "world", OWL_GROUP, OWL_OFFSETOF(FlowRayGenData, world)},
|
|
569
|
+
{ "cameras_source", OWL_BUFPTR, OWL_OFFSETOF(FlowRayGenData, cameras_source)},
|
|
570
|
+
{ "cameras_target", OWL_BUFPTR, OWL_OFFSETOF(FlowRayGenData, cameras_target)},
|
|
571
|
+
{ "flow_deltas", OWL_RAW_POINTER, OWL_OFFSETOF(FlowRayGenData, flow_deltas)},
|
|
572
|
+
{ "source_first_overlay_instance", OWL_UINT, OWL_OFFSETOF(FlowRayGenData, source_first_overlay_instance)},
|
|
573
|
+
{ "source_previous", OWL_INT, OWL_OFFSETOF(FlowRayGenData, source_previous)},
|
|
574
|
+
{ /* sentinel */ }
|
|
575
|
+
};
|
|
576
|
+
flow_ray_gen = owlRayGenCreate(context, module, "flowRayGen",
|
|
577
|
+
sizeof(FlowRayGenData), flow_ray_gen_vars, -1);
|
|
578
|
+
if constexpr (SPEC::HAS_FLOW_FORWARD) {
|
|
579
|
+
flow_forward_ray_gen = owlRayGenCreate(context, module, "flowForwardRayGen",
|
|
580
|
+
sizeof(FlowRayGenData), flow_ray_gen_vars, -1);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
const owl2i fb_size = {(int)SPEC::FB_WIDTH, (int)SPEC::FB_HEIGHT};
|
|
585
|
+
const owl2i cam_size = {(int)SPEC::CAM_WIDTH, (int)SPEC::CAM_HEIGHT};
|
|
586
|
+
|
|
587
|
+
if constexpr (SPEC::HAS_RGB) {
|
|
588
|
+
if constexpr (SPEC::ENABLE_DYNAMIC_MOTION_BLUR) {
|
|
589
|
+
owlRayGenSetPointer(ray_gen, "accum_ptr", owlBufferGetPointer(rgb_accumulator_buffer, 0));
|
|
590
|
+
owlRayGenSetPointer(ray_gen, "shutter_ptr", renderer.backend->shutter_device);
|
|
591
|
+
}
|
|
592
|
+
else {
|
|
593
|
+
owlRayGenSetBuffer(ray_gen, "fb_ptr", frame_buffer);
|
|
594
|
+
owlRayGenSetPointer(ray_gen, "obs_ptr", SPEC::HAS_OBSERVATION ? owlBufferGetPointer(observation_buffer, 0) : nullptr);
|
|
595
|
+
}
|
|
596
|
+
owlRayGenSet2i (ray_gen, "fb_size", fb_size);
|
|
597
|
+
owlRayGenSet2i (ray_gen, "cam_size", cam_size);
|
|
598
|
+
owlRayGenSet1i (ray_gen, "grid_cols", SPEC::GRID_COLS);
|
|
599
|
+
owlRayGenSet1i (ray_gen, "num_cameras", SPEC::NUM_CAMERAS);
|
|
600
|
+
}
|
|
601
|
+
if constexpr (SPEC::HAS_SEGMENTATION) {
|
|
602
|
+
owlRayGenSetBuffer(segmentation_ray_gen, "seg_ptr", segmentation_buffer);
|
|
603
|
+
owlRayGenSet2i (segmentation_ray_gen, "fb_size", fb_size);
|
|
604
|
+
owlRayGenSet2i (segmentation_ray_gen, "cam_size", cam_size);
|
|
605
|
+
owlRayGenSet1i (segmentation_ray_gen, "grid_cols", SPEC::GRID_COLS);
|
|
606
|
+
owlRayGenSet1i (segmentation_ray_gen, "num_cameras", SPEC::NUM_CAMERAS);
|
|
607
|
+
renderer.backend->segmentation_ray_gen = segmentation_ray_gen;
|
|
608
|
+
renderer.backend->segmentation_buffer = segmentation_buffer;
|
|
609
|
+
}
|
|
610
|
+
if constexpr (SPEC::HAS_NORMALS) {
|
|
611
|
+
owlRayGenSetBuffer(normals_ray_gen, "normals_ptr", normals_buffer);
|
|
612
|
+
owlRayGenSet2i (normals_ray_gen, "fb_size", fb_size);
|
|
613
|
+
owlRayGenSet2i (normals_ray_gen, "cam_size", cam_size);
|
|
614
|
+
owlRayGenSet1i (normals_ray_gen, "grid_cols", SPEC::GRID_COLS);
|
|
615
|
+
owlRayGenSet1i (normals_ray_gen, "num_cameras", SPEC::NUM_CAMERAS);
|
|
616
|
+
renderer.backend->normals_ray_gen = normals_ray_gen;
|
|
617
|
+
renderer.backend->normals_buffer = normals_buffer;
|
|
618
|
+
}
|
|
619
|
+
if constexpr (SPEC::HAS_FLOW) {
|
|
620
|
+
constexpr size_t FLOW_SLOTS = SPEC::ENABLE_OVERLAYS ? (size_t)SPEC::NUM_OVERLAYS * SPEC::MAX_OVERLAY_INSTANCES : 0;
|
|
621
|
+
const OWLRayGen flow_ray_gens[2] = {flow_ray_gen, flow_forward_ray_gen};
|
|
622
|
+
const OWLBuffer flow_buffers[2] = {flow_buffer, flow_forward_buffer};
|
|
623
|
+
const OWLBuffer status_buffers[2] = {flow_status_buffer, flow_forward_status_buffer};
|
|
624
|
+
for(int direction = 0; direction < 2; direction++){
|
|
625
|
+
if(flow_ray_gens[direction] == nullptr) continue;
|
|
626
|
+
owlRayGenSetBuffer(flow_ray_gens[direction], "flow_ptr", flow_buffers[direction]);
|
|
627
|
+
owlRayGenSetBuffer(flow_ray_gens[direction], "status_ptr", status_buffers[direction]);
|
|
628
|
+
owlRayGenSet2i (flow_ray_gens[direction], "fb_size", fb_size);
|
|
629
|
+
owlRayGenSet2i (flow_ray_gens[direction], "cam_size", cam_size);
|
|
630
|
+
owlRayGenSet1i (flow_ray_gens[direction], "grid_cols", SPEC::GRID_COLS);
|
|
631
|
+
owlRayGenSet1i (flow_ray_gens[direction], "num_cameras", SPEC::NUM_CAMERAS);
|
|
632
|
+
owlRayGenSetPointer(flow_ray_gens[direction], "flow_deltas", flow_deltas_buffer != nullptr ? (const float*)owlBufferGetPointer(flow_deltas_buffer, 0) + (size_t)direction * FLOW_SLOTS * 12 : nullptr);
|
|
633
|
+
owlRayGenSet1ui (flow_ray_gens[direction], "source_first_overlay_instance", 0u); // scene-dependent: rebound in init_renderer_scene before the SBT build
|
|
634
|
+
owlRayGenSet1i (flow_ray_gens[direction], "source_previous", direction);
|
|
635
|
+
}
|
|
636
|
+
renderer.backend->flow_ray_gen = flow_ray_gen;
|
|
637
|
+
renderer.backend->flow_forward_ray_gen = flow_forward_ray_gen;
|
|
638
|
+
renderer.backend->flow_buffer = flow_buffer;
|
|
639
|
+
renderer.backend->flow_status_buffer = flow_status_buffer;
|
|
640
|
+
renderer.backend->flow_forward_buffer = flow_forward_buffer;
|
|
641
|
+
renderer.backend->flow_forward_status_buffer = flow_forward_status_buffer;
|
|
642
|
+
}
|
|
643
|
+
if constexpr (SPEC::HAS_DEPTH) {
|
|
644
|
+
owlRayGenSetBuffer(depth_ray_gen, "depth_ptr", depth_buffer);
|
|
645
|
+
owlRayGenSet2i (depth_ray_gen, "fb_size", fb_size);
|
|
646
|
+
owlRayGenSet2i (depth_ray_gen, "cam_size", cam_size);
|
|
647
|
+
owlRayGenSet1i (depth_ray_gen, "grid_cols", SPEC::GRID_COLS);
|
|
648
|
+
owlRayGenSet1i (depth_ray_gen, "num_cameras", SPEC::NUM_CAMERAS);
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
// The raygen-referenced buffers are created here so every raygen variable is set before
|
|
652
|
+
// init builds the SBT: OWL serializes raygen variables into the SBT records only during
|
|
653
|
+
// owlBuildSBT, so anything set later would be baked in as null.
|
|
654
|
+
OWLBuffer cameras_buffer = owlDeviceBufferCreate(context, OWL_USER_TYPE(OptixCameraData), SPEC::NUM_CAMERAS, nullptr);
|
|
655
|
+
// device-resident camera input (see cameras(device, renderer)): the tensors alias the
|
|
656
|
+
// OWL buffers the ray gens bind, so producer writes are consumed with no copy
|
|
657
|
+
renderer.cameras._data = (rendering::raytracing::Camera<typename SPEC::T>*)owlBufferGetPointer(cameras_buffer, 0);
|
|
658
|
+
OWLBuffer cameras_open_buffer = nullptr;
|
|
659
|
+
if constexpr (SPEC::HAS_CAMERA_PAIR) {
|
|
660
|
+
cameras_open_buffer = owlDeviceBufferCreate(context, OWL_USER_TYPE(OptixCameraData), SPEC::NUM_CAMERAS, nullptr);
|
|
661
|
+
renderer.backend->cameras_open_buffer = cameras_open_buffer;
|
|
662
|
+
renderer.cameras_open._data = (rendering::raytracing::Camera<typename SPEC::T>*)owlBufferGetPointer(cameras_open_buffer, 0);
|
|
663
|
+
}
|
|
664
|
+
if constexpr (SPEC::HAS_RGB) {
|
|
665
|
+
if constexpr (SPEC::ENABLE_MOTION_BLUR) {
|
|
666
|
+
owlRayGenSetBuffer(ray_gen, "cameras_open", cameras_open_buffer);
|
|
667
|
+
owlRayGenSetBuffer(ray_gen, "cameras_close", cameras_buffer);
|
|
668
|
+
}
|
|
669
|
+
else {
|
|
670
|
+
owlRayGenSetBuffer(ray_gen, "cameras", cameras_buffer);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
if constexpr (SPEC::HAS_DEPTH) {
|
|
674
|
+
owlRayGenSetBuffer(depth_ray_gen, "cameras", cameras_buffer);
|
|
675
|
+
}
|
|
676
|
+
if constexpr (SPEC::HAS_SEGMENTATION) {
|
|
677
|
+
owlRayGenSetBuffer(segmentation_ray_gen, "cameras", cameras_buffer);
|
|
678
|
+
}
|
|
679
|
+
if constexpr (SPEC::HAS_NORMALS) {
|
|
680
|
+
owlRayGenSetBuffer(normals_ray_gen, "cameras", cameras_buffer);
|
|
681
|
+
}
|
|
682
|
+
if constexpr (SPEC::HAS_FLOW) {
|
|
683
|
+
OWLBuffer cameras_previous_buffer = owlDeviceBufferCreate(context, OWL_USER_TYPE(OptixCameraData), SPEC::NUM_CAMERAS, nullptr);
|
|
684
|
+
renderer.backend->cameras_previous_buffer = cameras_previous_buffer;
|
|
685
|
+
renderer.cameras_previous._data = (rendering::raytracing::Camera<typename SPEC::T>*)owlBufferGetPointer(cameras_previous_buffer, 0);
|
|
686
|
+
owlRayGenSetBuffer(flow_ray_gen, "cameras_source", cameras_buffer);
|
|
687
|
+
owlRayGenSetBuffer(flow_ray_gen, "cameras_target", cameras_previous_buffer);
|
|
688
|
+
if constexpr (SPEC::HAS_FLOW_FORWARD) {
|
|
689
|
+
owlRayGenSetBuffer(flow_forward_ray_gen, "cameras_source", cameras_previous_buffer);
|
|
690
|
+
owlRayGenSetBuffer(flow_forward_ray_gen, "cameras_target", cameras_buffer);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
renderer.backend->context = context;
|
|
695
|
+
renderer.backend->module = module;
|
|
696
|
+
renderer.backend->cameras_buffer = cameras_buffer;
|
|
697
|
+
if constexpr (SPEC::HAS_RGB) {
|
|
698
|
+
renderer.backend->ray_gen = ray_gen;
|
|
699
|
+
renderer.backend->frame_buffer = frame_buffer;
|
|
700
|
+
}
|
|
701
|
+
if constexpr (SPEC::HAS_DEPTH) {
|
|
702
|
+
renderer.backend->depth_ray_gen = depth_ray_gen;
|
|
703
|
+
renderer.backend->depth_buffer = depth_buffer;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
#if !RL_TOOLS_RENDERING_RAYTRACING_DISABLE_PROBE_RAYS
|
|
707
|
+
OWLVarDecl collision_ray_gen_vars[] = {
|
|
708
|
+
{ "results", OWL_BUFPTR, OWL_OFFSETOF(CollisionRayGenData, results)},
|
|
709
|
+
{ "probe_directions", OWL_BUFPTR, OWL_OFFSETOF(CollisionRayGenData, probe_directions)},
|
|
710
|
+
{ "cameras", OWL_BUFPTR, OWL_OFFSETOF(CollisionRayGenData, cameras)},
|
|
711
|
+
{ "world", OWL_GROUP, OWL_OFFSETOF(CollisionRayGenData, world)},
|
|
712
|
+
{ "num_probes", OWL_INT, OWL_OFFSETOF(CollisionRayGenData, num_probes)},
|
|
713
|
+
{ "num_cameras", OWL_INT, OWL_OFFSETOF(CollisionRayGenData, num_cameras)},
|
|
714
|
+
{ "max_dist", OWL_FLOAT, OWL_OFFSETOF(CollisionRayGenData, max_dist)},
|
|
715
|
+
{ /* sentinel */ }
|
|
716
|
+
};
|
|
717
|
+
OWLRayGen collision_ray_gen = owlRayGenCreate(context, module, "collisionRayGen",
|
|
718
|
+
sizeof(CollisionRayGenData),
|
|
719
|
+
collision_ray_gen_vars, -1);
|
|
720
|
+
|
|
721
|
+
// device-resident (was host-pinned, which cost a PCIe write per probe launch): device
|
|
722
|
+
// consumers read collision_results(device, renderer) in place, host readers copy
|
|
723
|
+
OWLBuffer collision_results_buffer = owlDeviceBufferCreate(context, OWL_USER_TYPE(CollisionResult),
|
|
724
|
+
(size_t)SPEC::NUM_CAMERAS * SPEC::NUM_PROBES, nullptr);
|
|
725
|
+
renderer.collision_results._data = (rendering::raytracing::CollisionResult*)owlBufferGetPointer(collision_results_buffer, 0);
|
|
726
|
+
OWLBuffer probe_dirs_buffer = owlDeviceBufferCreate(context, OWL_USER_TYPE(owl::vec3f), SPEC::NUM_PROBES, nullptr);
|
|
727
|
+
|
|
728
|
+
owlRayGenSetBuffer(collision_ray_gen, "results", collision_results_buffer);
|
|
729
|
+
owlRayGenSetBuffer(collision_ray_gen, "probe_directions", probe_dirs_buffer);
|
|
730
|
+
owlRayGenSetBuffer(collision_ray_gen, "cameras", cameras_buffer);
|
|
731
|
+
owlRayGenSet1i (collision_ray_gen, "num_probes", SPEC::NUM_PROBES);
|
|
732
|
+
owlRayGenSet1i (collision_ray_gen, "num_cameras", SPEC::NUM_CAMERAS);
|
|
733
|
+
owlRayGenSet1f (collision_ray_gen, "max_dist", 1e30f);
|
|
734
|
+
|
|
735
|
+
renderer.backend->collision_ray_gen = collision_ray_gen;
|
|
736
|
+
renderer.backend->collision_results_buffer = collision_results_buffer;
|
|
737
|
+
renderer.backend->probe_dirs_buffer = probe_dirs_buffer;
|
|
738
|
+
#endif
|
|
739
|
+
rendering::raytracing::detail::announce_backend(device, renderer);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
template <typename DEVICE, typename SPEC>
|
|
744
|
+
void malloc(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
745
|
+
namespace optix = rendering::raytracing::backends::optix;
|
|
746
|
+
renderer.backend = new rendering::raytracing::backends::RendererState<rendering::raytracing::backends::Optix, SPEC>{};
|
|
747
|
+
renderer.device.state = renderer.backend;
|
|
748
|
+
cudaEventCreateWithFlags(&renderer.backend->ordering_event, cudaEventDisableTiming);
|
|
749
|
+
OWLContext context = nullptr;
|
|
750
|
+
OWLModule module = nullptr;
|
|
751
|
+
OWLMissProg miss_prog = nullptr;
|
|
752
|
+
optix::create_context_resources<SPEC>(context, module, miss_prog);
|
|
753
|
+
renderer.backend->miss_prog = miss_prog;
|
|
754
|
+
optix::detail::malloc_renderer(device, renderer, context, module);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
// shared-library mode: the library owns the context; the renderer allocates only its own
|
|
758
|
+
// cameras/outputs/ray gens against it
|
|
759
|
+
template <typename DEVICE, typename SPEC>
|
|
760
|
+
void malloc(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer, rendering::raytracing::AssetLibrary<SPEC, rendering::raytracing::backends::Optix>& library){
|
|
761
|
+
namespace optix = rendering::raytracing::backends::optix;
|
|
762
|
+
renderer.backend = new rendering::raytracing::backends::RendererState<rendering::raytracing::backends::Optix, SPEC>{};
|
|
763
|
+
renderer.device.state = renderer.backend;
|
|
764
|
+
cudaEventCreateWithFlags(&renderer.backend->ordering_event, cudaEventDisableTiming);
|
|
765
|
+
optix::detail::malloc_renderer(device, renderer, library.backend->context, library.backend->module);
|
|
766
|
+
renderer.backend->miss_prog = library.backend->miss_prog;
|
|
767
|
+
renderer.backend->library = &library;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
template <typename DEVICE, typename SPEC>
|
|
771
|
+
void malloc(DEVICE& device, rendering::raytracing::AssetLibrary<SPEC, rendering::raytracing::backends::Optix>& library){
|
|
772
|
+
library.backend = new rendering::raytracing::backends::LibraryState<rendering::raytracing::backends::Optix, SPEC>{};
|
|
773
|
+
rendering::raytracing::backends::optix::create_context_resources<SPEC>(library.backend->context, library.backend->module, library.backend->miss_prog);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
template <typename DEVICE, typename SPEC>
|
|
777
|
+
void free(DEVICE& device, rendering::raytracing::AssetLibrary<SPEC, rendering::raytracing::backends::Optix>& library){
|
|
778
|
+
if(library.backend != nullptr && library.backend->context != nullptr){
|
|
779
|
+
owlContextDestroy(library.backend->context);
|
|
780
|
+
}
|
|
781
|
+
for(auto* assets : library.assets){
|
|
782
|
+
delete assets;
|
|
783
|
+
}
|
|
784
|
+
library.assets.clear();
|
|
785
|
+
library.scenes.clear();
|
|
786
|
+
library.metadata.clear();
|
|
787
|
+
delete library.backend;
|
|
788
|
+
library.backend = nullptr;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
// =========================================================================
|
|
792
|
+
// init: upload meshes, build single shared BVH, build programs/pipeline/SBT
|
|
793
|
+
// =========================================================================
|
|
794
|
+
namespace rendering::raytracing::backends::optix::detail{
|
|
795
|
+
template <typename SPEC>
|
|
796
|
+
OWLGeomType create_geom_type(OWLContext context, OWLModule module){
|
|
797
|
+
OWLGeomType triangles_geom_type;
|
|
798
|
+
if constexpr (SPEC::HAS_RGB) {
|
|
799
|
+
if constexpr (SPEC::SHADING::PBR_SHADING) {
|
|
800
|
+
OWLVarDecl triangles_geom_vars[] = {
|
|
801
|
+
{ "index", OWL_BUFPTR, OWL_OFFSETOF(TrianglesGeomData, index)},
|
|
802
|
+
{ "vertex", OWL_BUFPTR, OWL_OFFSETOF(TrianglesGeomData, vertex)},
|
|
803
|
+
{ "tex_coord", OWL_BUFPTR, OWL_OFFSETOF(TrianglesGeomData, tex_coord)},
|
|
804
|
+
{ "color", OWL_FLOAT3, OWL_OFFSETOF(TrianglesGeomData, color)},
|
|
805
|
+
{ "texture", OWL_TEXTURE, OWL_OFFSETOF(TrianglesGeomData, texture)},
|
|
806
|
+
{ "has_texture", OWL_INT, OWL_OFFSETOF(TrianglesGeomData, has_texture)},
|
|
807
|
+
{ "unlit", OWL_INT, OWL_OFFSETOF(TrianglesGeomData, unlit)},
|
|
808
|
+
{ "metallic", OWL_FLOAT, OWL_OFFSETOF(TrianglesGeomData, metallic)},
|
|
809
|
+
{ "world", OWL_GROUP, OWL_OFFSETOF(TrianglesGeomData, world)},
|
|
810
|
+
{ "normal", OWL_BUFPTR, OWL_OFFSETOF(TrianglesGeomData, normal)},
|
|
811
|
+
{ "roughness", OWL_FLOAT, OWL_OFFSETOF(TrianglesGeomData, roughness)},
|
|
812
|
+
{ "normal_map", OWL_TEXTURE, OWL_OFFSETOF(TrianglesGeomData, normal_map)},
|
|
813
|
+
{ "has_normal_map", OWL_INT, OWL_OFFSETOF(TrianglesGeomData, has_normal_map)},
|
|
814
|
+
{ "metallic_roughness_map", OWL_TEXTURE, OWL_OFFSETOF(TrianglesGeomData, metallic_roughness_map)},
|
|
815
|
+
{ "has_metallic_roughness_map", OWL_INT, OWL_OFFSETOF(TrianglesGeomData, has_metallic_roughness_map)},
|
|
816
|
+
{ "emissive", OWL_FLOAT3, OWL_OFFSETOF(TrianglesGeomData, emissive)},
|
|
817
|
+
{ "emissive_map", OWL_TEXTURE, OWL_OFFSETOF(TrianglesGeomData, emissive_map)},
|
|
818
|
+
{ "has_emissive_map", OWL_INT, OWL_OFFSETOF(TrianglesGeomData, has_emissive_map)},
|
|
819
|
+
{ "occlusion_map", OWL_TEXTURE, OWL_OFFSETOF(TrianglesGeomData, occlusion_map)},
|
|
820
|
+
{ "has_occlusion_map", OWL_INT, OWL_OFFSETOF(TrianglesGeomData, has_occlusion_map)},
|
|
821
|
+
{ "opacity", OWL_FLOAT, OWL_OFFSETOF(TrianglesGeomData, opacity)},
|
|
822
|
+
{ "alpha_mode", OWL_INT, OWL_OFFSETOF(TrianglesGeomData, alpha_mode)},
|
|
823
|
+
{ "alpha_cutoff", OWL_FLOAT, OWL_OFFSETOF(TrianglesGeomData, alpha_cutoff)},
|
|
824
|
+
{ "scene_lights", OWL_BUFPTR, OWL_OFFSETOF(TrianglesGeomData, scene_lights)},
|
|
825
|
+
{ "num_scene_lights", OWL_INT, OWL_OFFSETOF(TrianglesGeomData, num_scene_lights)},
|
|
826
|
+
{ "ambient_color", OWL_FLOAT3, OWL_OFFSETOF(TrianglesGeomData, ambient_color)},
|
|
827
|
+
{ /* sentinel */ }
|
|
828
|
+
};
|
|
829
|
+
triangles_geom_type = owlGeomTypeCreate(context, OWL_TRIANGLES,
|
|
830
|
+
sizeof(TrianglesGeomData),
|
|
831
|
+
triangles_geom_vars, -1);
|
|
832
|
+
owlGeomTypeSetClosestHit(triangles_geom_type, 0, module, rendering::raytracing::detail::closest_hit_program_name<SPEC>());
|
|
833
|
+
} else {
|
|
834
|
+
using SHADING_USAGE = rendering::raytracing::detail::MediumShadingUsage<SPEC>;
|
|
835
|
+
std::vector<OWLVarDecl> triangles_geom_vars;
|
|
836
|
+
if constexpr (SHADING_USAGE::USES_INDEX || SPEC::HAS_NORMALS) {
|
|
837
|
+
triangles_geom_vars.push_back({ "index", OWL_BUFPTR, OWL_OFFSETOF(TrianglesGeomData, index)});
|
|
838
|
+
}
|
|
839
|
+
if constexpr (SHADING_USAGE::USES_VERTEX || SPEC::HAS_NORMALS) {
|
|
840
|
+
triangles_geom_vars.push_back({ "vertex", OWL_BUFPTR, OWL_OFFSETOF(TrianglesGeomData, vertex)});
|
|
841
|
+
}
|
|
842
|
+
if constexpr (SHADING_USAGE::USES_TEXTURE) {
|
|
843
|
+
triangles_geom_vars.push_back({ "tex_coord", OWL_BUFPTR, OWL_OFFSETOF(TrianglesGeomData, tex_coord)});
|
|
844
|
+
}
|
|
845
|
+
triangles_geom_vars.push_back({ "color", OWL_FLOAT3, OWL_OFFSETOF(TrianglesGeomData, color)});
|
|
846
|
+
triangles_geom_vars.push_back({ "unlit", OWL_INT, OWL_OFFSETOF(TrianglesGeomData, unlit)});
|
|
847
|
+
if constexpr (SHADING_USAGE::USES_TEXTURE) {
|
|
848
|
+
triangles_geom_vars.push_back({ "texture", OWL_TEXTURE, OWL_OFFSETOF(TrianglesGeomData, texture)});
|
|
849
|
+
triangles_geom_vars.push_back({ "has_texture", OWL_INT, OWL_OFFSETOF(TrianglesGeomData, has_texture)});
|
|
850
|
+
}
|
|
851
|
+
if constexpr (SPEC::SHADING::METALLIC_REFLECTIONS) {
|
|
852
|
+
triangles_geom_vars.push_back({ "metallic", OWL_FLOAT, OWL_OFFSETOF(TrianglesGeomData, metallic)});
|
|
853
|
+
}
|
|
854
|
+
if constexpr (SHADING_USAGE::USES_WORLD) {
|
|
855
|
+
triangles_geom_vars.push_back({ "world", OWL_GROUP, OWL_OFFSETOF(TrianglesGeomData, world)});
|
|
856
|
+
}
|
|
857
|
+
triangles_geom_vars.push_back({});
|
|
858
|
+
triangles_geom_type = owlGeomTypeCreate(context, OWL_TRIANGLES,
|
|
859
|
+
sizeof(TrianglesGeomData),
|
|
860
|
+
triangles_geom_vars.data(), -1);
|
|
861
|
+
owlGeomTypeSetClosestHit(triangles_geom_type, 0, module, rendering::raytracing::detail::closest_hit_program_name<SPEC>());
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
else if constexpr (SPEC::HAS_NORMALS) {
|
|
865
|
+
OWLVarDecl triangles_geom_vars[] = {
|
|
866
|
+
{ "index", OWL_BUFPTR, OWL_OFFSETOF(TrianglesGeomData, index)},
|
|
867
|
+
{ "vertex", OWL_BUFPTR, OWL_OFFSETOF(TrianglesGeomData, vertex)},
|
|
868
|
+
{ /* sentinel */ }
|
|
869
|
+
};
|
|
870
|
+
triangles_geom_type = owlGeomTypeCreate(context, OWL_TRIANGLES,
|
|
871
|
+
sizeof(TrianglesGeomData),
|
|
872
|
+
triangles_geom_vars, -1);
|
|
873
|
+
}
|
|
874
|
+
else {
|
|
875
|
+
OWLVarDecl triangles_geom_vars[] = {
|
|
876
|
+
{ /* sentinel */ }
|
|
877
|
+
};
|
|
878
|
+
triangles_geom_type = owlGeomTypeCreate(context, OWL_TRIANGLES,
|
|
879
|
+
sizeof(CollisionGeomData),
|
|
880
|
+
triangles_geom_vars, -1);
|
|
881
|
+
}
|
|
882
|
+
owlGeomTypeSetClosestHit(triangles_geom_type, 1, module, "collisionHit");
|
|
883
|
+
if constexpr (SPEC::HAS_NORMALS) {
|
|
884
|
+
owlGeomTypeSetClosestHit(triangles_geom_type, 2, module, "normalsHit");
|
|
885
|
+
}
|
|
886
|
+
return triangles_geom_type;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
// scene objects (and pool assets) all become the same all_objects order everywhere —
|
|
890
|
+
// part of the deterministic global instance-id layout
|
|
891
|
+
inline void collect_all_objects(const rendering::raytracing::Scene& scene, const rendering::raytracing::AssetPool& pool, std::vector<const rendering::raytracing::Object*>& all_objects){
|
|
892
|
+
all_objects.clear();
|
|
893
|
+
for(const auto& object : scene.objects){
|
|
894
|
+
all_objects.push_back(&object);
|
|
895
|
+
}
|
|
896
|
+
for(const auto& assembly : pool.assemblies){
|
|
897
|
+
for(const auto& object : assembly.objects){
|
|
898
|
+
all_objects.push_back(&object);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
// one geometry/texture/BLAS build per unique scene: standalone renderers build into
|
|
904
|
+
// their own context, shared-library renderers reference the library's single build
|
|
905
|
+
template <typename DEVICE, typename SPEC>
|
|
906
|
+
void build_scene_assets(DEVICE& device, OWLContext context, OWLGeomType triangles_geom_type, const rendering::raytracing::Scene& scene, const std::vector<const rendering::raytracing::Object*>& all_objects, rendering::raytracing::backends::SceneState<rendering::raytracing::backends::Optix, SPEC>& assets){
|
|
907
|
+
namespace optix = rendering::raytracing::backends::optix;
|
|
908
|
+
log(device, device.logger, devices::logging::Verbosity::debug, rendering::raytracing::LOG_PREFIX, "building ", scene.objects.size(), " object(s), ", scene.instances.size(), " instance(s), ", (all_objects.size() - scene.objects.size()), " pool object(s) ...");
|
|
909
|
+
// ambient is baked per geometry, so it resolves at build time from the scene the
|
|
910
|
+
// build belongs to (per unique scene in library mode)
|
|
911
|
+
typename SPEC::T environment_ambient[3], environment_miss_0[3], environment_miss_1[3];
|
|
912
|
+
rendering::raytracing::detail::resolve_environment<SPEC>(scene.environment, environment_ambient, environment_miss_0, environment_miss_1);
|
|
913
|
+
(void)environment_miss_0; (void)environment_miss_1;
|
|
914
|
+
|
|
915
|
+
std::vector<OWLGeom> geoms;
|
|
916
|
+
std::vector<OWLGroup> object_groups;
|
|
917
|
+
for(size_t object_i = 0; object_i < all_objects.size(); object_i++){
|
|
918
|
+
std::vector<OWLGeom> object_geoms;
|
|
919
|
+
for(const auto& md : all_objects[object_i]->meshes){
|
|
920
|
+
size_t num_vertices = md.vertices.size() / 3;
|
|
921
|
+
size_t num_indices = md.indices.size() / 3;
|
|
922
|
+
|
|
923
|
+
OWLBuffer vb = owlDeviceBufferCreate(context, OWL_FLOAT3, num_vertices, md.vertices.data());
|
|
924
|
+
OWLBuffer ib = owlDeviceBufferCreate(context, OWL_INT3, num_indices, md.indices.data());
|
|
925
|
+
|
|
926
|
+
OWLGeom geom = owlGeomCreate(context, triangles_geom_type);
|
|
927
|
+
owlTrianglesSetVertices(geom, vb, num_vertices, sizeof(owl::vec3f), 0);
|
|
928
|
+
owlTrianglesSetIndices(geom, ib, num_indices, sizeof(owl::vec3i), 0);
|
|
929
|
+
{
|
|
930
|
+
using SHADING_USAGE = rendering::raytracing::detail::MediumShadingUsage<SPEC>;
|
|
931
|
+
if constexpr ((SPEC::HAS_RGB && (SPEC::SHADING::PBR_SHADING || SHADING_USAGE::USES_VERTEX)) || SPEC::HAS_NORMALS) {
|
|
932
|
+
owlGeomSetBuffer(geom, "vertex", vb);
|
|
933
|
+
}
|
|
934
|
+
if constexpr ((SPEC::HAS_RGB && (SPEC::SHADING::PBR_SHADING || SHADING_USAGE::USES_INDEX)) || SPEC::HAS_NORMALS) {
|
|
935
|
+
owlGeomSetBuffer(geom, "index", ib);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
if constexpr (SPEC::HAS_RGB) {
|
|
939
|
+
owlGeomSet3f(geom, "color", owl3f{md.color[0], md.color[1], md.color[2]});
|
|
940
|
+
owlGeomSet1i(geom, "unlit", md.unlit);
|
|
941
|
+
|
|
942
|
+
if constexpr (SPEC::SHADING::PBR_SHADING || SPEC::SHADING::LOAD_TEXTURES) {
|
|
943
|
+
if(!md.tex_coords.empty()){
|
|
944
|
+
size_t num_tc = md.tex_coords.size() / 2;
|
|
945
|
+
OWLBuffer tcb = owlDeviceBufferCreate(context, OWL_FLOAT2, num_tc, md.tex_coords.data());
|
|
946
|
+
owlGeomSetBuffer(geom, "tex_coord", tcb);
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
if(md.texture.present()){
|
|
950
|
+
OWLTexture tex = owlTexture2DCreate(context,
|
|
951
|
+
OWL_TEXEL_FORMAT_RGBA8,
|
|
952
|
+
md.texture.width, md.texture.height,
|
|
953
|
+
md.texture.pixels->data(),
|
|
954
|
+
OWL_TEXTURE_LINEAR,
|
|
955
|
+
OWL_TEXTURE_WRAP,
|
|
956
|
+
OWL_TEXTURE_WRAP,
|
|
957
|
+
OWL_COLOR_SPACE_SRGB);
|
|
958
|
+
owlGeomSetTexture(geom, "texture", tex);
|
|
959
|
+
owlGeomSet1i(geom, "has_texture", 1);
|
|
960
|
+
} else {
|
|
961
|
+
owlGeomSet1i(geom, "has_texture", 0);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
if constexpr (SPEC::SHADING::PBR_SHADING || SPEC::SHADING::METALLIC_REFLECTIONS) {
|
|
966
|
+
owlGeomSet1f(geom, "metallic", md.metallic);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
if constexpr (SPEC::SHADING::PBR_SHADING) {
|
|
970
|
+
if (!md.normals.empty()) {
|
|
971
|
+
size_t num_normals = md.normals.size() / 3;
|
|
972
|
+
OWLBuffer nb = owlDeviceBufferCreate(context, OWL_FLOAT3, num_normals, md.normals.data());
|
|
973
|
+
owlGeomSetBuffer(geom, "normal", nb);
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
owlGeomSet1f(geom, "roughness", md.roughness);
|
|
977
|
+
|
|
978
|
+
if (md.normal_map.present()) {
|
|
979
|
+
OWLTexture nm_tex = owlTexture2DCreate(context,
|
|
980
|
+
OWL_TEXEL_FORMAT_RGBA8,
|
|
981
|
+
md.normal_map.width, md.normal_map.height,
|
|
982
|
+
md.normal_map.pixels->data(),
|
|
983
|
+
OWL_TEXTURE_LINEAR,
|
|
984
|
+
OWL_TEXTURE_WRAP,
|
|
985
|
+
OWL_TEXTURE_WRAP,
|
|
986
|
+
OWL_COLOR_SPACE_LINEAR);
|
|
987
|
+
owlGeomSetTexture(geom, "normal_map", nm_tex);
|
|
988
|
+
owlGeomSet1i(geom, "has_normal_map", 1);
|
|
989
|
+
} else {
|
|
990
|
+
owlGeomSet1i(geom, "has_normal_map", 0);
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
if (md.metallic_roughness_map.present()) {
|
|
994
|
+
OWLTexture mr_tex = owlTexture2DCreate(context,
|
|
995
|
+
OWL_TEXEL_FORMAT_RGBA8,
|
|
996
|
+
md.metallic_roughness_map.width, md.metallic_roughness_map.height,
|
|
997
|
+
md.metallic_roughness_map.pixels->data(),
|
|
998
|
+
OWL_TEXTURE_LINEAR,
|
|
999
|
+
OWL_TEXTURE_WRAP,
|
|
1000
|
+
OWL_TEXTURE_WRAP,
|
|
1001
|
+
OWL_COLOR_SPACE_LINEAR);
|
|
1002
|
+
owlGeomSetTexture(geom, "metallic_roughness_map", mr_tex);
|
|
1003
|
+
owlGeomSet1i(geom, "has_metallic_roughness_map", 1);
|
|
1004
|
+
} else {
|
|
1005
|
+
owlGeomSet1i(geom, "has_metallic_roughness_map", 0);
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
owlGeomSet3f(geom, "emissive", owl3f{md.emissive[0], md.emissive[1], md.emissive[2]});
|
|
1009
|
+
if (md.emissive_map.present()) {
|
|
1010
|
+
OWLTexture em_tex = owlTexture2DCreate(context,
|
|
1011
|
+
OWL_TEXEL_FORMAT_RGBA8,
|
|
1012
|
+
md.emissive_map.width, md.emissive_map.height,
|
|
1013
|
+
md.emissive_map.pixels->data(),
|
|
1014
|
+
OWL_TEXTURE_LINEAR,
|
|
1015
|
+
OWL_TEXTURE_WRAP,
|
|
1016
|
+
OWL_TEXTURE_WRAP,
|
|
1017
|
+
OWL_COLOR_SPACE_SRGB);
|
|
1018
|
+
owlGeomSetTexture(geom, "emissive_map", em_tex);
|
|
1019
|
+
owlGeomSet1i(geom, "has_emissive_map", 1);
|
|
1020
|
+
} else {
|
|
1021
|
+
owlGeomSet1i(geom, "has_emissive_map", 0);
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
if (md.occlusion_map.present()) {
|
|
1025
|
+
OWLTexture ao_tex = owlTexture2DCreate(context,
|
|
1026
|
+
OWL_TEXEL_FORMAT_RGBA8,
|
|
1027
|
+
md.occlusion_map.width, md.occlusion_map.height,
|
|
1028
|
+
md.occlusion_map.pixels->data(),
|
|
1029
|
+
OWL_TEXTURE_LINEAR,
|
|
1030
|
+
OWL_TEXTURE_WRAP,
|
|
1031
|
+
OWL_TEXTURE_WRAP,
|
|
1032
|
+
OWL_COLOR_SPACE_LINEAR);
|
|
1033
|
+
owlGeomSetTexture(geom, "occlusion_map", ao_tex);
|
|
1034
|
+
owlGeomSet1i(geom, "has_occlusion_map", 1);
|
|
1035
|
+
} else {
|
|
1036
|
+
owlGeomSet1i(geom, "has_occlusion_map", 0);
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
owlGeomSet1f(geom, "opacity", md.opacity);
|
|
1040
|
+
owlGeomSet1i(geom, "alpha_mode", md.alpha_mode);
|
|
1041
|
+
owlGeomSet1f(geom, "alpha_cutoff", md.alpha_cutoff);
|
|
1042
|
+
owlGeomSet3f(geom, "ambient_color", owl3f{(float)environment_ambient[0], (float)environment_ambient[1], (float)environment_ambient[2]});
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
geoms.push_back(geom);
|
|
1047
|
+
object_geoms.push_back(geom);
|
|
1048
|
+
}
|
|
1049
|
+
OWLGroup triangles_group = owlTrianglesGeomGroupCreate(context, object_geoms.size(), object_geoms.data());
|
|
1050
|
+
owlGroupBuildAccel(triangles_group);
|
|
1051
|
+
object_groups.push_back(triangles_group);
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
if constexpr (SPEC::ENABLE_OVERLAYS){
|
|
1055
|
+
// degenerate triangle: valid to build, never reported as a hit
|
|
1056
|
+
const float filler_vertices[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
|
|
1057
|
+
const int filler_indices[3] = {0, 1, 2};
|
|
1058
|
+
OWLBuffer filler_vertex_buffer = owlDeviceBufferCreate(context, OWL_FLOAT3, 3, filler_vertices);
|
|
1059
|
+
OWLBuffer filler_index_buffer = owlDeviceBufferCreate(context, OWL_INT3, 1, filler_indices);
|
|
1060
|
+
OWLGeom filler_geom = owlGeomCreate(context, triangles_geom_type);
|
|
1061
|
+
owlTrianglesSetVertices(filler_geom, filler_vertex_buffer, 3, sizeof(owl::vec3f), 0);
|
|
1062
|
+
owlTrianglesSetIndices(filler_geom, filler_index_buffer, 1, sizeof(owl::vec3i), 0);
|
|
1063
|
+
if constexpr (SPEC::HAS_RGB){
|
|
1064
|
+
owlGeomSet3f(filler_geom, "color", owl3f{0.f, 0.f, 0.f});
|
|
1065
|
+
}
|
|
1066
|
+
geoms.push_back(filler_geom);
|
|
1067
|
+
OWLGroup filler_group = owlTrianglesGeomGroupCreate(context, 1, &filler_geom);
|
|
1068
|
+
owlGroupBuildAccel(filler_group);
|
|
1069
|
+
assets.filler_group = filler_group;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
std::vector<OWLGroup> instance_children;
|
|
1073
|
+
std::vector<uint32_t> instance_ids; // user instance ids == global instance ids (contract: segmentation_object, operations_cpu_common.h)
|
|
1074
|
+
std::vector<float> instance_transforms; // 12 per instance: owl affine3f (linear columns vx, vy, vz, then translation)
|
|
1075
|
+
for(const auto& instance : scene.instances){
|
|
1076
|
+
instance_children.push_back(object_groups[instance.object]);
|
|
1077
|
+
instance_ids.push_back((uint32_t)instance_ids.size());
|
|
1078
|
+
const float* transform = instance.transform; // 3x4 row-major [R|t]
|
|
1079
|
+
const float owl_transform[12] = {
|
|
1080
|
+
transform[0], transform[4], transform[8],
|
|
1081
|
+
transform[1], transform[5], transform[9],
|
|
1082
|
+
transform[2], transform[6], transform[10],
|
|
1083
|
+
transform[3], transform[7], transform[11]
|
|
1084
|
+
};
|
|
1085
|
+
instance_transforms.insert(instance_transforms.end(), owl_transform, owl_transform + 12);
|
|
1086
|
+
}
|
|
1087
|
+
OWLGroup world = owlInstanceGroupCreate(context, instance_children.size(), instance_children.data(), instance_ids.data(), instance_transforms.data(), OWL_MATRIX_FORMAT_OWL);
|
|
1088
|
+
owlGroupBuildAccel(world);
|
|
1089
|
+
|
|
1090
|
+
if constexpr (SPEC::HAS_RGB && (SPEC::SHADING::PBR_SHADING || SPEC::SHADING::METALLIC_REFLECTIONS)) {
|
|
1091
|
+
for(size_t m = 0; m < geoms.size(); m++){
|
|
1092
|
+
owlGeomSetGroup(geoms[m], "world", world);
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
if constexpr (SPEC::HAS_RGB && SPEC::SHADING::PBR_SHADING) {
|
|
1097
|
+
const auto scene_lights = rendering::raytracing::detail::effective_scene_lights<true>(device, scene);
|
|
1098
|
+
OWLBuffer light_buffer = owlDeviceBufferCreate(context, OWL_USER_TYPE(rendering::raytracing::SceneLight),
|
|
1099
|
+
scene_lights.size(), scene_lights.data());
|
|
1100
|
+
for (size_t m = 0; m < geoms.size(); m++) {
|
|
1101
|
+
owlGeomSetBuffer(geoms[m], "scene_lights", light_buffer);
|
|
1102
|
+
owlGeomSet1i(geoms[m], "num_scene_lights", (int)scene_lights.size());
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
std::vector<unsigned int> host_instance_classes(scene.instances.size() + (SPEC::ENABLE_OVERLAYS ? (size_t)SPEC::NUM_OVERLAYS * SPEC::MAX_OVERLAY_INSTANCES : 0), 0);
|
|
1107
|
+
for(size_t instance_i = 0; instance_i < scene.instances.size(); instance_i++){
|
|
1108
|
+
host_instance_classes[instance_i] = all_objects[scene.instances[instance_i].object]->segmentation_class;
|
|
1109
|
+
}
|
|
1110
|
+
if(host_instance_classes.empty()){
|
|
1111
|
+
host_instance_classes.push_back(0);
|
|
1112
|
+
}
|
|
1113
|
+
OWLBuffer instance_classes_buffer = owlDeviceBufferCreate(context, OWL_UINT, host_instance_classes.size(), host_instance_classes.data());
|
|
1114
|
+
|
|
1115
|
+
assets.world = world;
|
|
1116
|
+
assets.instance_classes_buffer = instance_classes_buffer;
|
|
1117
|
+
assets.num_scene_instances = scene.instances.size();
|
|
1118
|
+
assets.object_groups.clear();
|
|
1119
|
+
for(OWLGroup object_group : object_groups){
|
|
1120
|
+
assets.object_groups.push_back(object_group);
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
// wires one renderer to a scene build: bounds, overlay state, ray gen vars, launch
|
|
1125
|
+
// params, and the context-level programs/pipeline/SBT rebuild
|
|
1126
|
+
template <typename DEVICE, typename SPEC>
|
|
1127
|
+
void init_renderer_scene(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer, const rendering::raytracing::Scene& scene, const std::vector<const rendering::raytracing::Object*>& all_objects, const rendering::raytracing::backends::SceneState<rendering::raytracing::backends::Optix, SPEC>& assets){
|
|
1128
|
+
namespace optix = rendering::raytracing::backends::optix;
|
|
1129
|
+
OWLContext context = (OWLContext)renderer.backend->context;
|
|
1130
|
+
OWLGroup world = (OWLGroup)assets.world;
|
|
1131
|
+
OWLBuffer instance_classes_buffer = (OWLBuffer)assets.instance_classes_buffer;
|
|
1132
|
+
|
|
1133
|
+
if(renderer.backend->overlay_state != nullptr){
|
|
1134
|
+
auto* previous_overlay_state = (optix::OverlayState*)renderer.backend->overlay_state;
|
|
1135
|
+
optix::overlay_accel_destroy(previous_overlay_state->accel);
|
|
1136
|
+
cudaFree(previous_overlay_state->row_indices_device);
|
|
1137
|
+
cudaFree(previous_overlay_state->rows_device);
|
|
1138
|
+
delete previous_overlay_state;
|
|
1139
|
+
renderer.backend->overlay_state = nullptr;
|
|
1140
|
+
}
|
|
1141
|
+
if constexpr (SPEC::ENABLE_OVERLAYS){
|
|
1142
|
+
auto* overlay_state = new optix::OverlayState{};
|
|
1143
|
+
for(OWLGroup object_group : assets.object_groups){
|
|
1144
|
+
overlay_state->object_groups.push_back(object_group);
|
|
1145
|
+
}
|
|
1146
|
+
overlay_state->filler_group = (OWLGroup)assets.filler_group;
|
|
1147
|
+
renderer.backend->overlay_state = overlay_state;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
if constexpr (SPEC::HAS_RGB) {
|
|
1151
|
+
owlRayGenSetGroup((OWLRayGen)renderer.backend->ray_gen, "world", world);
|
|
1152
|
+
}
|
|
1153
|
+
if constexpr (SPEC::HAS_DEPTH) {
|
|
1154
|
+
owlRayGenSetGroup((OWLRayGen)renderer.backend->depth_ray_gen, "world", world);
|
|
1155
|
+
}
|
|
1156
|
+
if constexpr (SPEC::HAS_SEGMENTATION) {
|
|
1157
|
+
owlRayGenSetGroup((OWLRayGen)renderer.backend->segmentation_ray_gen, "world", world);
|
|
1158
|
+
}
|
|
1159
|
+
if constexpr (SPEC::HAS_NORMALS) {
|
|
1160
|
+
owlRayGenSetGroup((OWLRayGen)renderer.backend->normals_ray_gen, "world", world);
|
|
1161
|
+
}
|
|
1162
|
+
if constexpr (SPEC::HAS_FLOW) {
|
|
1163
|
+
constexpr unsigned int FLOW_SLOTS = SPEC::ENABLE_OVERLAYS ? (unsigned int)SPEC::NUM_OVERLAYS * SPEC::MAX_OVERLAY_INSTANCES : 0u;
|
|
1164
|
+
owlRayGenSetGroup((OWLRayGen)renderer.backend->flow_ray_gen, "world", world);
|
|
1165
|
+
owlRayGenSet1ui((OWLRayGen)renderer.backend->flow_ray_gen, "source_first_overlay_instance", (unsigned int)scene.instances.size());
|
|
1166
|
+
if constexpr (SPEC::HAS_FLOW_FORWARD) {
|
|
1167
|
+
owlRayGenSetGroup((OWLRayGen)renderer.backend->flow_forward_ray_gen, "world", world);
|
|
1168
|
+
owlRayGenSet1ui((OWLRayGen)renderer.backend->flow_forward_ray_gen, "source_first_overlay_instance", (unsigned int)scene.instances.size() + FLOW_SLOTS);
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
if(renderer.backend->collision_ray_gen){
|
|
1172
|
+
owlRayGenSetGroup((OWLRayGen)renderer.backend->collision_ray_gen, "world", world);
|
|
1173
|
+
owlRayGenSet1f((OWLRayGen)renderer.backend->collision_ray_gen, "max_dist", renderer.max_ray_length);
|
|
1174
|
+
}
|
|
1175
|
+
renderer.backend->world = world;
|
|
1176
|
+
|
|
1177
|
+
// programs/pipeline/SBT must be (re)built after the geometry set changes; the launch
|
|
1178
|
+
// params are spec-dependent and created once. In shared-library mode later scene
|
|
1179
|
+
// builds only append SBT records, so earlier renderers' baked offsets stay valid.
|
|
1180
|
+
owlBuildPrograms(context);
|
|
1181
|
+
owlBuildPipeline(context);
|
|
1182
|
+
owlBuildSBT(context);
|
|
1183
|
+
|
|
1184
|
+
if constexpr (SPEC::ENABLE_OVERLAYS){
|
|
1185
|
+
auto* overlay_state = (optix::OverlayState*)renderer.backend->overlay_state;
|
|
1186
|
+
// per-object BLAS traversables and SBT offsets are only final after owlBuildSBT above;
|
|
1187
|
+
// baked into a device table the fill kernel joins against slot structure
|
|
1188
|
+
std::vector<optix::OverlayObjectEntry> object_entries(overlay_state->object_groups.size());
|
|
1189
|
+
for(size_t object_i = 0; object_i < overlay_state->object_groups.size(); object_i++){
|
|
1190
|
+
object_entries[object_i].traversable = (unsigned long long)owlGroupGetTraversable(overlay_state->object_groups[object_i], 0);
|
|
1191
|
+
object_entries[object_i].sbt_offset = owlGroupGetSBTOffset(overlay_state->object_groups[object_i]);
|
|
1192
|
+
object_entries[object_i].segmentation_class = all_objects[object_i]->segmentation_class;
|
|
1193
|
+
}
|
|
1194
|
+
overlay_state->accel = optix::overlay_accel_create(owlContextGetOptixContext(context, 0), SPEC::NUM_OVERLAYS, SPEC::MAX_OVERLAY_INSTANCES, (unsigned int)scene.instances.size(), (unsigned long long)owlGroupGetTraversable(overlay_state->filler_group, 0), SPEC::HAS_FLOW ? 2u : 1u);
|
|
1195
|
+
optix::overlay_accel_upload_objects(overlay_state->accel, object_entries.data(), (unsigned int)object_entries.size());
|
|
1196
|
+
constexpr size_t SLOTS = (size_t)SPEC::NUM_OVERLAYS * SPEC::MAX_OVERLAY_INSTANCES;
|
|
1197
|
+
overlay_state->structure_staging.assign(SLOTS, optix::OverlaySlotStructure{});
|
|
1198
|
+
overlay_state->row_indices.assign(SLOTS, 0u);
|
|
1199
|
+
overlay_state->rows.assign((size_t)(SPEC::ENABLE_DYNAMIC_MOTION_BLUR ? SPEC::MOTION_BLUR_SAMPLES : 1) * SLOTS * 12, 0.0f);
|
|
1200
|
+
cudaMalloc(&overlay_state->row_indices_device, overlay_state->row_indices.size() * sizeof(unsigned int));
|
|
1201
|
+
cudaMalloc(&overlay_state->rows_device, overlay_state->rows.size() * sizeof(float));
|
|
1202
|
+
// published once: raw builds into fixed per-overlay buffers keep the handles stable,
|
|
1203
|
+
// so no per-rebuild re-publication is needed
|
|
1204
|
+
overlay_state->traversables_buffer = owlDeviceBufferCreate(context, OWL_USER_TYPE(unsigned long long), SPEC::NUM_OVERLAYS, optix::overlay_accel_traversables(overlay_state->accel, 0));
|
|
1205
|
+
if constexpr (SPEC::HAS_FLOW) {
|
|
1206
|
+
overlay_state->traversables_previous_buffer = owlDeviceBufferCreate(context, OWL_USER_TYPE(unsigned long long), SPEC::NUM_OVERLAYS, optix::overlay_accel_traversables(overlay_state->accel, 1));
|
|
1207
|
+
}
|
|
1208
|
+
overlay_state->attachments_buffer = owlDeviceBufferCreate(context, OWL_UINT, (size_t)SPEC::NUM_CAMERAS * SPEC::MAX_OVERLAYS_PER_CAMERA, nullptr);
|
|
1209
|
+
rendering::raytracing::detail::reset_overlay_state(renderer);
|
|
1210
|
+
overlay_state->instance_classes_buffer = instance_classes_buffer;
|
|
1211
|
+
overlay_state->num_scene_instances = scene.instances.size();
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
if(renderer.backend->launch_params == nullptr){
|
|
1215
|
+
OWLVarDecl launch_params_vars[] = {
|
|
1216
|
+
{ "overlays", OWL_BUFPTR, OWL_OFFSETOF(OverlayLaunchParams, overlays)},
|
|
1217
|
+
{ "overlays_previous", OWL_BUFPTR, OWL_OFFSETOF(OverlayLaunchParams, overlays_previous)},
|
|
1218
|
+
{ "attachments", OWL_BUFPTR, OWL_OFFSETOF(OverlayLaunchParams, attachments)},
|
|
1219
|
+
{ "overlay_count", OWL_INT, OWL_OFFSETOF(OverlayLaunchParams, overlay_count)},
|
|
1220
|
+
{ "cam_width", OWL_INT, OWL_OFFSETOF(OverlayLaunchParams, cam_width)},
|
|
1221
|
+
{ "cam_height", OWL_INT, OWL_OFFSETOF(OverlayLaunchParams, cam_height)},
|
|
1222
|
+
{ "grid_cols", OWL_INT, OWL_OFFSETOF(OverlayLaunchParams, grid_cols)},
|
|
1223
|
+
{ "instance_classes", OWL_BUFPTR, OWL_OFFSETOF(OverlayLaunchParams, instance_classes)},
|
|
1224
|
+
{ "semantic_segmentation", OWL_INT, OWL_OFFSETOF(OverlayLaunchParams, semantic_segmentation)},
|
|
1225
|
+
{ /* sentinel */ }
|
|
1226
|
+
};
|
|
1227
|
+
OWLParams launch_params = owlParamsCreate(context, sizeof(OverlayLaunchParams), launch_params_vars, -1);
|
|
1228
|
+
renderer.backend->launch_params = launch_params;
|
|
1229
|
+
if(renderer.backend->collision_ray_gen){
|
|
1230
|
+
OWLParams coll_lp = owlParamsCreate(context, sizeof(OverlayLaunchParams), launch_params_vars, -1);
|
|
1231
|
+
renderer.backend->coll_launch_params = coll_lp;
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
OWLParams all_launch_params[2] = {(OWLParams)renderer.backend->launch_params, (OWLParams)renderer.backend->coll_launch_params};
|
|
1235
|
+
for(OWLParams launch_params : all_launch_params){
|
|
1236
|
+
if(launch_params == nullptr) continue;
|
|
1237
|
+
owlParamsSet1i(launch_params, "overlay_count", (int)SPEC::MAX_OVERLAYS_PER_CAMERA);
|
|
1238
|
+
owlParamsSet1i(launch_params, "cam_width", (int)SPEC::CAM_WIDTH);
|
|
1239
|
+
owlParamsSet1i(launch_params, "cam_height", (int)SPEC::CAM_HEIGHT);
|
|
1240
|
+
owlParamsSet1i(launch_params, "grid_cols", (int)SPEC::GRID_COLS);
|
|
1241
|
+
owlParamsSet1i(launch_params, "semantic_segmentation", SPEC::SEMANTIC_SEGMENTATION ? 1 : 0);
|
|
1242
|
+
owlParamsSetBuffer(launch_params, "instance_classes", instance_classes_buffer);
|
|
1243
|
+
if constexpr (SPEC::ENABLE_OVERLAYS){
|
|
1244
|
+
auto* overlay_state = (optix::OverlayState*)renderer.backend->overlay_state;
|
|
1245
|
+
owlParamsSetBuffer(launch_params, "overlays", overlay_state->traversables_buffer);
|
|
1246
|
+
owlParamsSetBuffer(launch_params, "attachments", overlay_state->attachments_buffer);
|
|
1247
|
+
if constexpr (SPEC::HAS_FLOW){
|
|
1248
|
+
owlParamsSetBuffer(launch_params, "overlays_previous", overlay_state->traversables_previous_buffer);
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
if constexpr (SPEC::ENABLE_OVERLAYS){
|
|
1254
|
+
update(device, renderer); // publish the (empty) overlays and the attachment table
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
template <typename DEVICE, typename SPEC, typename METADATA_T>
|
|
1260
|
+
void init(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer, const rendering::raytracing::Scene& scene, const rendering::raytracing::AssetPool& pool, const rendering::SceneMetadata<METADATA_T>& metadata){
|
|
1261
|
+
namespace optix = rendering::raytracing::backends::optix;
|
|
1262
|
+
validate_semantic_segmentation<SPEC>(device, scene, pool);
|
|
1263
|
+
renderer.max_ray_length = (typename SPEC::T)metadata.max_ray_length;
|
|
1264
|
+
rendering::raytracing::detail::announce_configuration<SPEC>(device);
|
|
1265
|
+
rendering::raytracing::detail::resolve_environment<SPEC>(scene.environment, renderer.ambient_color, renderer.miss_color_0, renderer.miss_color_1);
|
|
1266
|
+
owlMissProgSet3f((OWLMissProg)renderer.backend->miss_prog, "color_0", owl3f{(float)renderer.miss_color_0[0], (float)renderer.miss_color_0[1], (float)renderer.miss_color_0[2]});
|
|
1267
|
+
owlMissProgSet3f((OWLMissProg)renderer.backend->miss_prog, "color_1", owl3f{(float)renderer.miss_color_1[0], (float)renderer.miss_color_1[1], (float)renderer.miss_color_1[2]});
|
|
1268
|
+
OWLContext context = (OWLContext)renderer.backend->context;
|
|
1269
|
+
OWLModule module = (OWLModule)renderer.backend->module;
|
|
1270
|
+
OWLGeomType triangles_geom_type = optix::detail::create_geom_type<SPEC>(context, module);
|
|
1271
|
+
|
|
1272
|
+
std::vector<const rendering::raytracing::Object*> all_objects;
|
|
1273
|
+
for(const auto& object : scene.objects){
|
|
1274
|
+
all_objects.push_back(&object);
|
|
1275
|
+
}
|
|
1276
|
+
if constexpr (SPEC::ENABLE_OVERLAYS){
|
|
1277
|
+
rendering::raytracing::detail::register_pool_assets(device, renderer, pool, all_objects);
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
rendering::raytracing::backends::SceneState<rendering::raytracing::backends::Optix, SPEC> assets;
|
|
1281
|
+
optix::detail::build_scene_assets<DEVICE, SPEC>(device, context, triangles_geom_type, scene, all_objects, assets);
|
|
1282
|
+
optix::detail::init_renderer_scene(device, renderer, scene, all_objects, assets);
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
// shared-library mode: one geometry/texture/BLAS build per unique scene (content-hash
|
|
1286
|
+
// dedup inside the library), then init(device, renderer, library, scene_id) wires a
|
|
1287
|
+
// renderer to the shared build. Returns the unique-scene index so callers can key their
|
|
1288
|
+
// own per-scene data.
|
|
1289
|
+
template <typename DEVICE, typename SPEC, typename T>
|
|
1290
|
+
typename SPEC::TI insert(DEVICE& device, rendering::raytracing::AssetLibrary<SPEC, rendering::raytracing::backends::Optix>& library, rendering::Bundle<T>& bundle){
|
|
1291
|
+
namespace optix = rendering::raytracing::backends::optix;
|
|
1292
|
+
using TI = typename SPEC::TI;
|
|
1293
|
+
bool is_new = false;
|
|
1294
|
+
const TI scene_id = rendering::raytracing::detail::library_insert(device, library, bundle, is_new);
|
|
1295
|
+
if(is_new){
|
|
1296
|
+
const rendering::raytracing::Scene& scene = library.scenes[scene_id];
|
|
1297
|
+
if(library.backend->geom_type == nullptr){
|
|
1298
|
+
library.backend->geom_type = optix::detail::create_geom_type<SPEC>(library.backend->context, library.backend->module);
|
|
1299
|
+
}
|
|
1300
|
+
std::vector<const rendering::raytracing::Object*> build_objects;
|
|
1301
|
+
optix::detail::collect_all_objects(scene, library.pool, build_objects);
|
|
1302
|
+
library.assets[scene_id] = new rendering::raytracing::backends::SceneState<rendering::raytracing::backends::Optix, SPEC>{};
|
|
1303
|
+
optix::detail::build_scene_assets<DEVICE, SPEC>(device, library.backend->context, library.backend->geom_type, scene, build_objects, *library.assets[scene_id]);
|
|
1304
|
+
}
|
|
1305
|
+
return scene_id;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
template <typename DEVICE, typename SPEC>
|
|
1309
|
+
void init(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer, rendering::raytracing::AssetLibrary<SPEC, rendering::raytracing::backends::Optix>& library, typename SPEC::TI scene_id){
|
|
1310
|
+
namespace optix = rendering::raytracing::backends::optix;
|
|
1311
|
+
utils::assert_exit(device, renderer.backend->library == &library, "init: the renderer was not malloc'd against this library");
|
|
1312
|
+
utils::assert_exit(device, scene_id < (typename SPEC::TI)library.scenes.size(), "init: scene_id out of range");
|
|
1313
|
+
const rendering::raytracing::Scene& scene = library.scenes[scene_id];
|
|
1314
|
+
validate_semantic_segmentation<SPEC>(device, scene, library.pool);
|
|
1315
|
+
renderer.max_ray_length = library.metadata[scene_id].max_ray_length;
|
|
1316
|
+
rendering::raytracing::detail::announce_configuration<SPEC>(device);
|
|
1317
|
+
rendering::raytracing::detail::resolve_environment<SPEC>(scene.environment, renderer.ambient_color, renderer.miss_color_0, renderer.miss_color_1);
|
|
1318
|
+
owlMissProgSet3f((OWLMissProg)renderer.backend->miss_prog, "color_0", owl3f{(float)renderer.miss_color_0[0], (float)renderer.miss_color_0[1], (float)renderer.miss_color_0[2]});
|
|
1319
|
+
owlMissProgSet3f((OWLMissProg)renderer.backend->miss_prog, "color_1", owl3f{(float)renderer.miss_color_1[0], (float)renderer.miss_color_1[1], (float)renderer.miss_color_1[2]});
|
|
1320
|
+
|
|
1321
|
+
std::vector<const rendering::raytracing::Object*> all_objects;
|
|
1322
|
+
for(const auto& object : scene.objects){
|
|
1323
|
+
all_objects.push_back(&object);
|
|
1324
|
+
}
|
|
1325
|
+
if constexpr (SPEC::ENABLE_OVERLAYS){
|
|
1326
|
+
rendering::raytracing::detail::register_pool_assets(device, renderer, library.pool, all_objects);
|
|
1327
|
+
}
|
|
1328
|
+
else{
|
|
1329
|
+
optix::detail::collect_all_objects(scene, library.pool, all_objects);
|
|
1330
|
+
}
|
|
1331
|
+
optix::detail::init_renderer_scene(device, renderer, scene, all_objects, *library.assets[scene_id]);
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
namespace rendering::raytracing::backends::optix{
|
|
1336
|
+
// the launch verbs are stream-ordered on a CUDA producer device's stream: the backend stream
|
|
1337
|
+
// waits for the work enqueued there so far (fork) and that stream waits for the launch
|
|
1338
|
+
// (join), so callers see one stream; a host producer has no stream and writes synchronously
|
|
1339
|
+
template <typename DEVICE>
|
|
1340
|
+
auto fork(DEVICE& device, cudaEvent_t event, cudaStream_t backend_stream, int) -> decltype(device.stream, void()){
|
|
1341
|
+
devices::cuda::order_after(event, device.stream, backend_stream);
|
|
1342
|
+
}
|
|
1343
|
+
template <typename DEVICE>
|
|
1344
|
+
void fork(DEVICE& device, cudaEvent_t event, cudaStream_t backend_stream, long){}
|
|
1345
|
+
template <typename DEVICE>
|
|
1346
|
+
auto join(DEVICE& device, cudaEvent_t event, cudaStream_t backend_stream, int) -> decltype(device.stream, void()){
|
|
1347
|
+
devices::cuda::order_after(event, backend_stream, device.stream);
|
|
1348
|
+
}
|
|
1349
|
+
template <typename DEVICE>
|
|
1350
|
+
void join(DEVICE& device, cudaEvent_t event, cudaStream_t backend_stream, long){}
|
|
1351
|
+
|
|
1352
|
+
// publishes the pending rows of one host staging mirror into its resident tensor: the
|
|
1353
|
+
// rows compact into the pageable index/row lists and one scatter kernel writes them —
|
|
1354
|
+
// two copies and one kernel per tensor and update, however sparse the host writes were.
|
|
1355
|
+
// num_slabs > 1 publishes the sample-major motion mirror (slabs SLOTS rows apart).
|
|
1356
|
+
template <typename SPEC>
|
|
1357
|
+
void publish_rows(OverlayState& overlay_state, bool* pending, const float* staging, float* resident, unsigned int num_slabs, cudaStream_t stream){
|
|
1358
|
+
constexpr size_t SLOTS = (size_t)SPEC::NUM_OVERLAYS * SPEC::MAX_OVERLAY_INSTANCES;
|
|
1359
|
+
unsigned int count = 0;
|
|
1360
|
+
for(size_t slot = 0; slot < SLOTS; slot++){
|
|
1361
|
+
if(pending[slot]){
|
|
1362
|
+
overlay_state.row_indices[count++] = (unsigned int)slot;
|
|
1363
|
+
pending[slot] = false;
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
if(count == 0){
|
|
1367
|
+
return;
|
|
1368
|
+
}
|
|
1369
|
+
for(unsigned int slab = 0; slab < num_slabs; slab++){
|
|
1370
|
+
for(unsigned int row = 0; row < count; row++){
|
|
1371
|
+
std::memcpy(overlay_state.rows.data() + ((size_t)slab * count + row) * 12, staging + ((size_t)slab * SLOTS + overlay_state.row_indices[row]) * 12, 12 * sizeof(float));
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
cudaMemcpyAsync(overlay_state.row_indices_device, overlay_state.row_indices.data(), count * sizeof(unsigned int), cudaMemcpyHostToDevice, stream);
|
|
1375
|
+
cudaMemcpyAsync(overlay_state.rows_device, overlay_state.rows.data(), (size_t)num_slabs * count * 12 * sizeof(float), cudaMemcpyHostToDevice, stream);
|
|
1376
|
+
overlay_accel_scatter_rows(overlay_state.row_indices_device, count, overlay_state.rows_device, resident, num_slabs, (unsigned int)SLOTS, stream);
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
template <typename DEVICE, typename SPEC>
|
|
1381
|
+
cudaStream_t stream(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1382
|
+
return (cudaStream_t)owlParamsGetCudaStream((OWLParams)renderer.backend->launch_params, 0);
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
template <typename DEVICE, typename SPEC>
|
|
1386
|
+
cudaStream_t collision_stream(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1387
|
+
return renderer.backend->coll_launch_params != nullptr ? (cudaStream_t)owlParamsGetCudaStream((OWLParams)renderer.backend->coll_launch_params, 0) : stream(device, renderer);
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
// fully stream-ordered on the render stream: the pending host rows publish by scatter, then
|
|
1391
|
+
// the device-side instance fill and per-overlay raw optixAccelBuild — no host synchronization
|
|
1392
|
+
template <typename DEVICE, typename SPEC>
|
|
1393
|
+
void update_launch(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1394
|
+
static_assert(SPEC::ENABLE_OVERLAYS, "update requires an overlay-enabled renderer specification");
|
|
1395
|
+
namespace optix = rendering::raytracing::backends::optix;
|
|
1396
|
+
using TI = typename SPEC::TI;
|
|
1397
|
+
auto* overlay_state = (optix::OverlayState*)renderer.backend->overlay_state;
|
|
1398
|
+
cudaStream_t cuda_stream = (cudaStream_t)owlParamsGetCudaStream((OWLParams)renderer.backend->launch_params, 0);
|
|
1399
|
+
cudaStream_t coll_stream = collision_stream(device, renderer);
|
|
1400
|
+
optix::fork(device, renderer.backend->ordering_event, cuda_stream, 0);
|
|
1401
|
+
// probe launches trace the overlay TLASes on their own stream: order this rebuild after
|
|
1402
|
+
// in-flight probes and subsequent probes after this rebuild, without host syncs
|
|
1403
|
+
devices::cuda::order_after(renderer.backend->ordering_event, coll_stream, cuda_stream);
|
|
1404
|
+
|
|
1405
|
+
for(TI overlay = 0; overlay < SPEC::NUM_OVERLAYS; overlay++){
|
|
1406
|
+
auto& overlay_host = renderer.overlays[overlay];
|
|
1407
|
+
if(!overlay_host.dirty){
|
|
1408
|
+
continue;
|
|
1409
|
+
}
|
|
1410
|
+
const size_t base = (size_t)overlay * SPEC::MAX_OVERLAY_INSTANCES;
|
|
1411
|
+
for(TI slot = 0; slot < SPEC::MAX_OVERLAY_INSTANCES; slot++){
|
|
1412
|
+
auto& row = overlay_state->structure_staging[base + slot];
|
|
1413
|
+
row.active = overlay_host.slots[slot].active ? 1u : 0u;
|
|
1414
|
+
row.object = (unsigned int)overlay_host.slots[slot].object;
|
|
1415
|
+
}
|
|
1416
|
+
cudaMemcpyAsync(optix::overlay_accel_structure(overlay_state->accel) + base, &overlay_state->structure_staging[base], SPEC::MAX_OVERLAY_INSTANCES * sizeof(optix::OverlaySlotStructure), cudaMemcpyHostToDevice, cuda_stream);
|
|
1417
|
+
overlay_host.dirty = false;
|
|
1418
|
+
}
|
|
1419
|
+
// producer writes stay in place: the scatter touches only the rows the host marked, and
|
|
1420
|
+
// the accel build below consumes the tensors unconditionally (overlay-producer contract tests)
|
|
1421
|
+
optix::publish_rows<SPEC>(*overlay_state, renderer.transforms_pending, renderer.transforms_staging.data(), data(renderer.transforms), 1u, cuda_stream);
|
|
1422
|
+
if constexpr (SPEC::HAS_FLOW_OVERLAYS){
|
|
1423
|
+
optix::publish_rows<SPEC>(*overlay_state, renderer.transforms_previous_pending, renderer.transforms_previous_staging.data(), data(renderer.transforms_previous), 1u, cuda_stream);
|
|
1424
|
+
}
|
|
1425
|
+
if constexpr (SPEC::ENABLE_DYNAMIC_MOTION_BLUR){
|
|
1426
|
+
optix::publish_rows<SPEC>(*overlay_state, renderer.transforms_motion_pending, renderer.transforms_motion_staging.data(), data(renderer.transforms_motion), (unsigned int)SPEC::MOTION_BLUR_SAMPLES, cuda_stream);
|
|
1427
|
+
}
|
|
1428
|
+
if(renderer.attachments_dirty){
|
|
1429
|
+
std::vector<uint32_t> attachments((size_t)SPEC::NUM_CAMERAS * SPEC::MAX_OVERLAYS_PER_CAMERA);
|
|
1430
|
+
for(size_t index = 0; index < attachments.size(); index++){
|
|
1431
|
+
attachments[index] = (uint32_t)renderer.attachments[index];
|
|
1432
|
+
}
|
|
1433
|
+
owlBufferUpload(overlay_state->attachments_buffer, attachments.data(), 0, attachments.size());
|
|
1434
|
+
renderer.attachments_dirty = false;
|
|
1435
|
+
}
|
|
1436
|
+
// only semantic segmentation reads the overlay classes, and renderers sharing a scene build
|
|
1437
|
+
// share its class buffer
|
|
1438
|
+
unsigned int* instance_classes = SPEC::SEMANTIC_SEGMENTATION ? (unsigned int*)owlBufferGetPointer(overlay_state->instance_classes_buffer, 0) : nullptr;
|
|
1439
|
+
optix::overlay_accel_build(overlay_state->accel, data(renderer.transforms), instance_classes, 1.0f, nullptr, cuda_stream, 0u);
|
|
1440
|
+
if constexpr (SPEC::HAS_FLOW){
|
|
1441
|
+
// the previous instant's TLASes (shifted id range, no segmentation classes) and the
|
|
1442
|
+
// per-slot deltas between the instants, both from the tensors, both stream-ordered
|
|
1443
|
+
optix::overlay_accel_build(overlay_state->accel, data(renderer.transforms_previous), nullptr, 1.0f, nullptr, cuda_stream, 1u);
|
|
1444
|
+
optix::overlay_accel_compose_flow_deltas(optix::overlay_accel_structure(overlay_state->accel), data(renderer.transforms), data(renderer.transforms_previous), (float*)owlBufferGetPointer(renderer.backend->flow_deltas_buffer, 0),
|
|
1445
|
+
(unsigned int)SPEC::NUM_OVERLAYS, (unsigned int)SPEC::MAX_OVERLAY_INSTANCES, cuda_stream);
|
|
1446
|
+
}
|
|
1447
|
+
devices::cuda::order_after(renderer.backend->ordering_event, cuda_stream, coll_stream);
|
|
1448
|
+
optix::join(device, renderer.backend->ordering_event, cuda_stream, 0);
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
template <typename DEVICE, typename SPEC>
|
|
1452
|
+
void update_sync(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1453
|
+
static_assert(SPEC::ENABLE_OVERLAYS, "update requires an overlay-enabled renderer specification");
|
|
1454
|
+
cudaStreamSynchronize((cudaStream_t)owlParamsGetCudaStream((OWLParams)renderer.backend->launch_params, 0));
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
// the previous instant becomes the current one, entirely on the render stream: the camera
|
|
1458
|
+
// and transform tensors copy device-to-device, rows the host has not yet published reach
|
|
1459
|
+
// transforms_previous through their staging mirror at the next update
|
|
1460
|
+
template <typename DEVICE, typename SPEC>
|
|
1461
|
+
void advance_flow_launch(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1462
|
+
static_assert(SPEC::HAS_FLOW, "advance_flow requires a flow-capable renderer specification");
|
|
1463
|
+
namespace optix = rendering::raytracing::backends::optix;
|
|
1464
|
+
cudaStream_t cuda_stream = (cudaStream_t)owlParamsGetCudaStream((OWLParams)renderer.backend->launch_params, 0);
|
|
1465
|
+
optix::fork(device, renderer.backend->ordering_event, cuda_stream, 0);
|
|
1466
|
+
cudaMemcpyAsync(data(renderer.cameras_previous), data(renderer.cameras), decltype(renderer.cameras)::SPEC::SIZE_BYTES, cudaMemcpyDeviceToDevice, cuda_stream);
|
|
1467
|
+
if constexpr (SPEC::HAS_FLOW_OVERLAYS){
|
|
1468
|
+
rendering::raytracing::detail::advance_flow_staging(renderer);
|
|
1469
|
+
cudaMemcpyAsync(data(renderer.transforms_previous), data(renderer.transforms), decltype(renderer.transforms)::SPEC::SIZE_BYTES, cudaMemcpyDeviceToDevice, cuda_stream);
|
|
1470
|
+
}
|
|
1471
|
+
optix::join(device, renderer.backend->ordering_event, cuda_stream, 0);
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
template <typename DEVICE, typename SPEC>
|
|
1475
|
+
void advance_flow_sync(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1476
|
+
static_assert(SPEC::HAS_FLOW, "advance_flow requires a flow-capable renderer specification");
|
|
1477
|
+
cudaStreamSynchronize((cudaStream_t)owlParamsGetCudaStream((OWLParams)renderer.backend->launch_params, 0));
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
template <typename DEVICE, typename SPEC>
|
|
1481
|
+
void update(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1482
|
+
update_launch(device, renderer);
|
|
1483
|
+
update_sync(device, renderer);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
|
|
1487
|
+
namespace rendering::raytracing::backends::optix {
|
|
1488
|
+
inline void synchronize(rendering::raytracing::backends::Device<rendering::raytracing::backends::Optix>& device){
|
|
1489
|
+
if(device.state->launch_params != nullptr){
|
|
1490
|
+
cudaStreamSynchronize((cudaStream_t)owlParamsGetCudaStream((OWLParams)device.state->launch_params, 0));
|
|
1491
|
+
}
|
|
1492
|
+
if(device.state->coll_launch_params != nullptr){
|
|
1493
|
+
cudaStreamSynchronize((cudaStream_t)owlParamsGetCudaStream((OWLParams)device.state->coll_launch_params, 0));
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
// renderer memory-domain copies: ordered after the renderer's in-flight work on both
|
|
1499
|
+
// renderer-owned streams, so no separate synchronize() is needed at readback/upload boundaries
|
|
1500
|
+
template <typename TO_DEVICE, typename FROM_SPEC, typename TO_SPEC>
|
|
1501
|
+
void copy(rendering::raytracing::backends::Device<rendering::raytracing::backends::Optix>& from_device, TO_DEVICE& to_device, const Tensor<FROM_SPEC>& from, Tensor<TO_SPEC>& to){
|
|
1502
|
+
static_assert(tensor::same_dimensions_shape<typename FROM_SPEC::SHAPE, typename TO_SPEC::SHAPE>());
|
|
1503
|
+
static_assert(tensor::same_dimensions_shape<typename FROM_SPEC::STRIDE, typename TO_SPEC::STRIDE>() && tensor::dense_row_major_layout<FROM_SPEC>(), "renderer copies require matching dense row-major layouts");
|
|
1504
|
+
static_assert(utils::typing::is_same_v<typename FROM_SPEC::T, typename TO_SPEC::T>);
|
|
1505
|
+
rendering::raytracing::backends::optix::synchronize(from_device);
|
|
1506
|
+
cudaMemcpy(to._data, from._data, FROM_SPEC::SIZE_BYTES, cudaMemcpyDeviceToHost);
|
|
1507
|
+
}
|
|
1508
|
+
template <typename FROM_DEVICE, typename FROM_SPEC, typename TO_SPEC>
|
|
1509
|
+
void copy(FROM_DEVICE& from_device, rendering::raytracing::backends::Device<rendering::raytracing::backends::Optix>& to_device, const Tensor<FROM_SPEC>& from, Tensor<TO_SPEC>& to){
|
|
1510
|
+
static_assert(tensor::same_dimensions_shape<typename FROM_SPEC::SHAPE, typename TO_SPEC::SHAPE>());
|
|
1511
|
+
static_assert(tensor::same_dimensions_shape<typename FROM_SPEC::STRIDE, typename TO_SPEC::STRIDE>() && tensor::dense_row_major_layout<FROM_SPEC>(), "renderer copies require matching dense row-major layouts");
|
|
1512
|
+
static_assert(utils::typing::is_same_v<typename FROM_SPEC::T, typename TO_SPEC::T>);
|
|
1513
|
+
rendering::raytracing::backends::optix::synchronize(to_device);
|
|
1514
|
+
cudaMemcpy(to._data, from._data, FROM_SPEC::SIZE_BYTES, cudaMemcpyHostToDevice);
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
// =========================================================================
|
|
1518
|
+
// generate_probe_directions: Fibonacci probe directions + upload
|
|
1519
|
+
// =========================================================================
|
|
1520
|
+
template <typename DEVICE, typename SPEC>
|
|
1521
|
+
void generate_probe_directions(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1522
|
+
#if RL_TOOLS_RENDERING_RAYTRACING_DISABLE_PROBE_RAYS
|
|
1523
|
+
log(device, device.logger, devices::logging::Verbosity::info, rendering::raytracing::LOG_PREFIX, "Probe rays disabled (RL_TOOLS_RENDERING_RAYTRACING_DISABLE_PROBE_RAYS=1)");
|
|
1524
|
+
return;
|
|
1525
|
+
#else
|
|
1526
|
+
std::vector<float> dirs = rendering::raytracing::detail::generate_probe_direction_vectors<SPEC>(device);
|
|
1527
|
+
owlBufferUpload((OWLBuffer)renderer.backend->probe_dirs_buffer, dirs.data(), 0, SPEC::NUM_PROBES);
|
|
1528
|
+
#endif
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
template <typename DEVICE, typename SPEC>
|
|
1532
|
+
void render_launch(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1533
|
+
namespace optix = rendering::raytracing::backends::optix;
|
|
1534
|
+
using TI = typename SPEC::TI;
|
|
1535
|
+
OWLParams launch_params = (OWLParams)renderer.backend->launch_params;
|
|
1536
|
+
cudaStream_t cuda_stream = (cudaStream_t)owlParamsGetCudaStream(launch_params, 0);
|
|
1537
|
+
optix::fork(device, renderer.backend->ordering_event, cuda_stream, 0);
|
|
1538
|
+
if constexpr (SPEC::ENABLE_DYNAMIC_MOTION_BLUR){
|
|
1539
|
+
// one enqueue-only pass per motion sample: overlay TLAS rebuild from the per-sample
|
|
1540
|
+
// transforms slab (the fill kernel also publishes the pass's shutter time), then the
|
|
1541
|
+
// accumulate ray gens; the shutter-close rebuild restores the steady state for
|
|
1542
|
+
// segmentation/probes before the resolve kernel averages the accumulators
|
|
1543
|
+
auto* overlay_state = (optix::OverlayState*)renderer.backend->overlay_state;
|
|
1544
|
+
unsigned int* instance_classes = SPEC::SEMANTIC_SEGMENTATION ? (unsigned int*)owlBufferGetPointer(overlay_state->instance_classes_buffer, 0) : nullptr;
|
|
1545
|
+
cudaStream_t coll_stream = collision_stream(device, renderer);
|
|
1546
|
+
devices::cuda::order_after(renderer.backend->ordering_event, coll_stream, cuda_stream);
|
|
1547
|
+
if constexpr (SPEC::HAS_RGB){
|
|
1548
|
+
cudaMemsetAsync(data(renderer.rgb_accumulator), 0, decltype(renderer.rgb_accumulator)::SPEC::SIZE_BYTES, cuda_stream);
|
|
1549
|
+
}
|
|
1550
|
+
constexpr size_t SLAB = (size_t)SPEC::NUM_OVERLAYS * SPEC::MAX_OVERLAY_INSTANCES * 12;
|
|
1551
|
+
for(TI sample = 0; sample < SPEC::MOTION_BLUR_SAMPLES; sample++){
|
|
1552
|
+
const float shutter_t = ((float)sample + 0.5f) / (float)SPEC::MOTION_BLUR_SAMPLES;
|
|
1553
|
+
optix::overlay_accel_build(overlay_state->accel, data(renderer.transforms_motion) + sample * SLAB, instance_classes, shutter_t, renderer.backend->shutter_device, cuda_stream, 0u);
|
|
1554
|
+
if constexpr (SPEC::HAS_RGB){
|
|
1555
|
+
owlAsyncLaunch2D((OWLRayGen)renderer.backend->ray_gen, SPEC::FB_WIDTH, SPEC::FB_HEIGHT, launch_params);
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
optix::overlay_accel_build(overlay_state->accel, data(renderer.transforms), instance_classes, 1.0f, nullptr, cuda_stream, 0u);
|
|
1559
|
+
devices::cuda::order_after(renderer.backend->ordering_event, cuda_stream, coll_stream);
|
|
1560
|
+
if constexpr (SPEC::HAS_DEPTH){
|
|
1561
|
+
owlAsyncLaunch2D((OWLRayGen)renderer.backend->depth_ray_gen, SPEC::FB_WIDTH, SPEC::FB_HEIGHT, launch_params);
|
|
1562
|
+
}
|
|
1563
|
+
if constexpr (SPEC::HAS_SEGMENTATION){
|
|
1564
|
+
owlAsyncLaunch2D((OWLRayGen)renderer.backend->segmentation_ray_gen, SPEC::FB_WIDTH, SPEC::FB_HEIGHT, launch_params);
|
|
1565
|
+
}
|
|
1566
|
+
if constexpr (SPEC::HAS_NORMALS){
|
|
1567
|
+
owlAsyncLaunch2D((OWLRayGen)renderer.backend->normals_ray_gen, SPEC::FB_WIDTH, SPEC::FB_HEIGHT, launch_params);
|
|
1568
|
+
}
|
|
1569
|
+
if constexpr (SPEC::HAS_FLOW){
|
|
1570
|
+
owlAsyncLaunch2D((OWLRayGen)renderer.backend->flow_ray_gen, SPEC::FB_WIDTH, SPEC::FB_HEIGHT, launch_params);
|
|
1571
|
+
}
|
|
1572
|
+
if constexpr (SPEC::HAS_FLOW_FORWARD){
|
|
1573
|
+
owlAsyncLaunch2D((OWLRayGen)renderer.backend->flow_forward_ray_gen, SPEC::FB_WIDTH, SPEC::FB_HEIGHT, launch_params);
|
|
1574
|
+
}
|
|
1575
|
+
const float* rgb_accumulation = nullptr;
|
|
1576
|
+
unsigned int* frame_buffer = nullptr;
|
|
1577
|
+
float* observation = nullptr;
|
|
1578
|
+
if constexpr (SPEC::HAS_RGB){
|
|
1579
|
+
rgb_accumulation = data(renderer.rgb_accumulator);
|
|
1580
|
+
frame_buffer = data(renderer.frame_buffer);
|
|
1581
|
+
}
|
|
1582
|
+
if constexpr (SPEC::HAS_OBSERVATION){
|
|
1583
|
+
observation = data(renderer.observation);
|
|
1584
|
+
}
|
|
1585
|
+
optix::overlay_accel_resolve(rgb_accumulation, frame_buffer, observation, SPEC::SHADING::SRGB_OUTPUT ? 1 : 0,
|
|
1586
|
+
(unsigned int)((size_t)SPEC::NUM_CAMERAS * SPEC::CAM_PIXELS),
|
|
1587
|
+
(unsigned int)SPEC::MOTION_BLUR_SAMPLES, cuda_stream);
|
|
1588
|
+
optix::join(device, renderer.backend->ordering_event, cuda_stream, 0);
|
|
1589
|
+
return;
|
|
1590
|
+
}
|
|
1591
|
+
if constexpr (SPEC::HAS_RGB) {
|
|
1592
|
+
OWLRayGen ray_gen = (OWLRayGen)renderer.backend->ray_gen;
|
|
1593
|
+
owlAsyncLaunch2D(ray_gen, SPEC::FB_WIDTH, SPEC::FB_HEIGHT, launch_params);
|
|
1594
|
+
}
|
|
1595
|
+
if constexpr (SPEC::HAS_DEPTH) {
|
|
1596
|
+
OWLRayGen depth_ray_gen = (OWLRayGen)renderer.backend->depth_ray_gen;
|
|
1597
|
+
owlAsyncLaunch2D(depth_ray_gen, SPEC::FB_WIDTH, SPEC::FB_HEIGHT, launch_params);
|
|
1598
|
+
}
|
|
1599
|
+
if constexpr (SPEC::HAS_SEGMENTATION) {
|
|
1600
|
+
owlAsyncLaunch2D((OWLRayGen)renderer.backend->segmentation_ray_gen, SPEC::FB_WIDTH, SPEC::FB_HEIGHT, launch_params);
|
|
1601
|
+
}
|
|
1602
|
+
if constexpr (SPEC::HAS_NORMALS) {
|
|
1603
|
+
owlAsyncLaunch2D((OWLRayGen)renderer.backend->normals_ray_gen, SPEC::FB_WIDTH, SPEC::FB_HEIGHT, launch_params);
|
|
1604
|
+
}
|
|
1605
|
+
if constexpr (SPEC::HAS_FLOW) {
|
|
1606
|
+
owlAsyncLaunch2D((OWLRayGen)renderer.backend->flow_ray_gen, SPEC::FB_WIDTH, SPEC::FB_HEIGHT, launch_params);
|
|
1607
|
+
}
|
|
1608
|
+
if constexpr (SPEC::HAS_FLOW_FORWARD) {
|
|
1609
|
+
owlAsyncLaunch2D((OWLRayGen)renderer.backend->flow_forward_ray_gen, SPEC::FB_WIDTH, SPEC::FB_HEIGHT, launch_params);
|
|
1610
|
+
}
|
|
1611
|
+
optix::join(device, renderer.backend->ordering_event, cuda_stream, 0);
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
template <typename DEVICE, typename SPEC>
|
|
1615
|
+
void render_sync(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1616
|
+
owlLaunchSync((OWLParams)renderer.backend->launch_params);
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
// render produces the image outputs the spec declares; the collision-probe pass is the
|
|
1620
|
+
// separate probe verb so it can be scheduled independently (e.g. alongside update)
|
|
1621
|
+
template <typename DEVICE, typename SPEC>
|
|
1622
|
+
void probe_launch(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1623
|
+
namespace optix = rendering::raytracing::backends::optix;
|
|
1624
|
+
if(renderer.backend->collision_ray_gen){
|
|
1625
|
+
OWLRayGen collision_ray_gen = (OWLRayGen)renderer.backend->collision_ray_gen;
|
|
1626
|
+
OWLParams coll_lp = (OWLParams)renderer.backend->coll_launch_params;
|
|
1627
|
+
cudaStream_t coll_stream = (cudaStream_t)owlParamsGetCudaStream(coll_lp, 0);
|
|
1628
|
+
optix::fork(device, renderer.backend->ordering_event, coll_stream, 0);
|
|
1629
|
+
owlAsyncLaunch2D(collision_ray_gen, SPEC::NUM_CAMERAS, SPEC::NUM_PROBES, coll_lp);
|
|
1630
|
+
optix::join(device, renderer.backend->ordering_event, coll_stream, 0);
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
template <typename DEVICE, typename SPEC>
|
|
1635
|
+
void probe_sync(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1636
|
+
if(renderer.backend->coll_launch_params)
|
|
1637
|
+
owlLaunchSync((OWLParams)renderer.backend->coll_launch_params);
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
// the device rows {active, object} every overlay build reads: a producer may rewrite the object
|
|
1641
|
+
// of an active row, and update() overwrites a row from host truth only when the host marked
|
|
1642
|
+
// its overlay dirty
|
|
1643
|
+
template <typename DEVICE, typename SPEC>
|
|
1644
|
+
rendering::raytracing::backends::optix::OverlaySlotStructure* overlay_structure(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1645
|
+
static_assert(SPEC::ENABLE_OVERLAYS, "overlay_structure requires an overlay-enabled renderer specification");
|
|
1646
|
+
auto* overlay_state = (rendering::raytracing::backends::optix::OverlayState*)renderer.backend->overlay_state;
|
|
1647
|
+
return rendering::raytracing::backends::optix::overlay_accel_structure(overlay_state->accel);
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
template <typename DEVICE, typename SPEC>
|
|
1651
|
+
std::string device_name(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1652
|
+
cudaPointerAttributes attributes{};
|
|
1653
|
+
utils::assert_exit(device, cudaPointerGetAttributes(&attributes, data(renderer.cameras)) == cudaSuccess, "OptiX: cannot identify renderer device");
|
|
1654
|
+
cudaDeviceProp properties{};
|
|
1655
|
+
utils::assert_exit(device, cudaGetDeviceProperties(&properties, attributes.device) == cudaSuccess, "OptiX: cannot query renderer device");
|
|
1656
|
+
return properties.name;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
// scoped to the renderer's own streams — never a whole-device barrier
|
|
1660
|
+
template <typename DEVICE, typename SPEC>
|
|
1661
|
+
void synchronize(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1662
|
+
rendering::raytracing::backends::optix::synchronize(renderer.device);
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
template <typename DEVICE, typename SPEC>
|
|
1666
|
+
void free(DEVICE& device, rendering::raytracing::Renderer<SPEC, rendering::raytracing::backends::Optix>& renderer){
|
|
1667
|
+
log(device, device.logger, devices::logging::Verbosity::debug, rendering::raytracing::LOG_PREFIX, "destroying devicegroups ...");
|
|
1668
|
+
if(renderer.backend != nullptr){
|
|
1669
|
+
if(renderer.backend->context != nullptr && renderer.backend->library == nullptr){
|
|
1670
|
+
owlContextDestroy((OWLContext)renderer.backend->context); // library-backed renderers borrow the context — the library destroys it
|
|
1671
|
+
}
|
|
1672
|
+
if(renderer.backend->overlay_state != nullptr){
|
|
1673
|
+
auto* overlay_state = (rendering::raytracing::backends::optix::OverlayState*)renderer.backend->overlay_state;
|
|
1674
|
+
rendering::raytracing::backends::optix::overlay_accel_destroy(overlay_state->accel);
|
|
1675
|
+
cudaFree(overlay_state->row_indices_device);
|
|
1676
|
+
cudaFree(overlay_state->rows_device);
|
|
1677
|
+
delete overlay_state;
|
|
1678
|
+
}
|
|
1679
|
+
if(renderer.backend->shutter_device != nullptr){
|
|
1680
|
+
cudaFree(renderer.backend->shutter_device);
|
|
1681
|
+
}
|
|
1682
|
+
if(renderer.backend->ordering_event != nullptr){
|
|
1683
|
+
cudaEventDestroy(renderer.backend->ordering_event);
|
|
1684
|
+
}
|
|
1685
|
+
delete renderer.backend;
|
|
1686
|
+
renderer.backend = nullptr;
|
|
1687
|
+
renderer.device.state = nullptr;
|
|
1688
|
+
}
|
|
1689
|
+
if constexpr (SPEC::ENABLE_OVERLAYS){
|
|
1690
|
+
if(renderer.transforms._data != nullptr){
|
|
1691
|
+
cudaFree(renderer.transforms._data);
|
|
1692
|
+
renderer.transforms._data = nullptr;
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
if constexpr (SPEC::HAS_FLOW_OVERLAYS){
|
|
1696
|
+
if(renderer.transforms_previous._data != nullptr){
|
|
1697
|
+
cudaFree(renderer.transforms_previous._data);
|
|
1698
|
+
renderer.transforms_previous._data = nullptr;
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
if constexpr (SPEC::ENABLE_DYNAMIC_MOTION_BLUR){
|
|
1702
|
+
if(renderer.transforms_motion._data != nullptr){
|
|
1703
|
+
cudaFree(renderer.transforms_motion._data);
|
|
1704
|
+
renderer.transforms_motion._data = nullptr;
|
|
1705
|
+
}
|
|
1706
|
+
if constexpr (SPEC::HAS_RGB){
|
|
1707
|
+
renderer.rgb_accumulator._data = nullptr;
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
// the input and output tensors alias OWL buffers destroyed with the context
|
|
1711
|
+
renderer.cameras._data = nullptr;
|
|
1712
|
+
if constexpr (SPEC::HAS_CAMERA_PAIR) {
|
|
1713
|
+
renderer.cameras_open._data = nullptr;
|
|
1714
|
+
}
|
|
1715
|
+
if constexpr (SPEC::HAS_RGB) {
|
|
1716
|
+
renderer.frame_buffer._data = nullptr;
|
|
1717
|
+
}
|
|
1718
|
+
if constexpr (SPEC::HAS_DEPTH) {
|
|
1719
|
+
renderer.depth_buffer._data = nullptr;
|
|
1720
|
+
}
|
|
1721
|
+
if constexpr (SPEC::HAS_SEGMENTATION) {
|
|
1722
|
+
renderer.segmentation_buffer._data = nullptr;
|
|
1723
|
+
}
|
|
1724
|
+
if constexpr (SPEC::HAS_NORMALS) {
|
|
1725
|
+
renderer.normals_buffer._data = nullptr;
|
|
1726
|
+
}
|
|
1727
|
+
if constexpr (SPEC::HAS_FLOW) {
|
|
1728
|
+
renderer.cameras_previous._data = nullptr;
|
|
1729
|
+
renderer.flow_buffer._data = nullptr;
|
|
1730
|
+
renderer.flow_status_buffer._data = nullptr;
|
|
1731
|
+
}
|
|
1732
|
+
if constexpr (SPEC::HAS_FLOW_FORWARD) {
|
|
1733
|
+
renderer.flow_forward_buffer._data = nullptr;
|
|
1734
|
+
renderer.flow_forward_status_buffer._data = nullptr;
|
|
1735
|
+
}
|
|
1736
|
+
if constexpr (SPEC::HAS_OBSERVATION) {
|
|
1737
|
+
renderer.observation._data = nullptr;
|
|
1738
|
+
}
|
|
1739
|
+
renderer.collision_results._data = nullptr;
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
RL_TOOLS_NAMESPACE_WRAPPER_END
|
|
1743
|
+
|
|
1744
|
+
|
|
1745
|
+
#include "../../operations_cpu_post.h"
|
|
1746
|
+
|
|
1747
|
+
#endif
|