载入中...
搜索中...
未找到
RayTracingModule.cpp
浏览该文件的文档.
2
3#include "common/Capability.h"
6
7#include <simplesquirrel/simplesquirrel.hpp>
8
9#include <functional>
10
12
14
16 if (auto* rt = eve::cap::query<IRayTracing>()) return rt->isAvailable();
17 return false;
18}
19
21 if (auto* rt = eve::cap::query<IRayTracing>()) return rt->caps();
22 return {};
23}
24
25IRayTracing* RayTracing::backend() const { return eve::cap::query<IRayTracing>(); }
26
27void RayTracing::expose(ssq::Class& cls) {
28 cls.addFunc("isAvailable", &RayTracing::isAvailable);
29 cls.addFunc("capsAvailable", [](RayTracing* self) -> bool { return self && self->caps().rayTracingAvailable(); });
30}
31
32void RayTracing::expose(ssq::Table& table) {
33 auto cls = table.addClass(name, RayTracing::create, false);
34 expose(cls);
35}
36
37} // namespace eve::graphics::raytracing
HSQOBJECT cls
Definition ECS.cpp:21
std::string name
#define Module_IMPL(ModuleName, newExpr)
Definition Module.h:26
Optional hardware ray-tracing backend (Vulkan KHR RT).
Definition IRayTracing.h:26
Optional Vulkan KHR ray-tracing module.
RayTracingCaps caps() const
Snapshot of probed RT device capabilities.
bool isAvailable() const
True when the active Graphics device enabled hardware RT.
IRayTracing * backend() const
Borrow the process-wide IRayTracing provider, or nullptr when the module is linked but Graphics has n...
Hardware ray-tracing capabilities probed once at Vulkan device creation.