Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_query.mm
| Show All 24 Lines | for (gpu::MTLBuffer *buf : buffer_) { | ||||
| buf->free(); | buf->free(); | ||||
| } | } | ||||
| } | } | ||||
| void MTLQueryPool::allocate() | void MTLQueryPool::allocate() | ||||
| { | { | ||||
| /* Allocate Metal buffer for visibility results. */ | /* Allocate Metal buffer for visibility results. */ | ||||
| size_t buffer_size_in_bytes = VISIBILITY_COUNT_PER_BUFFER * VISIBILITY_RESULT_SIZE_IN_BYTES; | size_t buffer_size_in_bytes = VISIBILITY_COUNT_PER_BUFFER * VISIBILITY_RESULT_SIZE_IN_BYTES; | ||||
| gpu::MTLBuffer *buffer = MTLContext::get_global_memory_manager().allocate(buffer_size_in_bytes, | gpu::MTLBuffer *buffer = MTLContext::get_global_memory_manager()->allocate(buffer_size_in_bytes, | ||||
| true); | true); | ||||
| BLI_assert(buffer); | BLI_assert(buffer); | ||||
| buffer_.append(buffer); | buffer_.append(buffer); | ||||
| } | } | ||||
| static inline MTLVisibilityResultMode to_mtl_type(GPUQueryType type) | static inline MTLVisibilityResultMode to_mtl_type(GPUQueryType type) | ||||
| { | { | ||||
| if (type == GPU_QUERY_OCCLUSION) { | if (type == GPU_QUERY_OCCLUSION) { | ||||
| return MTLVisibilityResultModeBoolean; | return MTLVisibilityResultModeBoolean; | ||||
| ▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines | |||||