3
3
// For conditions of distribution and use, see copyright notice in nabla.h
4
4
#include " common.hpp"
5
5
6
- class RayQueryGeometryApp final : public examples:: SimpleWindowedApplication, public application_templates:: MonoAssetManagerAndBuiltinResourceApplication
6
+ class RayQueryGeometryApp final : public SimpleWindowedApplication, public MonoAssetManagerAndBuiltinResourceApplication
7
7
{
8
- using device_base_t = examples:: SimpleWindowedApplication;
9
- using asset_base_t = application_templates:: MonoAssetManagerAndBuiltinResourceApplication;
8
+ using device_base_t = SimpleWindowedApplication;
9
+ using asset_base_t = MonoAssetManagerAndBuiltinResourceApplication;
10
10
using clock_t = std::chrono::steady_clock;
11
11
12
12
constexpr static inline uint32_t WIN_W = 1280 , WIN_H = 720 ;
@@ -121,7 +121,6 @@ class RayQueryGeometryApp final : public examples::SimpleWindowedApplication, pu
121
121
return logFail (" Could not create HDR Image" );
122
122
123
123
auto assetManager = make_smart_refctd_ptr<nbl::asset::IAssetManager>(smart_refctd_ptr (system));
124
- auto * geometryCreator = assetManager->getGeometryCreator ();
125
124
126
125
auto cQueue = getComputeQueue ();
127
126
@@ -138,9 +137,9 @@ class RayQueryGeometryApp final : public examples::SimpleWindowedApplication, pu
138
137
std::this_thread::yield ();
139
138
}
140
139
// Nsight is special and can't capture anything not on the queue that performs the swapchain acquire/release
141
- createAccelerationStructureDS (gQueue ,geometryCreator );
140
+ createAccelerationStructureDS (gQueue );
142
141
#else
143
- createAccelerationStructureDS (cQueue,geometryCreator );
142
+ createAccelerationStructureDS (cQueue);
144
143
#endif
145
144
if (!renderDs)
146
145
return logFail (" Could not create acceleration structures and descriptor set" );
@@ -258,11 +257,9 @@ class RayQueryGeometryApp final : public examples::SimpleWindowedApplication, pu
258
257
cmdbuf->beginDebugMarker (" RayQueryGeometryApp Frame" );
259
258
{
260
259
camera.beginInputProcessing (nextPresentationTimestamp);
261
- mouse.consumeEvents ([&](const IMouseEventChannel::range_t & events) -> void { camera.mouseProcess (events); mouseProcess (events); }, m_logger.get ());
260
+ mouse.consumeEvents ([&](const IMouseEventChannel::range_t & events) -> void { camera.mouseProcess (events); }, m_logger.get ());
262
261
keyboard.consumeEvents ([&](const IKeyboardEventChannel::range_t & events) -> void { camera.keyboardProcess (events); }, m_logger.get ());
263
262
camera.endInputProcessing (nextPresentationTimestamp);
264
-
265
- const auto type = static_cast <ObjectType>(gcIndex);
266
263
}
267
264
268
265
const auto viewMatrix = camera.getViewMatrix ();
@@ -487,9 +484,12 @@ class RayQueryGeometryApp final : public examples::SimpleWindowedApplication, pu
487
484
return (dim + size - 1 ) / size;
488
485
}
489
486
490
- smart_refctd_ptr<IGPUDescriptorSet> createAccelerationStructureDS (video::CThreadSafeQueueAdapter* queue, const IGeometryCreator* gc )
487
+ smart_refctd_ptr<IGPUDescriptorSet> createAccelerationStructureDS (video::CThreadSafeQueueAdapter* queue)
491
488
{
492
489
// get geometries in ICPUBuffers
490
+ #if 1
491
+ return nullptr ;
492
+ #else
493
493
std::array<ReferenceObjectCpu, OT_COUNT> objectsCpu;
494
494
objectsCpu[OT_CUBE] = ReferenceObjectCpu{ .meta = {.type = OT_CUBE, .name = "Cube Mesh" }, .shadersType = GP_BASIC, .data = gc->createCubeMesh(nbl::core::vector3df(1.f, 1.f, 1.f)) };
495
495
objectsCpu[OT_SPHERE] = ReferenceObjectCpu{ .meta = {.type = OT_SPHERE, .name = "Sphere Mesh" }, .shadersType = GP_BASIC, .data = gc->createSphereMesh(2, 16, 16) };
@@ -892,6 +892,7 @@ class RayQueryGeometryApp final : public examples::SimpleWindowedApplication, pu
892
892
m_api->endCapture();
893
893
894
894
return reservation.getGPUObjects<ICPUDescriptorSet>().front().value;
895
+ #endif
895
896
}
896
897
897
898
@@ -915,19 +916,6 @@ class RayQueryGeometryApp final : public examples::SimpleWindowedApplication, pu
915
916
916
917
smart_refctd_ptr<IGPUComputePipeline> renderPipeline;
917
918
smart_refctd_ptr<IGPUDescriptorSet> renderDs;
918
-
919
- uint16_t gcIndex = {};
920
-
921
- void mouseProcess (const nbl::ui::IMouseEventChannel::range_t & events)
922
- {
923
- for (auto eventIt = events.begin (); eventIt != events.end (); eventIt++)
924
- {
925
- auto ev = *eventIt;
926
-
927
- if (ev.type == nbl::ui::SMouseEvent::EET_SCROLL)
928
- gcIndex = std::clamp<uint16_t >(int16_t (gcIndex) + int16_t (core::sign (ev.scrollEvent .verticalScroll )), int64_t (0 ), int64_t (OT_COUNT - (uint8_t )1u ));
929
- }
930
- }
931
919
};
932
920
933
921
NBL_MAIN_FUNC (RayQueryGeometryApp)
0 commit comments