Vulkan implementation of IRayTracing (KHR ray-tracing pipeline). 更多...
#include <VulkanRayTracing.h>
Public 成员函数 | |
| VulkanRayTracing ()=default | |
| Constructs a VulkanRayTracing. | |
| ~VulkanRayTracing () override | |
| Releases VulkanRayTracing resources. | |
| VulkanRayTracing (const VulkanRayTracing &)=delete | |
| VulkanRayTracing & | operator= (const VulkanRayTracing &)=delete |
| bool | isAvailable () const override |
| True when available. | |
| RayTracingCaps | caps () const override |
| Caps. | |
| Result< void > | applyReflections (Graphics *gfx, Texture *sceneColor, Texture *hwDepth, Texture *worldNormal, Canvas *dest, const glm::mat4 &invViewProj, const glm::mat4 &viewProj, const glm::vec3 &eyeWorld) override |
| Applies reflections. | |
| Result< void > | rebuildScene () override |
| Rebuild scene. | |
| Result< uint32_t > | addTriangleMesh (const float *positionsXYZ, int vertexCount, const uint32_t *indices, int indexCount, const glm::mat4 &transform) override |
| Adds triangle mesh. | |
| Result< uint32_t > | addMesh (Mesh *mesh, const glm::mat4 &transform) override |
| Adds mesh. | |
| void | clearScene () override |
| Clears scene. | |
| void | detachFromGraphics () override |
| Detaches from graphics. | |
| void | attachDevice (vkb::Device *device, const RayTracingCaps &caps, vk::CommandPool uploadPool, vk::Queue graphicsQueue) |
Bind to the live Vulkan Graphics device (call after init). @ownership device is borrowed; Graphics remains the owner. @lifetime device, uploadPool, and graphicsQueue must outlive this backend until detachDevice(). @thread Render thread only. | |
| void | detachDevice () |
| Drop GPU resources when Graphics tears down. | |
| Result< void > | ensureAttached () |
| Lazily bind to the process Graphics singleton when RT is available. | |
Public 成员函数 继承自 eve::graphics::IRayTracing | |
| virtual | ~IRayTracing ()=default |
| I ray tracing. | |
额外继承的成员函数 | |
静态 Public 属性 继承自 eve::graphics::IRayTracing | |
| static constexpr const char * | capabilityName = "IRayTracing" |
详细描述
Vulkan implementation of IRayTracing (KHR ray-tracing pipeline).
在文件 VulkanRayTracing.h 第 113 行定义.
构造及析构函数说明
◆ VulkanRayTracing() [1/2]
|
default |
Constructs a VulkanRayTracing.
◆ ~VulkanRayTracing()
|
override |
◆ VulkanRayTracing() [2/2]
|
delete |
成员函数说明
◆ addMesh()
|
overridevirtual |
Adds mesh.
实现了 eve::graphics::IRayTracing.
在文件 VulkanRayTracing.cpp 第 283 行定义.
引用了 addTriangleMesh(), ensureAttached(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), indices, eve::InvalidArgument, mesh, eve::Result< void >::ok(), eve::graphics::vulkan::MeshVertex::pos, positions, u , 以及 verts.
◆ addTriangleMesh()
|
overridevirtual |
Adds triangle mesh.
实现了 eve::graphics::IRayTracing.
在文件 VulkanRayTracing.cpp 第 251 行定义.
引用了 ensureAttached(), eve::Diagnostic::error(), eve::Result< T >::failure(), indexCount, indices, eve::InvalidArgument, mesh, eve::Result< void >::ok(), r, eve::Result< T >::success(), usage , 以及 vertexCount.
被这些函数引用 addMesh().
◆ applyReflections()
|
overridevirtual |
Applies reflections.
实现了 eve::graphics::IRayTracing.
在文件 VulkanRayTracing.cpp 第 750 行定义.
引用了 ensureAttached(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::graphics::Canvas::getHeight(), eve::graphics::Canvas::getTexture(), eve::graphics::Canvas::getWidth(), eve::graphics::raytracing::AccelerationStructure::handle, height, eve::graphics::vulkan::GpuTexture::imageView(), eve::InvalidArgument, invViewProj, eve::NoOp, eve::Result< void >::ok(), r, eve::Status::success(), eve::Result< T >::success(), viewProj , 以及 width.
◆ attachDevice()
| void eve::graphics::raytracing::VulkanRayTracing::attachDevice | ( | vkb::Device * | device, |
| const RayTracingCaps & | caps, | ||
| vk::CommandPool | uploadPool, | ||
| vk::Queue | graphicsQueue | ||
| ) |
Bind to the live Vulkan Graphics device (call after init). @ownership device is borrowed; Graphics remains the owner. @lifetime device, uploadPool, and graphicsQueue must outlive this backend until detachDevice(). @thread Render thread only.
在文件 VulkanRayTracing.cpp 第 202 行定义.
引用了 caps(), detachDevice() , 以及 device.
被这些函数引用 ensureAttached().
◆ caps()
|
overridevirtual |
Caps.
实现了 eve::graphics::IRayTracing.
在文件 VulkanRayTracing.cpp 第 195 行定义.
引用了 eve::graphics::RayTracingCaps::rayTracingAvailable() , 以及 eve::graphics::vulkan::Graphics::rayTracingCaps().
被这些函数引用 attachDevice().
◆ clearScene()
|
overridevirtual |
Clears scene.
实现了 eve::graphics::IRayTracing.
在文件 VulkanRayTracing.cpp 第 246 行定义.
引用了 eve::graphics::raytracing::AccelerationStructure::release().
被这些函数引用 detachDevice().
◆ detachDevice()
| void eve::graphics::raytracing::VulkanRayTracing::detachDevice | ( | ) |
Drop GPU resources when Graphics tears down.
在文件 VulkanRayTracing.cpp 第 211 行定义.
引用了 clearScene() , 以及 eve::graphics::raytracing::DeviceAddressBuffer::release().
被这些函数引用 attachDevice(), detachFromGraphics() , 以及 ~VulkanRayTracing().
◆ detachFromGraphics()
|
inlineoverridevirtual |
Detaches from graphics.
重载 eve::graphics::IRayTracing .
在文件 VulkanRayTracing.h 第 147 行定义.
引用了 detachDevice().
◆ ensureAttached()
| Result< void > eve::graphics::raytracing::VulkanRayTracing::ensureAttached | ( | ) |
Lazily bind to the process Graphics singleton when RT is available.
- 返回
- Success when attached and RT is usable; Unsupported otherwise.
在文件 VulkanRayTracing.cpp 第 168 行定义.
引用了 attachDevice(), current, eve::Diagnostic::error(), eve::Result< T >::failure(), isAvailable(), eve::graphics::RayTracingCaps::rayTracingAvailable(), eve::Result< T >::success() , 以及 eve::Unsupported.
被这些函数引用 addMesh(), addTriangleMesh(), applyReflections() , 以及 rebuildScene().
◆ isAvailable()
|
overridevirtual |
True when available.
实现了 eve::graphics::IRayTracing.
在文件 VulkanRayTracing.cpp 第 187 行定义.
引用了 eve::graphics::RayTracingCaps::rayTracingAvailable() , 以及 eve::graphics::vulkan::Graphics::supportsRayTracing().
被这些函数引用 ensureAttached().
◆ operator=()
|
delete |
◆ rebuildScene()
|
overridevirtual |
Rebuild scene.
实现了 eve::graphics::IRayTracing.
在文件 VulkanRayTracing.cpp 第 489 行定义.
引用了 ensureAttached() , 以及 eve::Result< void >::ok().
该类的文档由以下文件生成:
- src/modules/graphics/raytracing/vulkan/VulkanRayTracing.h
- src/modules/graphics/raytracing/vulkan/VulkanRayTracing.cpp
Public 成员函数 继承自