13
13
14
14
using namespace nbl ;
15
15
using namespace core ;
16
+ using namespace ui ;
16
17
17
18
int main (int argc, char ** argv)
18
19
{
@@ -28,7 +29,7 @@ int main(int argc, char** argv)
28
29
const auto swapchainImageUsage = static_cast <asset::IImage::E_USAGE_FLAGS>(asset::IImage::EUF_COLOR_ATTACHMENT_BIT);
29
30
const video::ISurface::SFormat surfaceFormat (asset::EF_B8G8R8A8_SRGB, asset::ECP_COUNT, asset::EOTF_UNKNOWN);
30
31
31
- CommonAPI::InitWithDefaultExt (initOutput, video::EAT_OPENGL , " MeshLoaders" , WIN_W, WIN_H, SC_IMG_COUNT, swapchainImageUsage, surfaceFormat, nbl::asset::EF_D32_SFLOAT);
32
+ CommonAPI::InitWithDefaultExt (initOutput, video::EAT_VULKAN , " MeshLoaders" , WIN_W, WIN_H, SC_IMG_COUNT, swapchainImageUsage, surfaceFormat, nbl::asset::EF_D32_SFLOAT);
32
33
auto window = std::move (initOutput.window );
33
34
auto gl = std::move (initOutput.apiConnection );
34
35
auto surface = std::move (initOutput.surface );
@@ -395,7 +396,8 @@ int main(int argc, char** argv)
395
396
const auto & viewMatrix = camera.getViewMatrix ();
396
397
const auto & viewProjectionMatrix = camera.getConcatenatedMatrix ();
397
398
398
- core::vector<uint8_t > uboData (cameraUBO->getSize ());
399
+ const size_t camUboSize = cameraUBO->getCachedCreationParams ().declaredSize ;
400
+ core::vector<uint8_t > uboData (camUboSize);
399
401
for (const auto & shdrIn : pipelineMetadata->m_inputSemantics )
400
402
{
401
403
if (shdrIn.descriptorSection .type ==asset::IRenderpassIndependentPipelineMetadata::ShaderInput::ET_UNIFORM_BUFFER && shdrIn.descriptorSection .uniformBufferObject .set ==1u && shdrIn.descriptorSection .uniformBufferObject .binding ==cameraUBOBinding)
@@ -419,7 +421,7 @@ int main(int argc, char** argv)
419
421
}
420
422
}
421
423
}
422
- commandBuffer->updateBuffer (cameraUBO.get (),0ull ,cameraUBO-> getSize () ,uboData.data ());
424
+ commandBuffer->updateBuffer (cameraUBO.get (),0ull ,camUboSize ,uboData.data ());
423
425
}
424
426
425
427
// renderpass
0 commit comments