Core API changes to allow batch queries with XDG (PR 1)#191
Closed
Waqar-ukaea wants to merge 8 commits intoxdg-org:mainfrom
Closed
Core API changes to allow batch queries with XDG (PR 1)#191Waqar-ukaea wants to merge 8 commits intoxdg-org:mainfrom
Waqar-ukaea wants to merge 8 commits intoxdg-org:mainfrom
Conversation
This was referenced Jan 30, 2026
Collaborator
Author
|
Closing in favour of the newer PR which has a cleaner code split and includes tests. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Note merging of this PR is a prerequisite for the following PRs:
This PR adds core XDG support for batched GPRT ray queries, enabling both
ray_fire()andpoint_in_volume()to run over many rays efficiently.It introduces three query paths to GPRT ray tracing:
To support the prepared workflow, this PR also adds a ray/hit buffer abstraction and the callback plumbing required for external ray population. The required stubs for Embree are in place for compilation but the majority of these functions will only ever work with a GPU capable RT backend.
Public API Changes
GPRTRayTracer(new / overridden)Point-in-volume
point_in_volume(...)— batched PIV over points (optional directions and exclude list).point_in_volume_prepared(...)— run PIV using pre-populated device buffers.Ray fire
ray_fire(...)— batched ray fire over origins/directions (with distance limit, orientation, optional exclude list).ray_fire_prepared(...)— run ray fire using pre-populated device buffers.Buffer / workflow plumbing
check_rayhit_buffer_capacity(...)— ensure device buffers can accommodateNrays.populate_rays_external(...)— callback-based external ray population (device-only path).download_hits(...)— download hits into host-side storage (utility).GPRT backend accessors
context()— access the underlying GPRT context. Currently required since GPRT does not implementVK_EXTERNAL_MEMORYas of yet. So to mock an external application, I use "external" compute shaders attached to the same underlying GPRTContext.RayTracerinterface (new virtuals)Adds virtual entry points for batched and prepared workflows:
point_in_volume(...)ray_fire(...)point_in_volume_prepared(...)ray_fire_prepared(...)check_rayhit_buffer_capacity(...)populate_rays_external(...)XDGAPI (new overloads / helpers)Batched launch
ray_fire(...)— volume-level overload for batched ray fire.Prepared / device-only workflow
ray_fire_prepared(...)point_in_volume_prepared(...)populate_rays_external(...)Host transfer
transfer_hits_buffer_to_host(...)— transfer prepared hit buffers back to host.