[PR2] Implemented a set of methods for directly populating ray buffers on device with GPRT#196
Open
Waqar-ukaea wants to merge 65 commits intoxdg-org:mainfrom
Open
[PR2] Implemented a set of methods for directly populating ray buffers on device with GPRT#196Waqar-ukaea wants to merge 65 commits intoxdg-org:mainfrom
Waqar-ukaea wants to merge 65 commits intoxdg-org:mainfrom
Conversation
…constants across all rays
…irectly via an "external" compute shader
Added a code path that involves populating GPRT rays via a callback and firing against these pre-populated rays with `xdg::ray_fire_prepared()`
…er access behind XDG_ENABLE_GPRT
8768e60 to
0988883
Compare
0988883 to
ea3d53c
Compare
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
This PR adds additional methods for GPU based ray queries. Specifically, an API for filling ray buffers from an external application and launching against those pre-populated rays:
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.
The expected workflow here is something like:
This avoids unnecessary host-device transfers by allowing users to write directly to XDG's device buffers without any host-side transfers. An example of how the ray buffers can be populated via slang shader can be found in :
Another important aspect of this code path is the ability to specify a different volume to trace against per ray.
Public API Changes
GPRTRayTracer(new / overridden)Point-in-volume
point_in_volume_prepared(...)— run PIV using pre-populated device buffers.Ray fire
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).get_device_rayhit_buffers(...)— return opaque device rayhit buffers structGPRT 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.download_hits(...)— download hits into host-side storage (utility).RayTracerinterface (new virtuals)Adds virtual entry points for batched and prepared workflows:
point_in_volume_prepared(...)ray_fire_prepared(...)check_rayhit_buffer_capacity(...)populate_rays_external(...)XDGAPI (new overloads / helpers)Prepared / device-only workflow
ray_fire_prepared(...)point_in_volume_prepared(...)populate_rays_external(...)