Blender V4.3
blender::gpu::MTLQueryPool Class Reference

#include <mtl_query.hh>

Inherits blender::gpu::QueryPool.

Public Member Functions

 MTLQueryPool ()
 
 ~MTLQueryPool ()
 
void init (GPUQueryType type) override
 
void begin_query () override
 
void end_query () override
 
void get_occlusion_result (MutableSpan< uint32_t > r_values) override
 
- Public Member Functions inherited from blender::gpu::QueryPool
virtual ~QueryPool ()
 

Detailed Description

Definition at line 18 of file mtl_query.hh.

Constructor & Destructor Documentation

◆ MTLQueryPool()

blender::gpu::MTLQueryPool::MTLQueryPool ( )

Definition at line 19 of file mtl_query.mm.

◆ ~MTLQueryPool()

blender::gpu::MTLQueryPool::~MTLQueryPool ( )

Definition at line 23 of file mtl_query.mm.

References BLI_assert.

Member Function Documentation

◆ begin_query()

◆ end_query()

void blender::gpu::MTLQueryPool::end_query ( )
overridevirtual

◆ get_occlusion_result()

void blender::gpu::MTLQueryPool::get_occlusion_result ( MutableSpan< uint32_t > r_values)
overridevirtual

Must be fed with a buffer large enough to contain all the queries issued. IMPORTANT: Result for each query can be either binary or represent the number of samples drawn.

Implements blender::gpu::QueryPool.

Definition at line 99 of file mtl_query.mm.

References BLI_assert, blender::gpu::MTLContext::device, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), blender::gpu::MTLContext::get(), blender::gpu::MTLContext::get_inside_frame(), GPU_finish(), blender::gpu::MTLContext::main_command_buffer, blender::gpu::MTLContext::set_visibility_buffer(), and blender::gpu::VISIBILITY_COUNT_PER_BUFFER.

◆ init()

void blender::gpu::MTLQueryPool::init ( GPUQueryType type)
overridevirtual

Will start and end the query at this index inside the pool. The pool will resize automatically but does not support sparse allocation. So prefer using consecutive indices.

Implements blender::gpu::QueryPool.

Definition at line 55 of file mtl_query.mm.

References BLI_assert, and blender::gpu::to_mtl_type().


The documentation for this class was generated from the following files: