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

#include <vk_device.hh>

Inherits blender::NonCopyable, and blender::NonMovable.

Public Member Functions

VKResourcePoolresource_pool_get ()
 
void resource_pool_next ()
 
VKThreadData
 VKThreadData (VKDevice &device, pthread_t thread_id)
 
void deinit (VKDevice &device)
 
- Public Member Functions inherited from blender::NonCopyable
 NonCopyable (const NonCopyable &other)=delete
 
NonCopyableoperator= (const NonCopyable &other)=delete
 
 NonCopyable ()=default
 
 NonCopyable (NonCopyable &&other)=default
 
NonCopyableoperator= (NonCopyable &&other)=default
 

Public Attributes

pthread_t thread_id
 
uint32_t resource_pool_index = UINT32_MAX
 
std::array< VKResourcePool, resource_pools_count > resource_pools
 
int32_t rendering_depth = 0
 

Detailed Description

Shared resources between contexts that run in the same thread.

Definition at line 74 of file vk_device.hh.

Constructor & Destructor Documentation

◆ VKThreadData()

blender::gpu::VKThreadData::VKThreadData ( VKDevice & device,
pthread_t thread_id )

Definition at line 363 of file vk_device.cc.

References resource_pools.

Member Function Documentation

◆ deinit()

void blender::gpu::VKThreadData::deinit ( VKDevice & device)

Definition at line 370 of file vk_device.cc.

References resource_pools.

Referenced by blender::gpu::VKDevice::deinit().

◆ resource_pool_get()

VKResourcePool & blender::gpu::VKThreadData::resource_pool_get ( )
inline

◆ resource_pool_next()

void blender::gpu::VKThreadData::resource_pool_next ( )
inline

Activate the next resource pool.

Definition at line 114 of file vk_device.hh.

References resource_pool_index, and UINT32_MAX.

Member Data Documentation

◆ rendering_depth

int32_t blender::gpu::VKThreadData::rendering_depth = 0

The current rendering depth.

GPU_rendering_begin can be called multiple times forming a hierarchy. The same resource pool should be used for the whole hierarchy. rendering_depth is increased for every GPU_rendering_begin and decreased when GPU_rendering_end is called. Resources pools are cycled when the rendering_depth set to 0.

Definition at line 97 of file vk_device.hh.

Referenced by blender::gpu::VKBackend::render_begin(), and blender::gpu::VKBackend::render_end().

◆ resource_pool_index

uint32_t blender::gpu::VKThreadData::resource_pool_index = UINT32_MAX

Index of the active resource pool. Is in sync with the active swap chain image or cycled when rendering.

NOTE: Initialized to UINT32_MAX to detect first change.

Definition at line 86 of file vk_device.hh.

Referenced by resource_pool_get(), resource_pool_next(), and blender::gpu::VKContext::sync_backbuffer().

◆ resource_pools

std::array<VKResourcePool, resource_pools_count> blender::gpu::VKThreadData::resource_pools

Definition at line 87 of file vk_device.hh.

Referenced by deinit(), resource_pool_get(), and VKThreadData().

◆ thread_id

pthread_t blender::gpu::VKThreadData::thread_id

Thread ID this instance belongs to.

Definition at line 79 of file vk_device.hh.


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