Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
|
A Blas (Bottom Level Acceleration Structure) is the raytracing equivalent concept of a mesh. More...
#include <foray_blas.hpp>
Public Member Functions | |
virtual | ~Blas () |
virtual std::string_view | GetTypeName () const override |
Returns <OBJECT_TYPE> stringified. | |
virtual void | CreateOrUpdate (core::Context *context, const scene::Mesh *mesh, const scene::gcomp::GeometryStore *store, bench::HostBenchmark *benchmark=nullptr) |
Recreates the acceleration structure. | |
virtual bool | Exists () const override |
Return true, if the managed resource is allocated. | |
virtual void | Destroy () override |
Destroy the resource. | |
![]() | |
VulkanResource () | |
VulkanResource (std::string_view name) | |
![]() | |
ManagedResource () | |
Default constructor registers the resource. | |
ManagedResource (std::string_view name) | |
Registers the resource and sets its name. | |
virtual | ~ManagedResource () |
Unregisters the resource. | |
std::string_view | GetName () const |
Return a custom name for the object. | |
virtual void | SetName (std::string_view name) |
Set a custom name for the object. | |
std::string | Print () const |
Print name and type in one string. | |
![]() | |
NoMoveDefaults ()=default | |
NoMoveDefaults (const NoMoveDefaults &other)=delete | |
NoMoveDefaults (NoMoveDefaults &&other)=default | |
NoMoveDefaults & | operator= (const NoMoveDefaults &other)=delete |
Static Public Attributes | |
static const char * | BENCH_RESET = "Reset" |
static const char * | BENCH_CREATESTRUCTS = "Create Build Structs" |
static const char * | BENCH_GETSIZES = "Get Build Sizes" |
static const char * | BENCH_CREATE = "Create" |
static const char * | BENCH_BUILD = "Build" |
Protected Attributes | |
core::Context * | mContext = nullptr |
const scene::Mesh * | mMesh = nullptr |
core::ManagedBuffer | mBlasMemory |
VkAccelerationStructureKHR | mAccelerationStructure {} |
VkDeviceAddress | mBlasAddress {} |
![]() | |
std::string | mName |
This objects custom name. | |
Additional Inherited Members | |
![]() | |
static void | sPrintAllocatedResources (bool printAsWarning) |
Print a list of all registered existing resources. | |
static const std::unordered_set< ManagedResource * > * | GetTotalAllocatedResources () |
![]() | |
virtual void | SetObjectName (core::Context *context, const void *handle, std::string_view name, bool updateResourceName=true) |
Set the object name. Sets both ManagedResource::mName aswell as vulkan debug object name. | |
A Blas (Bottom Level Acceleration Structure) is the raytracing equivalent concept of a mesh.
This class takes the geometry referenced by a mesh from a geometrystore, and builds a bottom level acceleration structure from it. It manages (owns) both the BLAs buffer aswell as the handle and exposes the Blas' device address.
|
inlinevirtual |
|
virtual |
Recreates the acceleration structure.
For each primitive in mesh, creates a geometry structure and corresponding build range. See static BENCH_... members for benchmark timestamps
context | Requires DispatchTable, PhysicalDevice, LogicalDevice |
mesh | Required mesh object referencing the geometry |
store | Required GeometryStore owning the Vertex+Index buffers |
benchmark | Optional benchmark for timing the build process |
|
overridevirtual |
Destroy the resource.
Implements foray::core::ManagedResource.
|
inlineoverridevirtual |
Return true, if the managed resource is allocated.
Example: Vulkan object stored could be nullptr or instantiated
Implements foray::core::ManagedResource.
|
inlineoverridevirtual |
Returns <OBJECT_TYPE> stringified.
Reimplemented from foray::core::VulkanResource< VkObjectType::VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR >.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |