index-of-nearest-104619 #2

Merged
Iliya Katushenock merged 62 commits from HooglyBoogly/blender:index-of-nearest-104619 into index_of_nearest 2023-04-20 21:19:53 +02:00
Showing only changes of commit b69f8de5b5 - Show all commits

View File

@ -33,6 +33,11 @@ void MTLQueryPool::allocate()
gpu::MTLBuffer *buffer = MTLContext::get_global_memory_manager()->allocate(buffer_size_in_bytes,
true);
BLI_assert(buffer);
/* We must zero-initialize the query buffer as visibility queries with no draws between
* begin and end will not write any result to the buffer. */
memset(buffer->get_host_ptr(), 0, buffer_size_in_bytes);
buffer->flush();
buffer_.append(buffer);
}