@@ -149,7 +149,7 @@ APP_CONSTRUCTOR(PLYSTLDemo)
149
149
const auto swapchainImageUsage = static_cast <asset::IImage::E_USAGE_FLAGS>(asset::IImage::EUF_COLOR_ATTACHMENT_BIT);
150
150
const video::ISurface::SFormat surfaceFormat (asset::EF_R8G8B8A8_SRGB, asset::ECP_COUNT, asset::EOTF_UNKNOWN);
151
151
152
- CommonAPI::InitWithDefaultExt (initOutput, video::EAT_OPENGL_ES , " plystldemo" , WIN_W, WIN_H, SC_IMG_COUNT, swapchainImageUsage, surfaceFormat, nbl::asset::EF_D32_SFLOAT);
152
+ CommonAPI::InitWithDefaultExt (initOutput, video::EAT_OPENGL /* Vulkan doesn't work yet */ , " plystldemo" , WIN_W, WIN_H, SC_IMG_COUNT, swapchainImageUsage, surfaceFormat, nbl::asset::EF_D32_SFLOAT);
153
153
window = std::move (initOutput.window );
154
154
gl = std::move (initOutput.apiConnection );
155
155
surface = std::move (initOutput.surface );
@@ -194,19 +194,23 @@ APP_CONSTRUCTOR(PLYSTLDemo)
194
194
gpuComputeFence = logicalDevice->createFence (static_cast <video::IGPUFence::E_CREATE_FLAGS>(0 ));
195
195
gpuComputeSemaphore = logicalDevice->createSemaphore ();
196
196
197
- cpu2gpuParams.assetManager = assetManager .get ();
197
+ cpu2gpuParams.utilities = utilities .get ();
198
198
cpu2gpuParams.device = logicalDevice.get ();
199
- cpu2gpuParams.finalQueueFamIx = queues[decltype (initOutput)::EQT_GRAPHICS]->getFamilyIndex ();
200
- cpu2gpuParams.limits = gpuPhysicalDevice->getLimits ();
199
+ cpu2gpuParams.assetManager = assetManager.get ();
201
200
cpu2gpuParams.pipelineCache = nullptr ;
202
- cpu2gpuParams.sharingMode = nbl::asset::ESM_CONCURRENT;
203
- cpu2gpuParams.utilities = utilities.get ();
201
+ cpu2gpuParams.limits = gpuPhysicalDevice->getLimits ();
202
+ cpu2gpuParams.finalQueueFamIx = queues[decltype (initOutput)::EQT_GRAPHICS]->getFamilyIndex ();
203
+ cpu2gpuParams.sharingMode = nbl::asset::ESM_EXCLUSIVE;
204
204
205
- cpu2gpuParams.perQueue [nbl::video::IGPUObjectFromAssetConverter::EQU_TRANSFER].semaphore = &gpuTransferSemaphore ;
205
+ logicalDevice-> createCommandBuffers (commandPools[CommonAPI::InitOutput::EQT_TRANSFER_UP]. get (),video::IGPUCommandBuffer::EL_PRIMARY, 1u ,& cpu2gpuParams.perQueue [nbl::video::IGPUObjectFromAssetConverter::EQU_TRANSFER].cmdbuf ) ;
206
206
cpu2gpuParams.perQueue [nbl::video::IGPUObjectFromAssetConverter::EQU_TRANSFER].queue = queues[decltype (initOutput)::EQT_TRANSFER_UP];
207
-
208
- cpu2gpuParams.perQueue [nbl::video::IGPUObjectFromAssetConverter::EQU_COMPUTE].semaphore = &gpuComputeSemaphore;
207
+ cpu2gpuParams.perQueue [nbl::video::IGPUObjectFromAssetConverter::EQU_TRANSFER].semaphore = &gpuTransferSemaphore;
208
+
209
+ logicalDevice->createCommandBuffers (commandPools[CommonAPI::InitOutput::EQT_COMPUTE].get (),video::IGPUCommandBuffer::EL_PRIMARY,1u ,&cpu2gpuParams.perQueue [nbl::video::IGPUObjectFromAssetConverter::EQU_COMPUTE].cmdbuf );
209
210
cpu2gpuParams.perQueue [nbl::video::IGPUObjectFromAssetConverter::EQU_COMPUTE].queue = queues[decltype (initOutput)::EQT_COMPUTE];
211
+ cpu2gpuParams.perQueue [nbl::video::IGPUObjectFromAssetConverter::EQU_COMPUTE].semaphore = &gpuComputeSemaphore;
212
+
213
+ cpu2gpuParams.beginCommandBuffers ();
210
214
}
211
215
212
216
auto loadAndGetCpuMesh = [&](system::path path) -> std::pair<core::smart_refctd_ptr<asset::ICPUMesh>, const asset::IAssetMetadata*>
@@ -336,6 +340,8 @@ APP_CONSTRUCTOR(PLYSTLDemo)
336
340
core::smart_refctd_ptr<video::IGPUMesh> gpumesh;
337
341
{
338
342
auto gpu_array = cpu2gpu.getGPUObjectsFromAssets (&cpuMesh.get (), &cpuMesh.get () + 1 , cpu2gpuParams);
343
+ cpu2gpuParams.waitForCreationToComplete (true );
344
+ cpu2gpuParams.beginCommandBuffers ();
339
345
if (!gpu_array || gpu_array->size () < 1u || !(*gpu_array)[0 ])
340
346
assert (false );
341
347
@@ -370,7 +376,7 @@ APP_CONSTRUCTOR(PLYSTLDemo)
370
376
371
377
core::vectorSIMDf cameraPosition (0 , 5 , -10 );
372
378
matrix4SIMD projectionMatrix = matrix4SIMD::buildProjectionMatrixPerspectiveFovLH (core::radians (60 .0f ), float (WIN_W) / WIN_H, 0.001 , 1000 );
373
- camera = Camera (cameraPosition, core::vectorSIMDf (0 , 0 , 0 ), projectionMatrix, 10 . f , 1 .f );
379
+ camera = Camera (cameraPosition, core::vectorSIMDf (0 , 0 , 0 ), projectionMatrix, 0 . 01f , 1 .f );
374
380
lastTime = std::chrono::system_clock::now ();
375
381
376
382
for (size_t i = 0ull ; i < NBL_FRAMES_TO_AVERAGE; ++i)
0 commit comments