载入中...
搜索中...
未找到
VulkanRayTracing.h
浏览该文件的文档.
72 [[nodiscard]] Result<void> allocate(vkb::Device& dev, vk::DeviceSize bytes, vk::BufferUsageFlags usage);
75 [[nodiscard]] Result<void> upload(vk::CommandPool pool, vk::Queue queue, const void* data, vk::DeviceSize bytes);
82 [[nodiscard]] Result<void> initializeHostVisible(vkb::Device& dev, const void* data, vk::DeviceSize bytes,
159 [[nodiscard]] Result<PathSceneToken> preparePathScene(Graphics* gfx, const PathSceneDescription& scene) override;
172 [[nodiscard]] Result<void> renderPaths(PathSceneToken token, Canvas* dest, const PathTraceView& view) override;
181 [[nodiscard]] Result<void> applyReflections(Graphics* gfx, Texture* sceneColor, Texture* hwDepth,
189 [[nodiscard]] Result<uint32_t> addTriangleMesh(const float* positionsXYZ, int vertexCount, const uint32_t* indices,
245 [[nodiscard]] Result<PathSceneToken> updatePathInstancesPrepared(std::span<const PathInstance> instances,
247 [[nodiscard]] Result<void> buildPathInstances(std::span<const PathInstance> instances, const PathScene& geometry,
304 [[nodiscard]] Result<void> recordPathDispatch(vk::CommandBuffer command, vk::AccelerationStructureKHR scene,
312 [[nodiscard]] Result<void> ensureDescriptorSets(vk::ImageView outputView, vk::ImageView sceneView,
316 [[nodiscard]] Result<void> buildTlas(std::span<const vk::AccelerationStructureInstanceKHR> instances,
Move-only, checked operation results for the common layer.
Definition Graphics.h:134
Optional hardware ray-tracing backend (Vulkan KHR RT).
Definition IRayTracing.h:28
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:15
Vulkan implementation of IRayTracing (KHR ray-tracing pipeline).
Definition VulkanRayTracing.h:139
Result< PathFrameToken > preparePathFrame(PathSceneToken scene, uint32_t width, uint32_t height) override
Prepare owned normal-frame output.
Definition VulkanPathTracing.cpp:1221
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 ...
Definition VulkanPathTracing.cpp:703
Result< uint32_t > addMesh(Mesh *mesh, const glm::mat4 &transform) override
Adds mesh.
Definition VulkanRayTracing.cpp:328
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-o...
Definition VulkanPathTracing.cpp:1320
Result< Texture * > recordPathFrame(PathSceneToken scene, PathFrameToken output, const PathTraceView &view) override
Record normal-frame tracing.
Definition VulkanPathTracing.cpp:1233
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 re...
Definition VulkanRayTracing.cpp:233
Result< void > ensureAttached()
Lazily bind to the process Graphics singleton when RT is available.
Definition VulkanRayTracing.cpp:199
VulkanRayTracing(const VulkanRayTracing &)=delete
VulkanRayTracing()=default
Constructs a VulkanRayTracing.
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 p...
Definition VulkanPathTracing.cpp:658
Result< uint32_t > addTriangleMesh(const float *positionsXYZ, int vertexCount, const uint32_t *indices, int indexCount, const glm::mat4 &transform) override
Adds triangle mesh.
Definition VulkanRayTracing.cpp:296
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.
Definition VulkanRayTracing.cpp:818
VulkanRayTracing & operator=(const VulkanRayTracing &)=delete
VulkanRayTracing & vulkanRayTracing()
Process-wide Vulkan RT backend; also registered as IRayTracing.
Definition VulkanRayTracing.cpp:192
Definition VulkanSequence.h:9
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
@ Graphics
Provider-owned frame output identity; invalidated by resize, scene replacement or device detach.
Definition PathTracing.h:135
Borrowed scene snapshot; preparation copies all inputs into provider-owned resources....
Definition PathTracing.h:119
Opaque prepared-scene identity; invalid after replacement or device detachment. @ownership Does not o...
Definition PathTracing.h:130
Deterministic path sample batch. Zero history starts a new accumulation.
Definition PathTracing.h:146
Hardware ray-tracing capabilities probed once at Vulkan device creation.
Definition RayTracingCaps.h:16
Bottom- or top-level acceleration structure handle.
Definition VulkanRayTracing.h:95
AccelerationStructure & operator=(AccelerationStructure &&o) noexcept
Operator =.
Definition VulkanRayTracing.h:110
AccelerationStructure & operator=(const AccelerationStructure &)=delete
vkb::Device * device
Definition VulkanRayTracing.h:99
AccelerationStructure()=default
Constructs a AccelerationStructure.
vk::DeviceAddress deviceAddress
Definition VulkanRayTracing.h:98
AccelerationStructure(const AccelerationStructure &)=delete
DeviceAddressBuffer storage
Definition VulkanRayTracing.h:97
vk::AccelerationStructureKHR handle
Definition VulkanRayTracing.h:96
AccelerationStructure(AccelerationStructure &&o) noexcept
Constructs a AccelerationStructure.
Definition VulkanRayTracing.h:108
Device-local buffer with shader device address (for AS builds / SBT). @ownership Owns the Vulkan buff...
Definition VulkanRayTracing.h:38
DeviceAddressBuffer(const DeviceAddressBuffer &)=delete
DeviceAddressBuffer()=default
Constructs a DeviceAddressBuffer.
vkb::Device * device
Definition VulkanRayTracing.h:43
vk::Buffer buffer
Definition VulkanRayTracing.h:39
vk::DeviceSize size
Definition VulkanRayTracing.h:41
DeviceAddressBuffer & operator=(DeviceAddressBuffer &&o) noexcept
Operator =.
Definition VulkanRayTracing.h:54
vk::DeviceAddress address
Definition VulkanRayTracing.h:42
Result< void > initializeHostVisible(vkb::Device &dev, const void *data, vk::DeviceSize bytes, vk::BufferUsageFlags usage)
Allocate coherent host-visible storage and initialize it without a transfer submission....
Definition VulkanRayTracing.cpp:87
Result< void > allocate(vkb::Device &dev, vk::DeviceSize bytes, vk::BufferUsageFlags usage)
Ensure buffer capacity with usage including SHADER_DEVICE_ADDRESS. @ownership Reuses compatible stora...
Definition VulkanRayTracing.cpp:83
DeviceAddressBuffer(DeviceAddressBuffer &&o) noexcept
Constructs a DeviceAddressBuffer.
Definition VulkanRayTracing.h:52
Result< void > upload(vk::CommandPool pool, vk::Queue queue, const void *data, vk::DeviceSize bytes)
Upload host bytes via a staging buffer (stalls the queue).
Definition VulkanRayTracing.cpp:145
DeviceAddressBuffer & operator=(const DeviceAddressBuffer &)=delete
vk::DeviceMemory memory
Definition VulkanRayTracing.h:40
TriangleMeshRecord public API.
Definition VulkanRayTracing.h:127
DeviceAddressBuffer indexBuffer
Definition VulkanRayTracing.h:129
uint32_t indexCount
Definition VulkanRayTracing.h:132
DeviceAddressBuffer vertexBuffer
Definition VulkanRayTracing.h:128
AccelerationStructure blas
Definition VulkanRayTracing.h:130
glm::mat4 transform
Definition VulkanRayTracing.h:133
uint32_t vertexCount
Definition VulkanRayTracing.h:131