Replace rather than update Metal buffers (#1842)

This commit is contained in:
Tim Sylvester
2023-11-20 12:58:19 -08:00
committed by GitHub
parent 48106f7422
commit ffcf132f20
11 changed files with 115 additions and 40 deletions

View File

@@ -501,6 +501,8 @@ void Drawable::upload(gfx::UploadPass& uploadPass_) {
}
if (impl->indexes->getDirty()) {
// Create or update a buffer for the index data. We don't update any
// existing buffer because it may still be in use by the previous frame.
auto indexBufferResource{uploadPass.createIndexBufferResource(
impl->indexes->data(), impl->indexes->bytes(), usage, /*persistent=*/false)};
auto indexBuffer = std::make_unique<gfx::IndexBuffer>(impl->indexes->elements(),