GPRT Host API Complete Reference
This toolkit has two sets of API, one for the “host” (typically referring to the CPU) and another for the “device” (normally the GPU, but really whatever is tracing the actual rays). This file contains a complete list of all of the host-side functions provided by the toolkit.
Core Functions
-
GPRTContext gprtContextCreate(int32_t *requestedDeviceIDs, int numDevices)
creates a new device context with the gives list of devices.
If requested device IDs list if null it implicitly refers to the list “0,1,2,….”; if numDevices <= 0 it automatically refers to “all devices you can find”. Examples:
gprtContextCreate(nullptr,1) creates one device on the first GPU
gprtContextCreate(nullptr,0) creates a context across all GPUs in the system
int gpu=2;gprtContextCreate(&gpu,1) will create a context on GPU #2 (where 2 refers to the vulkan device ordinal; from that point on, from gprt’s standpoint (eg, during gprtBufferGetHostPointer() this GPU will from that point on be known as device #0
-
void gprtContextDestroy(GPRTContext context)
-
GPRTModule gprtModuleCreate(GPRTContext context, GPRTProgram spvCode)
-
void gprtModuleDestroy(GPRTModule module)
Warning
doxygenfunction: Cannot find function “gprtBuildPipeline” in doxygen xml output for project “gprt” from directory: ../../build/xml/
-
void gprtBuildShaderBindingTable(GPRTContext context, GPRTBuildSBTFlags flags)
-
void gprtBeginProfile(GPRTContext context)
-
float gprtEndProfile(GPRTContext context)
Buffer Functions
Warning
doxygenfunction: Unable to resolve function “gprtHostBufferCreate” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- GPRTBuffer gprtHostBufferCreate(GPRTContext context, size_t size, size_t count = 1, const void *init = nullptr, size_t alignment = 16)
- template<typename T> GPRTBufferOf<T> gprtHostBufferCreate(GPRTContext context, size_t count = 1, const T *init = nullptr, size_t alignment = 16)
Warning
doxygenfunction: Unable to resolve function “gprtDeviceBufferCreate” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- GPRTBuffer gprtDeviceBufferCreate(GPRTContext context, size_t size, size_t count = 1, const void *init = nullptr, size_t alignment = 16)
- template<typename T> GPRTBufferOf<T> gprtDeviceBufferCreate(GPRTContext context, size_t count = 1, const T *init = nullptr, size_t alignment = 16)
Warning
doxygenfunction: Unable to resolve function “gprtSharedBufferCreate” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- GPRTBuffer gprtSharedBufferCreate(GPRTContext context, size_t size, size_t count = 1, const void *init = nullptr, size_t alignment = 16)
- template<typename T> GPRTBufferOf<T> gprtSharedBufferCreate(GPRTContext context, size_t count = 1, const T *init = nullptr, size_t alignment = 16)
Warning
doxygenfunction: Unable to resolve function “gprtBufferDestroy” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename T> void gprtBufferDestroy(GPRTBufferOf<T> buffer)
- void gprtBufferDestroy(GPRTBuffer buffer)
Warning
doxygenfunction: Unable to resolve function “gprtBufferMap” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename T> void gprtBufferMap(GPRTBufferOf<T> buffer, int deviceID)
- void gprtBufferMap(GPRTBuffer buffer, int deviceID)
Warning
doxygenfunction: Unable to resolve function “gprtBufferUnmap” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename T> void gprtBufferUnmap(GPRTBufferOf<T> buffer, int deviceID)
- void gprtBufferUnmap(GPRTBuffer buffer, int deviceID)
Warning
doxygenfunction: Cannot find function “gprtBufferGetPointer” in doxygen xml output for project “gprt” from directory: ../../build/xml/
Ray Generation Core Functions
Warning
doxygenfunction: Unable to resolve function “gprtRayGenCreate” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- GPRTRayGen gprtRayGenCreate(GPRTContext context, GPRTModule module, const char *entrypoint, size_t recordSize)
- template<typename T> GPRTRayGenOf<T> gprtRayGenCreate(GPRTContext context, GPRTModule module, const char *entrypoint)
Warning
doxygenfunction: Unable to resolve function “gprtRayGenDestroy” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename T> void gprtRayGenDestroy(GPRTRayGenOf<T> rayGen)
- void gprtRayGenDestroy(GPRTRayGen rayGen)
Warning
doxygenfunction: Unable to resolve function “gprtRayGenLaunch1D” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename RecordType, typename PushConstantsType> void gprtRayGenLaunch1D(GPRTContext context, GPRTRayGenOf<RecordType> rayGen, uint32_t dims_x, PushConstantsType pushConstants)
- template<typename RecordType> void gprtRayGenLaunch1D(GPRTContext context, GPRTRayGenOf<RecordType> rayGen, uint32_t dims_x)
- void gprtRayGenLaunch1D(GPRTContext context, GPRTRayGen rayGen, uint32_t dims_x, size_t pushConstantsSize, void *pushConstants)
Warning
doxygenfunction: Unable to resolve function “gprtRayGenLaunch2D” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename RecordType, typename PushConstantsType> void gprtRayGenLaunch2D(GPRTContext context, GPRTRayGenOf<RecordType> rayGen, uint32_t dims_x, uint32_t dims_y, PushConstantsType pushConstants)
- template<typename RecordType> void gprtRayGenLaunch2D(GPRTContext context, GPRTRayGenOf<RecordType> rayGen, uint32_t dims_x, uint32_t dims_y)
- void gprtRayGenLaunch2D(GPRTContext context, GPRTRayGen rayGen, uint32_t dims_x, uint32_t dims_y, size_t pushConstantsSize, void *pushConstants)
Warning
doxygenfunction: Unable to resolve function “gprtRayGenLaunch3D” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename RecordType, typename PushConstantsType> void gprtRayGenLaunch3D(GPRTContext context, GPRTRayGenOf<RecordType> rayGen, uint32_t dims_x, uint32_t dims_y, uint32_t dims_z, PushConstantsType pushConstants)
- template<typename RecordType> void gprtRayGenLaunch3D(GPRTContext context, GPRTRayGenOf<RecordType> rayGen, uint32_t dims_x, uint32_t dims_y, uint32_t dims_z)
- void gprtRayGenLaunch3D(GPRTContext context, GPRTRayGen rayGen, uint32_t dims_x, uint32_t dims_y, uint32_t dims_z, size_t pushConstantsSize, void *pushConstants)
Compute Program Core Functions
Warning
doxygenfunction: Unable to resolve function “gprtComputeCreate” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- GPRTCompute gprtComputeCreate(GPRTContext context, GPRTModule module, const char *entrypoint)
- template<typename ...Uniforms> GPRTComputeOf<Uniforms...> gprtComputeCreate(GPRTContext context, GPRTModule module, std::string entrypoint)
Warning
doxygenfunction: Unable to resolve function “gprtComputeDestroy” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename ...Uniforms> void gprtComputeDestroy(GPRTComputeOf<Uniforms...> compute)
- void gprtComputeDestroy(GPRTCompute compute)
Warning
doxygenfunction: Cannot find function “gprtComputeLaunch1D” in doxygen xml output for project “gprt” from directory: ../../build/xml/
Warning
doxygenfunction: Cannot find function “gprtComputeLaunch2D” in doxygen xml output for project “gprt” from directory: ../../build/xml/
Warning
doxygenfunction: Cannot find function “gprtComputeLaunch3D” in doxygen xml output for project “gprt” from directory: ../../build/xml/
Miss Program Core Functions
Warning
doxygenfunction: Unable to resolve function “gprtMissCreate” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- GPRTMiss gprtMissCreate(GPRTContext context, GPRTModule module, const char *entrypoint, size_t recordSize)
- template<typename T> GPRTMissOf<T> gprtMissCreate(GPRTContext context, GPRTModule module, const char *entrypoint)
Warning
doxygenfunction: Unable to resolve function “gprtMissDestroy” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename T> void gprtMissDestroy(GPRTMissOf<T> missProg)
- void gprtMissDestroy(GPRTMiss missProg)
Warning
doxygenfunction: Unable to resolve function “gprtMissSet” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename T> void gprtMissSet(GPRTContext context, int rayType, GPRTMissOf<T> missProgToUse)
- void gprtMissSet(GPRTContext context, int rayType, GPRTMiss missProgToUse)
Hit Group Core Functions
Warning
doxygenfunction: Unable to resolve function “gprtGeomTypeCreate” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- GPRTGeomType gprtGeomTypeCreate(GPRTContext context, GPRTGeomKind kind, size_t recordSize)
- template<typename T> GPRTGeomTypeOf<T> gprtGeomTypeCreate(GPRTContext context, GPRTGeomKind kind)
Warning
doxygenfunction: Unable to resolve function “gprtGeomTypeDestroy” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename T> void gprtGeomTypeDestroy(GPRTGeomTypeOf<T> geomType)
- void gprtGeomTypeDestroy(GPRTGeomType geomType)
Warning
doxygenfunction: Unable to resolve function “gprtGeomTypeSetClosestHitProg” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename T> void gprtGeomTypeSetClosestHitProg(GPRTGeomTypeOf<T> type, int rayType, GPRTModule module, const char *entrypoint)
- void gprtGeomTypeSetClosestHitProg(GPRTGeomType type, int rayType, GPRTModule module, const char *entrypoint)
Warning
doxygenfunction: Unable to resolve function “gprtGeomTypeSetAnyHitProg” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename T> void gprtGeomTypeSetAnyHitProg(GPRTGeomTypeOf<T> type, int rayType, GPRTModule module, const char *entrypoint)
- void gprtGeomTypeSetAnyHitProg(GPRTGeomType type, int rayType, GPRTModule module, const char *entrypoint)
Warning
doxygenfunction: Unable to resolve function “gprtGeomTypeSetIntersectionProg” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename T> void gprtGeomTypeSetIntersectionProg(GPRTGeomTypeOf<T> type, int rayType, GPRTModule module, const char *entrypoint)
- void gprtGeomTypeSetIntersectionProg(GPRTGeomType type, int rayType, GPRTModule module, const char *entrypoint)
Geometry Functions
Warning
doxygenfunction: Unable to resolve function “gprtGeomCreate” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- GPRTGeom gprtGeomCreate(GPRTContext context, GPRTGeomType type)
- template<typename T> GPRTGeomOf<T> gprtGeomCreate(GPRTContext context, GPRTGeomTypeOf<T> type)
Warning
doxygenfunction: Unable to resolve function “gprtGeomDestroy” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename T> void gprtGeomDestroy(GPRTGeomOf<T> geometry)
- void gprtGeomDestroy(GPRTGeom geometry)
Warning
doxygenfunction: Unable to resolve function “gprtTrianglesSetVertices” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename T1, typename T2> void gprtTrianglesSetVertices(GPRTGeomOf<T1> triangles, GPRTBufferOf<T2> vertices, uint32_t count, uint32_t stride, uint32_t offset)
- void gprtTrianglesSetVertices(GPRTGeom triangles, GPRTBuffer vertices, uint32_t count, uint32_t stride, uint32_t offset)
Warning
doxygenfunction: Unable to resolve function “gprtTrianglesSetIndices” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename T1, typename T2> void gprtTrianglesSetIndices(GPRTGeomOf<T1> triangles, GPRTBufferOf<T2> indices, uint32_t count, uint32_t stride, uint32_t offset)
- void gprtTrianglesSetIndices(GPRTGeom triangles, GPRTBuffer indices, uint32_t count, uint32_t stride, uint32_t offset)
Warning
doxygenfunction: Unable to resolve function “gprtAABBsSetPositions” with arguments None in doxygen xml output for project “gprt” from directory: ../../build/xml/. Potential matches:
- template<typename T1, typename T2> void gprtAABBsSetPositions(GPRTGeomOf<T1> aabbs, GPRTBufferOf<T2> positions, uint32_t count, uint32_t stride, uint32_t offset)
- void gprtAABBsSetPositions(GPRTGeom aabbs, GPRTBuffer positions, uint32_t count, uint32_t stride, uint32_t offset)
Acceleration Structure Functions
Warning
doxygenfunction: Cannot find function “gprtTrianglesAccelCreate” in doxygen xml output for project “gprt” from directory: ../../build/xml/
-
GPRTAccel gprtInstanceAccelCreate(GPRTContext context, uint numInstances, GPRTBufferOf<gprt::Instance> instances)
create a new instance acceleration structure with given number of instances.
- Parameters:
numInstances – Number of acceleration structures instantiated in the leaves of this acceleration structure, must be non-zero.
instances – A buffer of ‘numInstances’ instances.
Warning
doxygenfunction: Cannot find function “gprtInstanceAccelSetTransforms” in doxygen xml output for project “gprt” from directory: ../../build/xml/
-
void gprtAccelBuild(GPRTContext context, GPRTAccel accel, GPRTBuildMode mode, bool allowCompaction = false, bool minimizeMemory = false)
Builds the given acceleration structure so that it can be used on the device for ray tracing.
- Parameters:
context – The GPRT context
accel – The acceleration structure to build.
mode – The build mode to use when constructing the acceleration structure.
GPRT_BUILD_MODE_FAST_BUILD_NO_UPDATE Fastest possible build, but slower trace than 3 or 4. Good for fully-dynamic geometry like particles, destruction, changing prim counts, or moving wildly (explosions) where per-frame rebuild is required.
GPRT_BUILD_MODE_FAST_BUILD_AND_UPDATE Slightly slower build than 1, but allows very fast update. Good for lower level-of-detail dynamic objects that are unlikely to be hit by too many rays but still need to be refitted per frame to be correct.
GPRT_BUILD_MODE_FAST_TRACE_NO_UPDATE Fastest possible trace, but disallows updates. Slower to build than 1 or 2. This is a good default choice for static geometry.
GPRT_BUILD_MODE_FAST_TRACE_AND_UPDATE Fastest trace possible while still allowing for updates. Updates are slightly slower than 2. Trace is a bit slower than 3. Good for high level-of-detail dynamic objects that are expected to be hit by a significant number of rays.
allowCompaction – Enables the tree to be compacted with gprtAccelCompact, potentially significantly reducing its memory footprint. Enabling this feature may take more time and memory than a normal build, and so should only be used when the compaction feature is needed.
minimizeMemory – Sacrifices build and trace performance to reduce memory consumption. Enable only when an application is under so much memory pressure that ray tracing isn’t feasible without optimizing for memory consumption as much as possible.
Warning
doxygenfunction: Cannot find function “gprtAccelRefit” in doxygen xml output for project “gprt” from directory: ../../build/xml/
-
void gprtAccelDestroy(GPRTAccel accel)
Shader Record Setters
Warning
doxygenfunction: Cannot find function “gprtRayGenSet3f” in doxygen xml output for project “gprt” from directory: ../../build/xml/
Warning
doxygenfunction: Cannot find function “gprtRayGenSetBuffer” in doxygen xml output for project “gprt” from directory: ../../build/xml/
Warning
doxygenfunction: Cannot find function “gprtRayGenSet2i” in doxygen xml output for project “gprt” from directory: ../../build/xml/