-
Notifications
You must be signed in to change notification settings - Fork 14
GPRT integration #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
GPRT integration #94
Changes from all commits
Commits
Show all changes
114 commits
Select commit
Hold shift + click to select a range
306d8ac
added gprt submodule
Waqar-ukaea 5937aec
Add gprt_test tool and remove GPRT stubs from constants.h
Waqar-ukaea c4069fc
Working GPRT raygen sample built as an XDG tool
Waqar-ukaea de9e446
gprt-test now creates an XDG instance from a file passed into the pro…
Waqar-ukaea 14b5c7c
Add GPRT apt packages and Vulkan SDK install to CI
pshriwise e196f8e
Add GPRT dependencies to OpenMC test workflow as well
pshriwise 0d25170
Swapped out the GPRT sample to a slightly more complex one
Waqar-ukaea b6d10bb
Reverting changes to the OpenMC test GHA workflow
pshriwise b539f06
Restructured tools to build gprt tools independently
Waqar-ukaea 6b3b52c
Started on adding GPRT concrete interface
Waqar-ukaea b2de2c4
Copiedh5m-reader structs with new GPRT API types
Waqar-ukaea 13f716f
Moved GPRTRaytracer method declarations into XDG namespace
Waqar-ukaea ae2d408
Link gprt at build time to avoid CMake error
Waqar-ukaea 9a8787f
Added some stub methods for the GPRTRayTracer so XDG builds
Waqar-ukaea 95c364d
Attempting to GPRT render triangle mesh from XDG
Waqar-ukaea 75b5969
Updated SharedCode.h to use h5m-reader version
Waqar-ukaea 92a48b6
Make camera zoom static but far out
Waqar-ukaea 52c14a0
Better connectivities but coords still off
Waqar-ukaea c3da04e
Working single precision ray tracing against MOAB mesh
Waqar-ukaea a2e82f5
Added a method to return the world bounding box
Waqar-ukaea 4c7db76
Messing about with the camera settings
Waqar-ukaea d4e37fe
Started on implementation of GPRT::ray_fire()
Waqar-ukaea 53b7f48
Added methods for setting up GPRT structures
Waqar-ukaea 5905a01
Updated XDG::create() to make instantiation with GPRT possible
Waqar-ukaea 2b6fcdc
Create a BLAS for each surface and TLAS for each volume
Waqar-ukaea 200e2f2
Somewhat working GPRTRayTracer
Waqar-ukaea 4caae5b
Setting up XDG for use with GPRT
Waqar-ukaea 022dd62
Added missing sharedCode.h needed for deviceCode
Waqar-ukaea 1b93d7d
Added a ray_fire test for GPRT
Waqar-ukaea 54b8c96
Removed shader code for 2dRayGen copied over from gprt-test
Waqar-ukaea 33bdc4b
Remove destructors causing double free issues
Waqar-ukaea ac76e3b
Added create_world_tlas() to ray_tracing_interface base
Waqar-ukaea e36add9
Working ray_fire() - missing ability to choose intersection orientations
Waqar-ukaea c7ec9b4
Correctly store sense/orientation in push_constants
Waqar-ukaea 7702428
Nearly have exclude_primitives working
Waqar-ukaea 5620cce
Working point_in_vol() except on volume boundary
Waqar-ukaea 1178030
Add the ability to set multiple closesthit shaders to the same geometry
Waqar-ukaea 7bf5f2a
Make GPRTRayTracer::render_mesh() a standalone method + camera fixes
Waqar-ukaea cc7a0fc
Added the ability to specify RT library in ray_fire tool
Waqar-ukaea 4777171
TraceRay in render shaders now uses correct miss shader
Waqar-ukaea 938e10e
Refactored register_volume to create a single BLAS per surface
Waqar-ukaea ff75211
Updated ray_fire and point_in_volume tools to be able to run with GPRT
Waqar-ukaea 5a6558a
Added double precision structs to shared code
Waqar-ukaea d037e01
Updated CMakeLists.txt to build/install dbl shaders as well as flt
Waqar-ukaea fecc9f7
Added array<double> aliases for double3/double4 internally to xdg
Waqar-ukaea 2dba1b5
Added a compute shader to get AABB bounds
Waqar-ukaea 834fc18
Extending GPRT vectors to support dbl precision internally to XDG
Waqar-ukaea c3ca998
Updated sharedCode.h to remove double precision definitions
Waqar-ukaea 906c8ff
Compiling but rays are always missing AABBs
Waqar-ukaea d08575c
Custom intersection shader is being called but returning early
Waqar-ukaea 2dde2a7
Store double hitDistance on mesh record
Waqar-ukaea e541626
Agreement between Embree and GPRT ray-fire hitdistances
Waqar-ukaea 88f7010
Working double precision point_in_vol
Waqar-ukaea d7b2cd5
Removed old cmake target
Waqar-ukaea b45a65a
Fixed transfer of tMin and tMax into intersection shader
Waqar-ukaea 5fc3bdd
exclude_primitives looks like its working and now ray_fire tests are …
Waqar-ukaea 534f3ce
Fixed plucker coord calculation for GPRT
Waqar-ukaea 0ac6a7f
Implemented per primitive sense tagging which has fixed ray-fire and …
Waqar-ukaea a19e816
GPRTRayTracer working with particle sim! Ready for review/merge into …
Waqar-ukaea eb4954d
Fixed all the issues which arose after rebasing
Waqar-ukaea f4294c6
Removed some redundant files and added a slang compilation guard to s…
Waqar-ukaea 35fe1e6
Removed structs required for single precision ray tracing
Waqar-ukaea cfda39a
Removed last remnants of single precision logic in GPRTRayTracer
Waqar-ukaea 3e84c2a
Added a function to query which RT library is in use
Waqar-ukaea 44e543e
Consistent usage of signed ints for MeshIDs between host and device code
Waqar-ukaea 24192af
Resolved a bunch of minor review comments
Waqar-ukaea 6dffa8b
Added a guard to ensure at least one RT library is enabled
Waqar-ukaea 5ee1cf6
Implemented create_global_surface_tree() and minor cleanups from code…
Waqar-ukaea 0fdd394
Removed redundant constants from sharedCode.h header
Waqar-ukaea 7b15ce4
Removed unecessary nesting in orientation checks for plucker coords
Waqar-ukaea 2ff3ced
Removed unnecessary implementations of double3 cross product operator…
Waqar-ukaea 7af77f0
Update for GPRTRayTracer to better mirror EmbreeRayTracer in global_s…
Waqar-ukaea a940a55
Fixed library handling for tools given GPRT doesn't work with GPRT yet
Waqar-ukaea 535db32
Removed redundant init() calls from tests
Waqar-ukaea a969b31
Removed calls to create_element_tree() since its not implemented for …
Waqar-ukaea c2842bb
Removed GPRT-renderer to be added in a separate PR
Waqar-ukaea 7d70bf5
More robust compile guards for when GPRT is not enabled
Waqar-ukaea 79b2eb5
Refactored ray-fire and point-in-volume tests
Waqar-ukaea 01a6c25
Refactored test_moab tests to avoid code duplication
Waqar-ukaea 7aaa601
Kept more descriptive test comments
Waqar-ukaea c458d4c
Fixed linker errors happeneing when GPRT enabled
Waqar-ukaea bb00d6d
Added missing gprt headers to test_moab
Waqar-ukaea 8d74828
Adding options to simplify test generation
pshriwise ec8174b
Removed redundant preprocessor guards
Waqar-ukaea 089ace1
Create header stubs to consolidate perprocessor statements
pshriwise 900b892
Fixed variable spacing
Waqar-ukaea c0bc1f8
Moved create_raytracer helper to util.h
Waqar-ukaea 2b3a0a9
Refactored ray tracing interface tests to make use of Catch2 GENERATORS
Waqar-ukaea 721cbf4
Reverting back to GENERATE approach for test cases
Waqar-ukaea 31f49ac
Adding fmt formatters for mesh and ray tracing libraries
pshriwise 3462c17
Switched to latest GPRT commit for subproject
Waqar-ukaea acc09a5
Remove GPRT linkage in tools since renderer has been removed from thi…
Waqar-ukaea e2f78be
Updated shaders and BVH setup to comply with latest GPRT API
Waqar-ukaea 43d25e7
Removed internal double vector types which are now included with late…
Waqar-ukaea 639c888
Aligning code across multiple lines for argparse
Waqar-ukaea c357299
Added new GPRT synchronise functions to ensure shader fully complete …
Waqar-ukaea 29e3c2c
Added extra GPRT cleanup calls to GPRTRayTracer destructor
Waqar-ukaea 10527f2
Use consistent generator pattern within all multi-backend tests
Waqar-ukaea 5a7a0bb
Fixed indentation in GPRTRayTracer definition
Waqar-ukaea 586d888
Ensure double3 vectors use [] operators instead of .x .y .z member ac…
Waqar-ukaea 20fdf90
Fixed ray tracing queries so that Shader Binding Table is only built …
Waqar-ukaea 6bca3b3
Refactor shared structs and enums into separate headers, since enums …
Waqar-ukaea 69a554f
Final round of code review changes
Waqar-ukaea 00f2716
Update include location in constants.h
pshriwise 062201c
Attempting to fix CI
Waqar-ukaea cfbf66b
Adding xdg namespacing to shared_enums
Waqar-ukaea d37aaf1
Set XDG_ENABLE_LIBMESH=ON for CI
Waqar-ukaea b52f867
Switch to build GPRT as a shared library
Waqar-ukaea c163b2d
Added a function to probe if there is a vulkan device available on th…
Waqar-ukaea b02c138
Update GPRT submodule to latest commit
Waqar-ukaea c1399d5
Re-enable CI tests now that vk probe is in place
Waqar-ukaea d5b6733
Moved check_ray_tracer_supported into DYNAMIC_SECTION for clearer rep…
Waqar-ukaea 71310cf
Fixed system_has_vk_device() check to actually return true if we have…
Waqar-ukaea 97cf5b1
Added --allow-running-no-tests to ensure SKIPPED tests not marked as …
Waqar-ukaea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| #ifndef _XDG_GPRT_BASE_RAY_TRACING_INTERFACE_H | ||
| #define _XDG_GPRT_BASE_RAY_TRACING_INTERFACE_H | ||
|
|
||
| #include <memory> | ||
| #include <vector> | ||
| #include <unordered_map> | ||
|
|
||
| #include "xdg/constants.h" | ||
| #include "xdg/mesh_manager_interface.h" | ||
| #include "xdg/primitive_ref.h" | ||
| #include "xdg/geometry_data.h" | ||
| #include "xdg/ray_tracing_interface.h" | ||
| #include "xdg/ray.h" | ||
| #include "xdg/error.h" | ||
| #include "gprt/gprt.h" | ||
| #include "shared_structs.h" | ||
|
|
||
| extern GPRTProgram dbl_deviceCode; | ||
| namespace xdg { | ||
|
|
||
| class GPRTRayTracer : public RayTracer { | ||
| public: | ||
| GPRTRayTracer(); | ||
| ~GPRTRayTracer(); | ||
| RTLibrary library() const override { return RTLibrary::GPRT; } | ||
|
|
||
| void set_geom_data(const std::shared_ptr<MeshManager> mesh_manager); | ||
| void init() override; | ||
|
|
||
| // Setup the different shader programs for use with this ray tracer | ||
| void setup_shaders(); | ||
|
|
||
| MeshID find_element(const Position& point) const override | ||
| { | ||
| fatal_error("Element trees not currently supported with GPRT ray tracer"); | ||
| return ID_NONE; | ||
| }; | ||
|
|
||
| MeshID find_element(TreeID tree, const Position& point) const override { | ||
| fatal_error("Element trees not currently supported with GPRT ray tracer"); | ||
| return ID_NONE; | ||
| }; | ||
|
|
||
| std::pair<TreeID, TreeID> | ||
| register_volume(const std::shared_ptr<MeshManager>& mesh_manager, | ||
| MeshID volume) override; | ||
|
|
||
| TreeID create_surface_tree(const std::shared_ptr<MeshManager>& mesh_manager, | ||
| MeshID volume) override; | ||
|
|
||
|
Waqar-ukaea marked this conversation as resolved.
|
||
| TreeID create_element_tree(const std::shared_ptr<MeshManager>& mesh_manager, | ||
| MeshID volume) override; | ||
|
|
||
| void create_global_surface_tree() override; | ||
|
|
||
| void create_global_element_tree() override | ||
| { | ||
| warning("Global element trees not currently supported with GPRT ray tracer"); | ||
| return; | ||
| }; | ||
|
|
||
| bool point_in_volume(TreeID scene, | ||
| const Position& point, | ||
| const Direction* direction = nullptr, | ||
| const std::vector<MeshID>* exclude_primitives = nullptr) const override; | ||
|
|
||
| std::pair<double, MeshID> ray_fire(TreeID scene, | ||
| const Position& origin, | ||
| const Direction& direction, | ||
| const double dist_limit = INFTY, | ||
| HitOrientation orientation = HitOrientation::EXITING, | ||
| std::vector<MeshID>* const exclude_primitives = nullptr) override; | ||
|
|
||
| void closest(TreeID scene, | ||
| const Position& origin, | ||
| double& dist, | ||
| MeshID& triangle) override {}; | ||
| void closest(TreeID scene, | ||
| const Position& origin, | ||
| double& dist) override {}; | ||
|
|
||
| bool occluded(TreeID scene, | ||
| const Position& origin, | ||
| const Direction& direction, | ||
| double& dist) const override { | ||
| fatal_error("Occlusion queries are not currently supported with GPRT ray tracer"); | ||
| return false; | ||
| } | ||
|
|
||
| private: | ||
| // GPRT objects | ||
| GPRTContext context_; | ||
| GPRTProgram deviceCode_; // device code for float precision shaders | ||
| GPRTModule module_; // device code module for single precision shaders | ||
| GPRTAccel world_; | ||
| GPRTBuildParams buildParams_; //<! Build parameters for acceleration structures | ||
|
|
||
| // Shader programs | ||
| GPRTRayGenOf<dblRayGenData> rayGenProgram_; | ||
| GPRTRayGenOf<dblRayGenData> rayGenPointInVolProgram_; | ||
| GPRTMissOf<void> missProgram_; | ||
| GPRTComputeOf<DPTriangleGeomData> aabbPopulationProgram_; //<! AABB population program for double precision rays | ||
|
|
||
| // Buffers | ||
| GPRTBufferOf<dblRayInput> rayInputBuffer_; //<! Ray buffer for ray generation | ||
| GPRTBufferOf<dblRayOutput> rayOutputBuffer_; //<! Ray output buffer for ray generation | ||
| GPRTBufferOf<int32_t> excludePrimitivesBuffer_; //<! Buffer for excluded primitives | ||
|
|
||
| // Geometry Type and Instances | ||
| std::vector<gprt::Instance> globalBlasInstances_; //<! List of every BLAS instance stored in this ray tracer | ||
| GPRTGeomTypeOf<DPTriangleGeomData> trianglesGeomType_; //<! Geometry type for triangles | ||
|
|
||
| // Ray Generation parameters | ||
| size_t numRays = 1; //<! Number of rays to be cast | ||
| uint32_t numRayTypes_ = 1; // <! Number of ray types. Allows multiple shaders to be set to the same geometery | ||
|
|
||
| // Mesh-to-Scene maps | ||
| std::map<MeshID, GPRTGeomOf<DPTriangleGeomData>> surface_to_geometry_map_; //<! Map from mesh surface to embree geometry | ||
|
|
||
| // Internal GPRT Mappings | ||
| std::unordered_map<SurfaceTreeID, GPRTAccel> surface_volume_tree_to_accel_map; // Map from XDG::TreeID to GPRTAccel for volume TLAS | ||
| std::vector<GPRTAccel> blas_handles_; // Store BLAS handles so that they can be explicitly referenced in destructor | ||
|
|
||
| // Global Tree IDs | ||
| GPRTAccel global_surface_accel_ {nullptr}; | ||
| GPRTAccel global_element_accel_ {nullptr}; | ||
|
|
||
| }; | ||
|
|
||
| } // namespace xdg | ||
|
|
||
| #endif // include guard | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that this isn't straightfoward to figure out, but these days we really shouldn't need to set this environment variable for a CMake project. For now I'll create an issue so we don't lose track of it.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I previously assumed this wasn't too much of an issue, more so from a place of ignorance in not really being familiar with RPATHs. But after having done some reading, I agree we should hold off on merging until I figure this one out too.