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< PathSceneToken > | preparePathScene (Graphics *gfx, const PathSceneDescription &scene) override |
| Prepare and publish a path-tracing scene. @ownership Inputs are borrowed for this call; GPU snapshot is backend-owned. @thread Render thread, outside frame recording; no reentrancy. @cost GPU uploads/builds proportional to geometry, amortized across frames. | |
| Result< PathSceneToken > | updatePathInstances (PathSceneToken token, std::span< const PathInstance > instances) override |
| Replace instances while retaining prepared geometry. @ownership Input is borrowed for the call; the provider retains geometry resources. @thread Render thread, outside frame recording; no reentrancy. @cost Rebuilds the instance hierarchy and emitter data per changed instance set, reusing BLAS. | |
| Result< void > | renderPaths (PathSceneToken token, Canvas *dest, const PathTraceView &view) override |
| Render a prepared sample batch. @ownership Destination is borrowed for the call; history is backend-owned. @thread Render thread, outside frame recording; no reentrancy. @cost GPU work proportional to pixels, samples and bounces; waits once per batch. | |
| Result< PathFrameToken > | preparePathFrame (PathSceneToken scene, uint32_t width, uint32_t height) override |
| Prepare owned normal-frame output. | |
| Result< Texture * > | recordPathFrame (PathSceneToken scene, PathFrameToken output, const PathTraceView &view) override |
| Record normal-frame tracing. | |
| 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 第 139 行定义.
构造及析构函数说明
◆ VulkanRayTracing() [1/2]
|
default |
Constructs a VulkanRayTracing.
◆ ~VulkanRayTracing()
|
override |
◆ VulkanRayTracing() [2/2]
|
delete |
成员函数说明
◆ addMesh()
|
overridevirtual |
Adds mesh.
实现了 eve::graphics::IRayTracing.
在文件 VulkanRayTracing.cpp 第 328 行定义.
引用了 addTriangleMesh(), ensureAttached(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), gpu, 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 第 296 行定义.
引用了 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 第 818 行定义.
引用了 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, record, region, 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 第 233 行定义.
引用了 caps(), detachDevice() , 以及 device.
被这些函数引用 ensureAttached().
◆ caps()
|
overridevirtual |
Caps.
实现了 eve::graphics::IRayTracing.
在文件 VulkanRayTracing.cpp 第 226 行定义.
引用了 eve::graphics::RayTracingCaps::rayTracingAvailable() , 以及 eve::graphics::vulkan::Graphics::rayTracingCaps().
被这些函数引用 attachDevice().
◆ clearScene()
|
overridevirtual |
Clears scene.
实现了 eve::graphics::IRayTracing.
在文件 VulkanRayTracing.cpp 第 289 行定义.
引用了 eve::graphics::raytracing::AccelerationStructure::handle , 以及 eve::graphics::raytracing::AccelerationStructure::release().
被这些函数引用 detachDevice().
◆ detachDevice()
| void eve::graphics::raytracing::VulkanRayTracing::detachDevice | ( | ) |
Drop GPU resources when Graphics tears down.
在文件 VulkanRayTracing.cpp 第 242 行定义.
引用了 clearScene(), eve::graphics::raytracing::DeviceAddressBuffer::release() , 以及 eve::graphics::vulkan::Graphics::retirePathSceneOutput().
被这些函数引用 attachDevice(), detachFromGraphics() , 以及 ~VulkanRayTracing().
◆ detachFromGraphics()
|
inlineoverridevirtual |
Detaches from graphics.
重载 eve::graphics::IRayTracing .
在文件 VulkanRayTracing.h 第 199 行定义.
引用了 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 第 199 行定义.
引用了 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 第 218 行定义.
引用了 eve::graphics::RayTracingCaps::rayTracingAvailable() , 以及 eve::graphics::vulkan::Graphics::supportsRayTracing().
被这些函数引用 ensureAttached().
◆ operator=()
|
delete |
◆ preparePathFrame()
|
overridevirtual |
Prepare owned normal-frame output.
- 返回
- Output identity, invalidated by resize, full scene replacement or device detach.
实现了 eve::graphics::IRayTracing.
在文件 VulkanPathTracing.cpp 第 1221 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), height, eve::InvalidArgument, scene, eve::Result< T >::success() , 以及 width.
◆ preparePathScene()
|
overridevirtual |
Prepare and publish a path-tracing scene. @ownership Inputs are borrowed for this call; GPU snapshot is backend-owned. @thread Render thread, outside frame recording; no reentrancy. @cost GPU uploads/builds proportional to geometry, amortized across frames.
实现了 eve::graphics::IRayTracing.
在文件 VulkanPathTracing.cpp 第 703 行定义.
引用了 b, description, error, eve::Diagnostic::error(), EV_PROFILE_MODULE, eve::Failed, eve::Result< T >::failure(), flags, g, geometry, gpu, graphics, identity, indices, eve::InvalidArgument, eve::graphics::Linear, mesh, message, eve::graphics::Mirror, normals, owned, positions, preparePathScene(), resolved, revision, sampler, scene, eve::Result< T >::success(), t, texture, u, eve::Unsupported, uv, v, values , 以及 vertices.
被这些函数引用 preparePathScene().
◆ rebuildScene()
|
overridevirtual |
Rebuild scene.
实现了 eve::graphics::IRayTracing.
在文件 VulkanRayTracing.cpp 第 557 行定义.
引用了 ensureAttached() , 以及 eve::Result< void >::ok().
◆ recordPathFrame()
|
overridevirtual |
Record normal-frame tracing.
- 返回
- Sampleable output for same-frame composition, or a structured failure. Success is recording, not completion.
The caller submits the normal frame. Reset history if a previous recording was not submitted. Subsequent 3D raster draws are not permitted; 2D UI overlays remain supported.
实现了 eve::graphics::IRayTracing.
在文件 VulkanPathTracing.cpp 第 1233 行定义.
引用了 eve::graphics::raytracing::path::Constants::counts, eve::graphics::raytracing::path::Constants::environment, error, eve::Diagnostic::error(), EV_PROFILE_MODULE, eve::graphics::raytracing::path::Constants::eye, eve::Failed, eve::Result< T >::failure(), eve::InvalidArgument, eve::graphics::raytracing::path::Constants::invViewProj, message, eve::graphics::None, output, eve::graphics::raytracing::path::Constants::sampling, scene, sequence, eve::Result< T >::success(), texture, u, valid , 以及 view.
◆ renderPaths()
|
overridevirtual |
Render a prepared sample batch. @ownership Destination is borrowed for the call; history is backend-owned. @thread Render thread, outside frame recording; no reentrancy. @cost GPU work proportional to pixels, samples and bounces; waits once per batch.
实现了 eve::graphics::IRayTracing.
在文件 VulkanPathTracing.cpp 第 1320 行定义.
引用了 eve::graphics::raytracing::path::Constants::counts, eve::graphics::raytracing::path::Constants::environment, eve::Diagnostic::error(), eve::graphics::raytracing::path::Constants::eye, eve::Result< T >::failure(), eve::graphics::Canvas::getHeight(), eve::graphics::Canvas::getWidth(), eve::InvalidArgument, eve::graphics::raytracing::path::Constants::invViewProj, message, eve::graphics::None, region, eve::graphics::raytracing::path::Constants::sampling, status, eve::Status::success(), token, u, valid , 以及 view.
◆ updatePathInstances()
|
overridevirtual |
Replace instances while retaining prepared geometry. @ownership Input is borrowed for the call; the provider retains geometry resources. @thread Render thread, outside frame recording; no reentrancy. @cost Rebuilds the instance hierarchy and emitter data per changed instance set, reusing BLAS.
实现了 eve::graphics::IRayTracing.
在文件 VulkanPathTracing.cpp 第 658 行定义.
引用了 error, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::graphics::vulkan::Graphics::hasOpenPresentFrame(), eve::InvalidArgument , 以及 token.
该类的文档由以下文件生成:
- src/modules/graphics/raytracing/vulkan/VulkanRayTracing.h
- src/modules/graphics/raytracing/vulkan/VulkanPathTracing.cpp
- src/modules/graphics/raytracing/vulkan/VulkanRayTracing.cpp
Public 成员函数 继承自