@@ -296,7 +296,7 @@ class NablaTutorialExampleApp : public ApplicationBase
296
296
297
297
IGPUBuffer::SCreationParams creationParams = {};
298
298
creationParams.canUpdateSubRange = true ;
299
- creationParams.usage = asset::IBuffer::EUF_UNIFORM_BUFFER_BIT;
299
+ creationParams.usage = core::bitflag ( asset::IBuffer::EUF_UNIFORM_BUFFER_BIT)|asset::IBuffer::EUF_TRANSFER_DST_BIT ;
300
300
IDriverMemoryBacked::SDriverMemoryRequirements memReq;
301
301
memReq.vulkanReqs .size = sizeof (SBasicViewParameters);
302
302
memReq.vulkanReqs .alignment = physicalDevice->getLimits ().UBOAlignment ;
@@ -459,7 +459,10 @@ class NablaTutorialExampleApp : public ApplicationBase
459
459
auto & fence = frameComplete[resourceIx];
460
460
461
461
if (fence)
462
- while (logicalDevice->waitForFences (1u , &fence.get (), false , MAX_TIMEOUT) == video::IGPUFence::ES_TIMEOUT) {}
462
+ {
463
+ logicalDevice->blockForFences (1u ,&fence.get ());
464
+ logicalDevice->resetFences (1u ,&fence.get ());
465
+ }
463
466
else
464
467
fence = logicalDevice->createFence (static_cast <video::IGPUFence::E_CREATE_FLAGS>(0 ));
465
468
@@ -510,6 +513,31 @@ class NablaTutorialExampleApp : public ApplicationBase
510
513
viewport.width = WIN_W;
511
514
viewport.height = WIN_H;
512
515
commandBuffer->setViewport (0u , 1u , &viewport);
516
+ VkRect2D scissor;
517
+ scissor.offset = {0u ,0u };
518
+ scissor.extent = {WIN_W,WIN_H};
519
+ commandBuffer->setScissor (0u ,1u ,&scissor);
520
+
521
+ const auto viewProjection = camera.getConcatenatedMatrix ();
522
+ core::matrix3x4SIMD modelMatrix;
523
+ modelMatrix.setRotation (nbl::core::quaternion (0 , 1 , 0 ));
524
+
525
+ auto mv = core::concatenateBFollowedByA (camera.getViewMatrix (), modelMatrix);
526
+ auto mvp = core::concatenateBFollowedByA (viewProjection, modelMatrix);
527
+ core::matrix3x4SIMD normalMat;
528
+ mv.getSub3x3InverseTranspose (normalMat);
529
+
530
+ /*
531
+ Updating UBO for basic view parameters and sending
532
+ updated data to staging buffer that will redirect
533
+ the data to graphics card - to vertex shader.
534
+ */
535
+
536
+ SBasicViewParameters uboData;
537
+ memcpy (uboData.MV , mv.pointer (), sizeof (mv));
538
+ memcpy (uboData.MVP , mvp.pointer (), sizeof (mvp));
539
+ memcpy (uboData.NormalMat , normalMat.pointer (), sizeof (normalMat));
540
+ commandBuffer->updateBuffer (gpuubo.get (), 0ull , gpuubo->getSize (), &uboData);
513
541
514
542
swapchain->acquireNextImage (MAX_TIMEOUT, imageAcquire[resourceIx].get (), nullptr , &acquiredNextFBO);
515
543
@@ -531,30 +559,8 @@ class NablaTutorialExampleApp : public ApplicationBase
531
559
beginInfo.renderArea = area;
532
560
beginInfo.clearValues = clear;
533
561
}
534
-
535
562
commandBuffer->beginRenderPass (&beginInfo, nbl::asset::ESC_INLINE);
536
563
537
- const auto viewProjection = camera.getConcatenatedMatrix ();
538
- core::matrix3x4SIMD modelMatrix;
539
- modelMatrix.setRotation (nbl::core::quaternion (0 , 1 , 0 ));
540
-
541
- auto mv = core::concatenateBFollowedByA (camera.getViewMatrix (), modelMatrix);
542
- auto mvp = core::concatenateBFollowedByA (viewProjection, modelMatrix);
543
- core::matrix3x4SIMD normalMat;
544
- mv.getSub3x3InverseTranspose (normalMat);
545
-
546
- /*
547
- Updating UBO for basic view parameters and sending
548
- updated data to staging buffer that will redirect
549
- the data to graphics card - to vertex shader.
550
- */
551
-
552
- SBasicViewParameters uboData;
553
- memcpy (uboData.MV , mv.pointer (), sizeof (mv));
554
- memcpy (uboData.MVP , mvp.pointer (), sizeof (mvp));
555
- memcpy (uboData.NormalMat , normalMat.pointer (), sizeof (normalMat));
556
- commandBuffer->updateBuffer (gpuubo.get (), 0ull , gpuubo->getSize (), &uboData);
557
-
558
564
/*
559
565
Binding the most important objects needed to
560
566
render anything on the screen with textures:
0 commit comments