diff --git a/XDKSamples/Graphics/AdvancedESRAM12/AdvancedESRAM12.cpp b/XDKSamples/Graphics/AdvancedESRAM12/AdvancedESRAM12.cpp index fd77abda..9754974d 100644 --- a/XDKSamples/Graphics/AdvancedESRAM12/AdvancedESRAM12.cpp +++ b/XDKSamples/Graphics/AdvancedESRAM12/AdvancedESRAM12.cpp @@ -736,10 +736,16 @@ void Sample::CreateDeviceDependentResources() m_models[i] = Model::CreateFromSDKMESH(s_modelPaths[i]); } - // Upload textures to GPU. ResourceUploadBatch resourceUpload(device); resourceUpload.Begin(); + // Optimize meshes for rendering + for (int i = 0; i < m_models.size(); ++i) + { + m_models[i]->LoadStaticBuffers(device, resourceUpload); + } + + // Upload textures to GPU. m_textureFactory = std::make_unique(device, resourceUpload, m_srvPile->Heap()); auto texOffsets = std::vector(m_models.size());